pub struct BM25Config {
pub k1: f32,
pub b: f32,
}Expand description
BM25 configuration parameters
These parameters control how BM25 scores documents:
- k1: Controls term frequency saturation (typical: 1.2-2.0)
- b: Controls document length normalization (typical: 0.75)
§References
Robertson, S. E., & Zaragoza, H. (2009). The probabilistic relevance framework: BM25 and beyond.
Fields§
§k1: f32k1 parameter: Controls term frequency saturation
Higher values give more weight to term frequency.
- k1 = 0: Binary (term present/absent)
- k1 = 1.2: Default, balanced
- k1 = 2.0: More emphasis on frequency
b: f32b parameter: Controls document length normalization
Controls how much document length affects the score.
- b = 0: No length normalization
- b = 0.75: Default, balanced
- b = 1.0: Full length normalization
Trait Implementations§
Source§impl Clone for BM25Config
impl Clone for BM25Config
Source§fn clone(&self) -> BM25Config
fn clone(&self) -> BM25Config
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BM25Config
impl Debug for BM25Config
Source§impl Default for BM25Config
impl Default for BM25Config
Source§impl<'de> Deserialize<'de> for BM25Config
impl<'de> Deserialize<'de> for BM25Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BM25Config
impl RefUnwindSafe for BM25Config
impl Send for BM25Config
impl Sync for BM25Config
impl Unpin for BM25Config
impl UnwindSafe for BM25Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more