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,47 @@
|
||||
# mvn test -Dtest=GoldenSetGateTest -Drageval.retriever=bm25-lettersonly
|
||||
|
||||
# Gate run for retriever 'bm25-lettersonly'
|
||||
tolerance : 0.04
|
||||
overall MRR : 0.751
|
||||
overall nDCG@10: 0.741
|
||||
misses@5 : [q02, q03, q22, q24]
|
||||
violations : 13
|
||||
org.opentest4j.AssertionFailedError:
|
||||
retrieval regression against baseline.properties:
|
||||
- overall hit@1 = 0.667, below baseline 0.733 - 0.04 = 0.693
|
||||
- exact hit@1 = 0.818, below baseline 1.000 - 0.04 = 0.960
|
||||
- overall hit@5 = 0.867, below baseline 0.933 - 0.04 = 0.893
|
||||
- exact hit@5 = 0.818, below baseline 1.000 - 0.04 = 0.960
|
||||
- overall recall@5 = 0.800, below baseline 0.867 - 0.04 = 0.827
|
||||
- exact recall@5 = 0.818, below baseline 1.000 - 0.04 = 0.960
|
||||
- exact recall@10 = 0.909, below baseline 1.000 - 0.04 = 0.960
|
||||
- overall mrr = 0.751, below baseline 0.814 - 0.04 = 0.774
|
||||
- exact mrr = 0.828, below baseline 1.000 - 0.04 = 0.960
|
||||
- overall ndcg@10 = 0.741, below baseline 0.798 - 0.04 = 0.758
|
||||
- exact ndcg@10 = 0.846, below baseline 1.000 - 0.04 = 0.960
|
||||
- new miss@5: q02 "E-4012" (relevant not in top 5, got [p01, p02, p03, p04, p05])
|
||||
- new miss@5: q03 "E-5003" (relevant not in top 5, got [p01, p02, p03, p04, p05]) ==> expected: <true> but was: <false>
|
||||
[INFO]
|
||||
[INFO] Results:
|
||||
[INFO]
|
||||
[ERROR] Failures:
|
||||
[ERROR] GoldenSetGateTest.retrievalHasNotRegressed:31 retrieval regression against baseline.properties:
|
||||
- overall hit@1 = 0.667, below baseline 0.733 - 0.04 = 0.693
|
||||
- exact hit@1 = 0.818, below baseline 1.000 - 0.04 = 0.960
|
||||
- overall hit@5 = 0.867, below baseline 0.933 - 0.04 = 0.893
|
||||
- exact hit@5 = 0.818, below baseline 1.000 - 0.04 = 0.960
|
||||
- overall recall@5 = 0.800, below baseline 0.867 - 0.04 = 0.827
|
||||
- exact recall@5 = 0.818, below baseline 1.000 - 0.04 = 0.960
|
||||
- exact recall@10 = 0.909, below baseline 1.000 - 0.04 = 0.960
|
||||
- overall mrr = 0.751, below baseline 0.814 - 0.04 = 0.774
|
||||
- exact mrr = 0.828, below baseline 1.000 - 0.04 = 0.960
|
||||
- overall ndcg@10 = 0.741, below baseline 0.798 - 0.04 = 0.758
|
||||
- exact ndcg@10 = 0.846, below baseline 1.000 - 0.04 = 0.960
|
||||
- new miss@5: q02 "E-4012" (relevant not in top 5, got [p01, p02, p03, p04, p05])
|
||||
- new miss@5: q03 "E-5003" (relevant not in top 5, got [p01, p02, p03, p04, p05]) ==> expected: <true> but was: <false>
|
||||
[INFO]
|
||||
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
|
||||
[INFO]
|
||||
[INFO] BUILD FAILURE
|
||||
|
||||
exit status of mvn: non-zero (see BUILD FAILURE above)
|
||||
Reference in New Issue
Block a user