Skip to content

Commit

Permalink
Prepare addition of the TREC Tip-of-the-Tongue dataset allenai#235
Browse files Browse the repository at this point in the history
  • Loading branch information
mam10eks committed Jun 7, 2023
1 parent 095d2af commit 04a8c54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ir_datasets/datasets/trec_tip_of_the_tongue.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ class TipOfTheTongueQuery(NamedTuple):

def default_text(self):
return self.title + ' ' + self.text

def __getattr__(self, attr):
if attr == 'query_id':
return self.id

return self.__getattribute__(attr)


def _init():
Expand Down
3 changes: 3 additions & 0 deletions test/integration/trec_tip_of_the_tongue.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def test_test_tip_of_the_tongue_queries_train(self):
self._test_queries('trec-tip-of-the-tongue/train', count=150)
query = list(ir_datasets.load('trec-tip-of-the-tongue/train').queries_iter())[0]
self.assertEqual('763', query.id)
self.assertEqual('763', query.query_id)

self.assertTrue(query.text.startswith("Very rare movie that is scifi/dystopian/experimental/surreal. It’s like Stalker meets el Topo meets"))

Expand All @@ -26,6 +27,7 @@ def test_test_tip_of_the_tongue_queries_dev(self):
self._test_queries('trec-tip-of-the-tongue/dev', count=150)
query = list(ir_datasets.load('trec-tip-of-the-tongue/dev').queries_iter())[0]
self.assertEqual('152', query.id)
self.assertEqual('152', query.query_id)
self.assertTrue(query.text.startswith("Movie from the early 2000s I believe about three people living in an apartment"))


Expand All @@ -47,3 +49,4 @@ def test_test_tip_of_the_tongue_qrels_dev(self):

if __name__ == '__main__':
unittest.main()

0 comments on commit 04a8c54

Please sign in to comment.