From 744ed2ddd976c9fcc315a5bff6bef37b37fdaeff Mon Sep 17 00:00:00 2001 From: Sean MacAvaney Date: Fri, 8 Nov 2024 10:25:39 +0000 Subject: [PATCH] added missing default_text for BEIR fixes #273 --- ir_datasets/datasets/beir.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ir_datasets/datasets/beir.py b/ir_datasets/datasets/beir.py index d31e4936..54d4e884 100644 --- a/ir_datasets/datasets/beir.py +++ b/ir_datasets/datasets/beir.py @@ -54,6 +54,11 @@ class BeirSciDoc(NamedTuple): year: int cited_by: List[str] references: List[str] + def default_text(self): + """ + title text + """ + return f'{self.title} {self.text}' class BeirCordDoc(NamedTuple): doc_id: str @@ -73,6 +78,11 @@ class BeirToucheDoc(NamedTuple): title: str stance: str url: str + def default_text(self): + """ + title text + """ + return f'{self.title} {self.text}' class BeirCqaDoc(NamedTuple): doc_id: str @@ -89,6 +99,11 @@ class BeirUrlQuery(NamedTuple): query_id: str text: str url: str + def default_text(self): + """ + text + """ + return self.text class BeirSciQuery(NamedTuple): query_id: str @@ -97,12 +112,22 @@ class BeirSciQuery(NamedTuple): year: int cited_by: List[str] references: List[str] + def default_text(self): + """ + text + """ + return self.text class BeirToucheQuery(NamedTuple): query_id: str text: str description: str narrative: str + def default_text(self): + """ + text + """ + return self.text class BeirCovidQuery(NamedTuple): query_id: str