Datasets:
Tasks:
Question Answering
Sub-tasks:
extractive-qa
Languages:
English
Size:
10K<n<100K
ArXiv:
Tags:
multi-hop
License:
Commit
•
c446902
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +141 -0
- dataset_infos.json +1 -0
- dummy/masked/1.0.0/dummy_data.zip +3 -0
- dummy/original/1.0.0/dummy_data.zip +3 -0
- wiki_hop.py +120 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- crowdsourced
|
4 |
+
language_creators:
|
5 |
+
- expert-generated
|
6 |
+
languages:
|
7 |
+
- en
|
8 |
+
licenses:
|
9 |
+
- cc-by-sa-3-0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- question-answering
|
18 |
+
task_ids:
|
19 |
+
- extractive-qa
|
20 |
+
- question-answering-other-multi-hop
|
21 |
+
---
|
22 |
+
|
23 |
+
# Dataset Card Creation Guide
|
24 |
+
|
25 |
+
## Table of Contents
|
26 |
+
- [Dataset Description](#dataset-description)
|
27 |
+
- [Dataset Summary](#dataset-summary)
|
28 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
29 |
+
- [Languages](#languages)
|
30 |
+
- [Dataset Structure](#dataset-structure)
|
31 |
+
- [Data Instances](#data-instances)
|
32 |
+
- [Data Fields](#data-instances)
|
33 |
+
- [Data Splits](#data-instances)
|
34 |
+
- [Dataset Creation](#dataset-creation)
|
35 |
+
- [Curation Rationale](#curation-rationale)
|
36 |
+
- [Source Data](#source-data)
|
37 |
+
- [Annotations](#annotations)
|
38 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
39 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
40 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
41 |
+
- [Discussion of Biases](#discussion-of-biases)
|
42 |
+
- [Other Known Limitations](#other-known-limitations)
|
43 |
+
- [Additional Information](#additional-information)
|
44 |
+
- [Dataset Curators](#dataset-curators)
|
45 |
+
- [Licensing Information](#licensing-information)
|
46 |
+
- [Citation Information](#citation-information)
|
47 |
+
|
48 |
+
## Dataset Description
|
49 |
+
|
50 |
+
- **Homepage:** [QAngaroo](http://qangaroo.cs.ucl.ac.uk/)
|
51 |
+
- **Repository:** [If the dataset is hosted on github or has a github homepage, add URL here]()
|
52 |
+
- **Paper:** [Constructing Datasets for Multi-hop Reading Comprehension Across Documents](https://arxiv.org/abs/1710.06481)
|
53 |
+
- **Leaderboard:** [leaderboard](http://qangaroo.cs.ucl.ac.uk/leaderboard.html)
|
54 |
+
- **Point of Contact:** [Johannes Welbl]([email protected])
|
55 |
+
|
56 |
+
### Dataset Summary
|
57 |
+
|
58 |
+
[More Information Needed]
|
59 |
+
|
60 |
+
### Supported Tasks and Leaderboards
|
61 |
+
|
62 |
+
[More Information Needed]
|
63 |
+
|
64 |
+
### Languages
|
65 |
+
|
66 |
+
[More Information Needed]
|
67 |
+
|
68 |
+
## Dataset Structure
|
69 |
+
|
70 |
+
### Data Instances
|
71 |
+
|
72 |
+
[More Information Needed]
|
73 |
+
|
74 |
+
### Data Fields
|
75 |
+
|
76 |
+
[More Information Needed]
|
77 |
+
|
78 |
+
### Data Splits
|
79 |
+
|
80 |
+
[More Information Needed]
|
81 |
+
## Dataset Creation
|
82 |
+
|
83 |
+
### Curation Rationale
|
84 |
+
|
85 |
+
[More Information Needed]
|
86 |
+
|
87 |
+
### Source Data
|
88 |
+
|
89 |
+
[More Information Needed]
|
90 |
+
|
91 |
+
#### Initial Data Collection and Normalization
|
92 |
+
|
93 |
+
[More Information Needed]
|
94 |
+
|
95 |
+
#### Who are the source language producers?
|
96 |
+
|
97 |
+
[More Information Needed]
|
98 |
+
|
99 |
+
### Annotations
|
100 |
+
|
101 |
+
[More Information Needed]
|
102 |
+
|
103 |
+
#### Annotation process
|
104 |
+
|
105 |
+
[More Information Needed]
|
106 |
+
|
107 |
+
#### Who are the annotators?
|
108 |
+
|
109 |
+
[More Information Needed]
|
110 |
+
|
111 |
+
### Personal and Sensitive Information
|
112 |
+
|
113 |
+
[More Information Needed]
|
114 |
+
|
115 |
+
## Considerations for Using the Data
|
116 |
+
|
117 |
+
### Social Impact of Dataset
|
118 |
+
|
119 |
+
[More Information Needed]
|
120 |
+
|
121 |
+
### Discussion of Biases
|
122 |
+
|
123 |
+
[More Information Needed]
|
124 |
+
|
125 |
+
### Other Known Limitations
|
126 |
+
|
127 |
+
[More Information Needed]
|
128 |
+
|
129 |
+
## Additional Information
|
130 |
+
|
131 |
+
### Dataset Curators
|
132 |
+
|
133 |
+
[More Information Needed]
|
134 |
+
|
135 |
+
### Licensing Information
|
136 |
+
|
137 |
+
[More Information Needed]
|
138 |
+
|
139 |
+
### Citation Information
|
140 |
+
|
141 |
+
[More Information Needed]
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"original": {"description": "WikiHop is open-domain and based on Wikipedia articles; the goal is to recover Wikidata information by hopping through documents. The goal is to answer text understanding queries by combining multiple facts that are spread across different documents.\n", "citation": "@misc{welbl2018constructing,\n title={Constructing Datasets for Multi-hop Reading Comprehension Across Documents}, \n author={Johannes Welbl and Pontus Stenetorp and Sebastian Riedel},\n year={2018},\n eprint={1710.06481},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "http://qangaroo.cs.ucl.ac.uk/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "query": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "candidates": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "supports": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "annotations": {"feature": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "wiki_hop", "config_name": "original", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 325952974, "num_examples": 43738, "dataset_name": "wiki_hop"}, "validation": {"name": "validation", "num_bytes": 41246536, "num_examples": 5129, "dataset_name": "wiki_hop"}}, "download_checksums": {"https://drive.google.com/uc?export=download&id=1ytVZ4AhubFDOEL7o7XrIRIyhU8g9wvKA": {"num_bytes": 339843061, "checksum": "2f512869760cdad76a022a1465f025b486ae79dc5b8f0bf3ad901a4caf2d3050"}}, "download_size": 339843061, "post_processing_size": null, "dataset_size": 367199510, "size_in_bytes": 707042571}, "masked": {"description": "WikiHop is open-domain and based on Wikipedia articles; the goal is to recover Wikidata information by hopping through documents. The goal is to answer text understanding queries by combining multiple facts that are spread across different documents.\n", "citation": "@misc{welbl2018constructing,\n title={Constructing Datasets for Multi-hop Reading Comprehension Across Documents}, \n author={Johannes Welbl and Pontus Stenetorp and Sebastian Riedel},\n year={2018},\n eprint={1710.06481},\n archivePrefix={arXiv},\n primaryClass={cs.CL}\n}\n", "homepage": "http://qangaroo.cs.ucl.ac.uk/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "candidates": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "supports": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "annotations": {"feature": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "wiki_hop", "config_name": "masked", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 348249138, "num_examples": 43738, "dataset_name": "wiki_hop"}, "validation": {"name": "validation", "num_bytes": 44066862, "num_examples": 5129, "dataset_name": "wiki_hop"}}, "download_checksums": {"https://drive.google.com/uc?export=download&id=1ytVZ4AhubFDOEL7o7XrIRIyhU8g9wvKA": {"num_bytes": 339843061, "checksum": "2f512869760cdad76a022a1465f025b486ae79dc5b8f0bf3ad901a4caf2d3050"}}, "download_size": 339843061, "post_processing_size": null, "dataset_size": 392316000, "size_in_bytes": 732159061}}
|
dummy/masked/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b579827883b58a8c40e8b4105d1e1908b2b55173d7181e241557cafa9e95eeb3
|
3 |
+
size 25031
|
dummy/original/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b579827883b58a8c40e8b4105d1e1908b2b55173d7181e241557cafa9e95eeb3
|
3 |
+
size 25031
|
wiki_hop.py
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
"""WikiHop: Reading Comprehension with Multiple Hops"""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import json
|
20 |
+
import os
|
21 |
+
|
22 |
+
import datasets
|
23 |
+
|
24 |
+
|
25 |
+
_CITATION = """\
|
26 |
+
@misc{welbl2018constructing,
|
27 |
+
title={Constructing Datasets for Multi-hop Reading Comprehension Across Documents},
|
28 |
+
author={Johannes Welbl and Pontus Stenetorp and Sebastian Riedel},
|
29 |
+
year={2018},
|
30 |
+
eprint={1710.06481},
|
31 |
+
archivePrefix={arXiv},
|
32 |
+
primaryClass={cs.CL}
|
33 |
+
}
|
34 |
+
"""
|
35 |
+
|
36 |
+
_DESCRIPTION = """\
|
37 |
+
WikiHop is open-domain and based on Wikipedia articles; the goal is to recover Wikidata information by hopping through documents. \
|
38 |
+
The goal is to answer text understanding queries by combining multiple facts that are spread across different documents.
|
39 |
+
"""
|
40 |
+
|
41 |
+
_URL = "https://drive.google.com/uc?export=download&id=1ytVZ4AhubFDOEL7o7XrIRIyhU8g9wvKA"
|
42 |
+
|
43 |
+
|
44 |
+
class WikiHopConfig(datasets.BuilderConfig):
|
45 |
+
"""BuilderConfig for WikiHop."""
|
46 |
+
|
47 |
+
def __init__(self, masked=False, **kwargs):
|
48 |
+
"""BuilderConfig for WikiHop.
|
49 |
+
|
50 |
+
Args:
|
51 |
+
masked: `bool`, original or maksed data.
|
52 |
+
**kwargs: keyword arguments forwarded to super.
|
53 |
+
"""
|
54 |
+
super(WikiHopConfig, self).__init__(**kwargs)
|
55 |
+
self.masked = masked
|
56 |
+
|
57 |
+
|
58 |
+
class WikiHop(datasets.GeneratorBasedBuilder):
|
59 |
+
"""WikiHop: Reading Comprehension with Multiple Hops"""
|
60 |
+
|
61 |
+
VERSION = datasets.Version("1.0.0")
|
62 |
+
BUILDER_CONFIGS = [
|
63 |
+
WikiHopConfig(
|
64 |
+
name="original",
|
65 |
+
version=datasets.Version("1.0.0"),
|
66 |
+
description="The un-maksed WikiHop dataset",
|
67 |
+
masked=False,
|
68 |
+
),
|
69 |
+
WikiHopConfig(
|
70 |
+
name="masked", version=datasets.Version("1.0.0"), description="Masked WikiHop dataset", masked=True
|
71 |
+
),
|
72 |
+
]
|
73 |
+
BUILDER_CONFIG_CLASS = WikiHopConfig
|
74 |
+
DEFAULT_CONFIG_NAME = "original"
|
75 |
+
|
76 |
+
def _info(self):
|
77 |
+
return datasets.DatasetInfo(
|
78 |
+
description=_DESCRIPTION,
|
79 |
+
features=datasets.Features(
|
80 |
+
{
|
81 |
+
"id": datasets.Value("string"),
|
82 |
+
"question": datasets.Value("string"),
|
83 |
+
"answer": datasets.Value("string"),
|
84 |
+
"candidates": datasets.Sequence(datasets.Value("string")),
|
85 |
+
"supports": datasets.Sequence(datasets.Value("string")),
|
86 |
+
"annotations": datasets.Sequence(datasets.Sequence(datasets.Value("string"))),
|
87 |
+
}
|
88 |
+
),
|
89 |
+
supervised_keys=None,
|
90 |
+
homepage="http://qangaroo.cs.ucl.ac.uk/",
|
91 |
+
citation=_CITATION,
|
92 |
+
)
|
93 |
+
|
94 |
+
def _split_generators(self, dl_manager):
|
95 |
+
extracted_path = dl_manager.download_and_extract(_URL)
|
96 |
+
|
97 |
+
wikihop_path = os.path.join(extracted_path, "qangaroo_v1.1", "wikihop")
|
98 |
+
train_file = "train.json" if self.config.name == "original" else "train.masked.json"
|
99 |
+
dev_file = "dev.json" if self.config.name == "original" else "dev.masked.json"
|
100 |
+
|
101 |
+
return [
|
102 |
+
datasets.SplitGenerator(
|
103 |
+
name=datasets.Split.TRAIN,
|
104 |
+
gen_kwargs={"filepath": os.path.join(wikihop_path, train_file), "split": "train"},
|
105 |
+
),
|
106 |
+
datasets.SplitGenerator(
|
107 |
+
name=datasets.Split.VALIDATION,
|
108 |
+
gen_kwargs={"filepath": os.path.join(wikihop_path, dev_file), "split": "dev"},
|
109 |
+
),
|
110 |
+
]
|
111 |
+
|
112 |
+
def _generate_examples(self, filepath, split):
|
113 |
+
with open(filepath, encoding="utf-8") as f:
|
114 |
+
examples = json.load(f)
|
115 |
+
for i, example in enumerate(examples):
|
116 |
+
# there are no annotations for train split, setting it to empty list
|
117 |
+
if split == "train":
|
118 |
+
example["annotations"] = []
|
119 |
+
example["question"] = example.pop("query")
|
120 |
+
yield example["id"], example
|