Skip to main content

_diffctx/config/
bm25.rs

1use once_cell::sync::Lazy;
2
3pub struct Bm25Config {
4    pub k1: f64,
5    pub b: f64,
6    pub idf_smoothing: f64,
7    pub min_query_token_length: usize,
8}
9
10impl Default for Bm25Config {
11    fn default() -> Self {
12        Self {
13            k1: 2.5,
14            b: 0.75,
15            idf_smoothing: 0.5,
16            min_query_token_length: 3,
17        }
18    }
19}
20
21pub static BM25: Lazy<Bm25Config> = Lazy::new(Bm25Config::default);