Skip to content

Commit

Permalink
Adds test case
Browse files Browse the repository at this point in the history
  • Loading branch information
UShivani3 committed Nov 21, 2024
1 parent 07264a6 commit 5b0a073
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/test/java/io/anserini/eval/RelevanceJudgmentsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,28 @@ public void testTREC24_RAG_RAGGY_DEV() throws IOException{
assertEquals(1, qrels.getRelevanceGrade("253263", "msmarco_v2.1_doc_46_843492186"));
}

@Test
public void testTREC24_RAG_UMBRELA() throws IOException{
// % cut -f 1 -d ' ' tools/topics-and-qrels/qrels.rag24.test-umbrela-all.txt | uniq | wc
// 301 301 3448
// % wc tools/topics-and-qrels/qrels.rag24.raggy-dev.txt
// 108479 433916 6475451 tools/topics-and-qrels/qrels.rag24.test-umbrela-all.txt

RelevanceJudgments qrels = new RelevanceJudgments("tools/topics-and-qrels/qrels.rag24.test-umbrela-all.txt");
assertNotNull(qrels);
assertEquals(301, qrels.getQids().size());
assertEquals(108479, getQrelsCount(qrels));
assertEquals(1, qrels.getRelevanceGrade("2024-145979", "msmarco_v2.1_doc_25_771726319#13_1477564195"));
assertEquals(1, qrels.getRelevanceGrade("2024-216592", "msmarco_v2.1_doc_52_1092442741#3_2165187686"));

qrels = RelevanceJudgments.fromQrels(Qrels.TREC2024_RAG_UMBRELA);
assertNotNull(qrels);
assertEquals(301, qrels.getQids().size());
assertEquals(108479, getQrelsCount(qrels));
assertEquals(1, qrels.getRelevanceGrade("2024-145979", "msmarco_v2.1_doc_25_771726319#13_1477564195"));
assertEquals(1, qrels.getRelevanceGrade("2024-216592", "msmarco_v2.1_doc_52_1092442741#3_2165187686"));
}

@Test
public void testMsmarcoDocDev() throws IOException{
RelevanceJudgments qrels = new RelevanceJudgments("tools/topics-and-qrels/qrels.msmarco-doc.dev.txt");
Expand Down

0 comments on commit 5b0a073

Please sign in to comment.