pub struct RerankingConfig {
pub top_n: usize,
pub min_score: Option<f32>,
pub preserve_original_score: bool,
}Expand description
Reranking 配置
Fields§
§top_n: usize最终返回的文档数量
min_score: Option<f32>最小分数阈值(可选)
preserve_original_score: bool是否保留原始分数
Implementations§
Source§impl RerankingConfig
impl RerankingConfig
Sourcepub fn with_top_n(self, n: usize) -> Self
pub fn with_top_n(self, n: usize) -> Self
设置最终返回的文档数量
Sourcepub fn with_min_score(self, score: f32) -> Self
pub fn with_min_score(self, score: f32) -> Self
设置最小分数阈值
Sourcepub fn with_preserve_original_score(self, preserve: bool) -> Self
pub fn with_preserve_original_score(self, preserve: bool) -> Self
设置是否保留原始分数
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RerankingConfig
impl RefUnwindSafe for RerankingConfig
impl Send for RerankingConfig
impl Sync for RerankingConfig
impl Unpin for RerankingConfig
impl UnsafeUnpin for RerankingConfig
impl UnwindSafe for RerankingConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more