Spaces:
Runtime error
Runtime error
Commit History
-
M2 done-criterion: qualitative BM25 vs dense comparisonβ
CamQuestByte +1: Claude Sonnet 4.6Adds the M2 "one query where dense wins, one where BM25 wins, one tie" with concrete examples, plus the infrastructure to reproduce them. Tooling: - retrievers/bm25_index.py (new): persistable BM25 index + corpus dicts, Lucene-style split from the query layer - retrievers/bm25.py: BM25Retriever now wraps BM25Index, gains from_cache() classmethod; existing BM25Retriever(corpus) callers unchanged - scripts/cache_bm25.py (new): one-time build to .cache/bm25/ (~400 MB), drops the ~2-3 min corpus+index rebuild on every comparison run - scripts/compare_retrievers.py (new): per-query rank-of-relevant in BM25 vs dense, classify by margin (winnerβ€5, loser>20|missing), print top-N examples per bucket with code snippets and the rival retriever's pick Findings (full corpus, n=22,176 queries): - Dense β« BM25 : 19.9% (4,415 queries) - BM25 β« Dense : 5.8% (1,287) - Both at #1 : 12.5% (2,765) - Gray zone : 61.8% (13,709) β M3 opportunity surface - Win ratiβ¦5de6364