Skip to content

Commit

Permalink
added missing default_text for BEIR
Browse files Browse the repository at this point in the history
fixes #273
  • Loading branch information
seanmacavaney committed Nov 8, 2024
1 parent ce73e6a commit 744ed2d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ir_datasets/datasets/beir.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 744ed2d

Please sign in to comment.