MCPcopy Create free account
hub / github.com/cosdata/cosdata / get_idf

Function get_idf

src/models/sparse_ann_query.rs:383–387  ·  view source on GitHub ↗
(documents_count: u32, documents_containing_term: u32)

Source from the content-addressed store, hash-verified

381}
382
383fn get_idf(documents_count: u32, documents_containing_term: u32) -> f32 {
384 (((documents_count - documents_containing_term) as f32 + 0.5)
385 / (documents_containing_term as f32 + 0.5))
386 .ln_1p()
387}

Callers 1

search_bm25Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected