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

Function compute_bm25_tf

tests/test_hybrid.py:248–251  ·  view source on GitHub ↗
(
    raw_tf: int, doc_len: int, avg_doc_len: float, k: float = K1, b: float = B
)

Source from the content-addressed store, hash-verified

246
247
248def compute_bm25_tf(
249 raw_tf: int, doc_len: int, avg_doc_len: float, k: float = K1, b: float = B
250) -> float:
251 return raw_tf * (k + 1) / (raw_tf + k * (1 - b + b * doc_len / avg_doc_len))
252
253
254def merge_cqa_dupstack(data_path: str, verbose: bool = False):

Callers 2

build_vectorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected