Sean MacAvaney commited on
Commit
e895a31
·
1 Parent(s): 4551517

commit files to HF hub

Browse files
Files changed (2) hide show
  1. README.md +34 -0
  2. antique_train_split200-valid.py +44 -0
README.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: '`antique/train/split200-valid`'
3
+ viewer: false
4
+ ---
5
+
6
+ # Dataset Card for `antique/train/split200-valid`
7
+
8
+ The `antique/train/split200-valid` IR dataset, provided by the [ir-datasets](https://ir-datasets.com/) package.
9
+
10
+ This dataset provides:
11
+ - `queries` (i.e., topics)
12
+ - `qrels`: (relevance assessments)
13
+
14
+
15
+ Find more information about the dataset [here](https://ir-datasets.com/{dsid.split('/')[0]}#{dsid}).
16
+
17
+ ## Usage
18
+
19
+ ```python
20
+ from datasets import load_dataset
21
+ dataset = load_dataset({repr("irds/"+hgf_id)})
22
+ ```
23
+
24
+
25
+ ## Citation Information
26
+
27
+ ```
28
+ @inproceedings{Hashemi2020Antique,
29
+ title={ANTIQUE: A Non-Factoid Question Answering Benchmark},
30
+ author={Helia Hashemi and Mohammad Aliannejadi and Hamed Zamani and Bruce Croft},
31
+ booktitle={ECIR},
32
+ year={2020}
33
+ }
34
+ ```
antique_train_split200-valid.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 = 'antique/train/split200-valid'
11
+ IRDS_ENTITY_TYPES = {'queries': {'query_id': 'string', 'text': 'string'}, 'qrels': {'query_id': 'string', 'doc_id': 'string', 'relevance': 'int64'}}
12
+
13
+ _CITATION = '@inproceedings{Hashemi2020Antique,\n title={ANTIQUE: A Non-Factoid Question Answering Benchmark},\n author={Helia Hashemi and Mohammad Aliannejadi and Hamed Zamani and Bruce Croft},\n booktitle={ECIR},\n year={2020}\n}'
14
+
15
+ _DESCRIPTION = "" # TODO
16
+
17
+ class antique_train_split200_valid(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/antique#antique/train/split200-valid",
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)