Skip to content

Commit

Permalink
added missing default_text for BEIR (#274)
Browse files Browse the repository at this point in the history
* added missing default_text for BEIR
fixes #273

* bump version
  • Loading branch information
seanmacavaney authored Nov 8, 2024
1 parent e974801 commit b9ae1f2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ir_datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ def main_cli():
import sys
main(sys.argv[1:])

__version__ = "0.5.8" # NOTE: keep this in sync with setup.py
__version__ = "0.5.9" # NOTE: keep this in sync with setup.py
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="ir_datasets",
version="0.5.8", # NOTE: keep this in sync with ir_datasets/__init__.py
version="0.5.9", # NOTE: keep this in sync with ir_datasets/__init__.py
author="Sean MacAvaney",
author_email="[email protected]",
description="provides a common interface to many IR ad-hoc ranking benchmarks, training datasets, etc.",
Expand Down

0 comments on commit b9ae1f2

Please sign in to comment.