Skip to content

Commit

Permalink
Adds bindings for umbrela qrel (#2629)
Browse files Browse the repository at this point in the history
* Adds bindings for umbrela qrel

* Adds test case
  • Loading branch information
UShivani3 authored Nov 21, 2024
1 parent 7da90eb commit 06eb93f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/io/anserini/eval/Qrels.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public enum Qrels {
TREC2022_DL_DOC_MSMARCO_V21("qrels.dl22-doc-msmarco-v2.1.txt"),
TREC2023_DL_DOC_MSMARCO_V21("qrels.dl23-doc-msmarco-v2.1.txt"),
TREC2024_RAG_RAGGY_DEV("qrels.rag24.raggy-dev.txt"),
TREC2024_RAG_UMBRELA("qrels.rag24.test-umbrela-all.txt"),
MSMARCO_DOC_DEV("qrels.msmarco-doc.dev.txt"),
MSMARCO_PASSAGE_DEV_SUBSET("qrels.msmarco-passage.dev-subset.txt"),
MSMARCO_V2_DOC_DEV("qrels.msmarco-v2-doc.dev.txt"),
Expand Down
24 changes: 23 additions & 1 deletion src/test/java/io/anserini/eval/RelevanceJudgmentsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public int getQrelsCount(RelevanceJudgments qrels) throws IOException{

@Test
public void testTotalCount() {
assertEquals(170, Qrels.values().length);
assertEquals(171, Qrels.values().length);
}

@Test(expected = IOException.class)
Expand Down 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
2 changes: 1 addition & 1 deletion tools

0 comments on commit 06eb93f

Please sign in to comment.