Add rag-eval module: retrieval metrics, golden dataset and a JUnit regression gate
hit@k, recall@k, precision@k, MRR and nDCG@k in plain Java with their edge cases pinned by tests, a 30-question graded golden dataset over a 40-passage runbook, a paired bootstrap, and a gate (baseline + tolerance + no new misses) shown failing on a tokenizer that drops digits. BM25, a hashed-trigram vector (not a neural embedding) and RRF; no model, no network. Java 25, JUnit 6.1.3. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7F47n8shUHpexxavn
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
0bb301d361
commit
98ed878675
@@ -0,0 +1,10 @@
|
||||
# Edge cases that change the number
|
||||
|
||||
1 duplicates [p01 p01 p01 p02 p03], p01 relevant, precision@5 = 0.20 (naive count would give 0.60)
|
||||
2 precision cap perfect list, one relevant passage, precision@5 = 0.20
|
||||
3 short list 2 results, precision@5 = 0.20
|
||||
4 no relevant recall@5 = NaN, nDCG@5 = NaN
|
||||
5 MRR blind to the second hit: 0.50 vs 0.50
|
||||
6 order, same recall@2 = 1.00:
|
||||
support first nDCG@2 = 0.7967, MRR = 1.00
|
||||
answer first nDCG@2 = 1.0000, MRR = 1.00
|
||||
Reference in New Issue
Block a user