eval.lexical¶
chunktuner.eval.lexical
¶
Lexical (BM25) retrieval and rank fusion for the evaluator's retrieval pipeline.
Bm25Index
¶
BM25 index over texts (one entry per chunk); IDF is computed over all of them.
Texts with no tokens (after lowercasing and English stopword removal) score 0 for every query, and a query with no tokens scores 0 against every text.
Source code in src/chunktuner/eval/lexical.py
scores
¶
BM25 score of query against every indexed text (float64, length len(texts)).
Source code in src/chunktuner/eval/lexical.py
rrf_fuse
¶
Reciprocal rank fusion of rankings over the same candidate set.
Each ranking is an array of candidate indices, best first. A candidate's fused score is
sum(1 / (k + rank)) over the rankings (rank starts at 1). Returns candidate indices
by fused score, best first; ties keep their order in the first ranking.