Sean MacAvaney commited on
Commit
8592490
1 Parent(s): a466fda

commit files to HF hub

Browse files
Files changed (2) hide show
  1. README.md +47 -0
  2. beir_arguana.py +44 -0
README.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: '`beir/arguana`'
3
+ viewer: false
4
+ ---
5
+
6
+ # Dataset Card for `beir/arguana`
7
+
8
+ The `beir/arguana` IR dataset, provided by the [ir-datasets](https://ir-datasets.com/) package.
9
+
10
+ This dataset provides:
11
+ - `docs` (documents, i.e., the corpus)
12
+ - `queries` (i.e., topics)
13
+ - `qrels`: (relevance assessments)
14
+
15
+
16
+ Find more information about the dataset [here](https://ir-datasets.com/{dsid.split('/')[0]}#{dsid}).
17
+
18
+ ## Usage
19
+
20
+ ```python
21
+ from datasets import load_dataset
22
+ dataset = load_dataset({repr("irds/"+hgf_id)})
23
+ ```
24
+
25
+
26
+ ## Citation Information
27
+
28
+ ```
29
+ @inproceedings{Wachsmuth2018Arguana,
30
+ author = "Wachsmuth, Henning and Syed, Shahbaz and Stein, Benno",
31
+ title = "Retrieval of the Best Counterargument without Prior Topic Knowledge",
32
+ booktitle = "Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
33
+ year = "2018",
34
+ publisher = "Association for Computational Linguistics",
35
+ location = "Melbourne, Australia",
36
+ pages = "241--251",
37
+ url = "http://aclweb.org/anthology/P18-1023"
38
+ }
39
+ @article{Thakur2021Beir,
40
+ title = "BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Models",
41
+ author = "Thakur, Nandan and Reimers, Nils and Rücklé, Andreas and Srivastava, Abhishek and Gurevych, Iryna",
42
+ journal= "arXiv preprint arXiv:2104.08663",
43
+ month = "4",
44
+ year = "2021",
45
+ url = "https://arxiv.org/abs/2104.08663",
46
+ }
47
+ ```
beir_arguana.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ """
3
+ """ # TODO
4
+ try:
5
+ import ir_datasets
6
+ except ImportError as e:
7
+ raise ImportError('ir-datasets package missing; `pip install ir-datasets`')
8
+ import datasets
9
+
10
+ IRDS_ID = 'beir/arguana'
11
+ IRDS_ENTITY_TYPES = {'docs': {'doc_id': 'string', 'text': 'string', 'title': 'string'}, 'queries': {'query_id': 'string', 'text': 'string'}, 'qrels': {'query_id': 'string', 'doc_id': 'string', 'relevance': 'int64', 'iteration': 'string'}}
12
+
13
+ _CITATION = '@inproceedings{Wachsmuth2018Arguana,\n author = "Wachsmuth, Henning and Syed, Shahbaz and Stein, Benno",\n title = "Retrieval of the Best Counterargument without Prior Topic Knowledge",\n booktitle = "Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",\n year = "2018",\n publisher = "Association for Computational Linguistics",\n location = "Melbourne, Australia",\n pages = "241--251",\n url = "http://aclweb.org/anthology/P18-1023"\n}\n@article{Thakur2021Beir,\n title = "BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Models",\n author = "Thakur, Nandan and Reimers, Nils and Rücklé, Andreas and Srivastava, Abhishek and Gurevych, Iryna", \n journal= "arXiv preprint arXiv:2104.08663",\n month = "4",\n year = "2021",\n url = "https://arxiv.org/abs/2104.08663",\n}'
14
+
15
+ _DESCRIPTION = "" # TODO
16
+
17
+ class beir_arguana(datasets.GeneratorBasedBuilder):
18
+ BUILDER_CONFIGS = [datasets.BuilderConfig(name=e) for e in IRDS_ENTITY_TYPES]
19
+ DEFAULT_CONFIG_NAME = list(IRDS_ENTITY_TYPES)[0]
20
+
21
+ def _info(self):
22
+ return datasets.DatasetInfo(
23
+ description=_DESCRIPTION,
24
+ features=datasets.Features({k: datasets.Value(v) for k, v in IRDS_ENTITY_TYPES[self.config.name].items()}),
25
+ homepage=f"https://ir-datasets.com/beir#beir/arguana",
26
+ citation=_CITATION,
27
+ )
28
+
29
+ def _split_generators(self, dl_manager):
30
+ return [datasets.SplitGenerator(name=self.config.name)]
31
+
32
+ def _generate_examples(self):
33
+ dataset = ir_datasets.load(IRDS_ID)
34
+ for i, item in enumerate(getattr(dataset, self.config.name)):
35
+ key = i
36
+ if self.config.name == 'docs':
37
+ key = item.doc_id
38
+ elif self.config.name == 'queries':
39
+ key = item.query_id
40
+ yield key, item._asdict()
41
+
42
+ def as_dataset(self, split=None, *args, **kwargs):
43
+ split = self.config.name # always return split corresponding with this config to avid returning a redundant DatasetDict layer
44
+ return super().as_dataset(split, *args, **kwargs)