Datasets:
Tasks:
Question Answering
Modalities:
Text
Formats:
parquet
Sub-tasks:
extractive-qa
Languages:
English
Size:
100K - 1M
ArXiv:
License:
Commit
•
f39b222
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 +290 -0
- dataset_infos.json +1 -0
- dummy/plain_text/1.1.0/dummy_data.zip +3 -0
- mrqa.py +197 -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,290 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- found
|
4 |
+
language_creators:
|
5 |
+
- found
|
6 |
+
languages:
|
7 |
+
- en
|
8 |
+
licenses:
|
9 |
+
- unknown
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 100K<n<1M
|
14 |
+
source_datasets:
|
15 |
+
- extended|drop
|
16 |
+
- extended|hotpot_qa
|
17 |
+
- extended|natural_questions
|
18 |
+
- extended|race
|
19 |
+
- extended|search_qa
|
20 |
+
- extended|squad
|
21 |
+
- extended|trivia_qa
|
22 |
+
task_categories:
|
23 |
+
- question-answering
|
24 |
+
task_ids:
|
25 |
+
- extractive-qa
|
26 |
+
---
|
27 |
+
|
28 |
+
# Dataset Card Creation Guide
|
29 |
+
|
30 |
+
## Table of Contents
|
31 |
+
- [Dataset Description](#dataset-description)
|
32 |
+
- [Dataset Summary](#dataset-summary)
|
33 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
34 |
+
- [Languages](#languages)
|
35 |
+
- [Dataset Structure](#dataset-structure)
|
36 |
+
- [Data Instances](#data-instances)
|
37 |
+
- [Data Fields](#data-instances)
|
38 |
+
- [Data Splits](#data-instances)
|
39 |
+
- [Dataset Creation](#dataset-creation)
|
40 |
+
- [Curation Rationale](#curation-rationale)
|
41 |
+
- [Source Data](#source-data)
|
42 |
+
- [Annotations](#annotations)
|
43 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
44 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
45 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
46 |
+
- [Discussion of Biases](#discussion-of-biases)
|
47 |
+
- [Other Known Limitations](#other-known-limitations)
|
48 |
+
- [Additional Information](#additional-information)
|
49 |
+
- [Dataset Curators](#dataset-curators)
|
50 |
+
- [Licensing Information](#licensing-information)
|
51 |
+
- [Citation Information](#citation-information)
|
52 |
+
|
53 |
+
## Dataset Description
|
54 |
+
|
55 |
+
- **Homepage:** [MRQA 2019 Shared Task](https://mrqa.github.io/2019/shared.html)
|
56 |
+
- **Repository:** [MRQA 2019 Github repository](https://github.com/mrqa/MRQA-Shared-Task-2019)
|
57 |
+
- **Paper:** [MRQA 2019 Shared Task: Evaluating Generalization in Reading Comprehension
|
58 |
+
](https://arxiv.org/abs/1910.09753)
|
59 |
+
- **Leaderboard:** [Shared task](https://mrqa.github.io/2019/shared.html)
|
60 |
+
- **Point of Contact:** [mrforqa@gmail.com](mrforqa@gmail.com)
|
61 |
+
|
62 |
+
### Dataset Summary
|
63 |
+
|
64 |
+
The MRQA 2019 Shared Task focuses on generalization in question answering. An effective question answering system should do more than merely interpolate from the training set to answer test examples drawn from the same distribution: it should also be able to extrapolate to out-of-distribution examples — a significantly harder challenge.
|
65 |
+
|
66 |
+
The dataset is a collection of 18 existing QA dataset (carefully selected subset of them) and converted to the same format (SQuAD format). Among these 18 datasets, six datasets were made available for training, six datasets were made available for development, and the final six for testing. The dataset is released as part of the MRQA 2019 Shared Task.
|
67 |
+
|
68 |
+
### Supported Tasks and Leaderboards
|
69 |
+
|
70 |
+
From the official repository:
|
71 |
+
|
72 |
+
*The format of the task is extractive question answering. Given a question and context passage, systems must find the word or phrase in the document that best answers the question. While this format is somewhat restrictive, it allows us to leverage many existing datasets, and its simplicity helps us focus on out-of-domain generalization, instead of other important but orthogonal challenges.*
|
73 |
+
|
74 |
+
*We have adapted several existing datasets from their original formats and settings to conform to our unified extractive setting. Most notably:*
|
75 |
+
- *We provide only a single, length-limited context.*
|
76 |
+
- *There are no unanswerable or non-span answer questions.*
|
77 |
+
- *All questions have at least one accepted answer that is found exactly in the context.*
|
78 |
+
|
79 |
+
*A span is judged to be an exact match if it matches the answer string after performing normalization consistent with the SQuAD dataset. Specifically:*
|
80 |
+
- *The text is uncased.*
|
81 |
+
- *All punctuation is stripped.*
|
82 |
+
- *All articles `{a, an, the}` are removed.*
|
83 |
+
- *All consecutive whitespace markers are compressed to just a single normal space `' '`.*
|
84 |
+
|
85 |
+
Answers are evaluated using exact match and token-level F1 metrics. One can refer to the [mrqa_official_eval.py](https://github.com/mrqa/MRQA-Shared-Task-2019/blob/master/mrqa_official_eval.py) for evaluation.
|
86 |
+
|
87 |
+
### Languages
|
88 |
+
|
89 |
+
The text in the dataset is in English. The associated BCP-47 code is `en`.
|
90 |
+
|
91 |
+
## Dataset Structure
|
92 |
+
|
93 |
+
### Data Instances
|
94 |
+
|
95 |
+
An examples looks like this:
|
96 |
+
```
|
97 |
+
{
|
98 |
+
'qid': 'f43c83e38d1e424ea00f8ad3c77ec999',
|
99 |
+
'subset': 'SQuAD'
|
100 |
+
|
101 |
+
'context': 'CBS broadcast Super Bowl 50 in the U.S., and charged an average of $5 million for a 30-second commercial during the game. The Super Bowl 50 halftime show was headlined by the British rock group Coldplay with special guest performers Beyoncé and Bruno Mars, who headlined the Super Bowl XLVII and Super Bowl XLVIII halftime shows, respectively. It was the third-most watched U.S. broadcast ever.',
|
102 |
+
'context_tokens': {
|
103 |
+
'offsets': [0, 4, 14, 20, 25, 28, 31, 35, 39, 41, 45, 53, 56, 64, 67, 68, 70, 78, 82, 84, 94, 105, 112, 116, 120, 122, 126, 132, 137, 140, 149, 154, 158, 168, 171, 175, 183, 188, 194, 203, 208, 216, 222, 233, 241, 245, 251, 255, 257, 261, 271, 275, 281, 286, 292, 296, 302, 307, 314, 323, 328, 330, 342, 344, 347, 351, 355, 360, 361, 366, 374, 379, 389, 393],
|
104 |
+
'tokens': ['CBS', 'broadcast', 'Super', 'Bowl', '50', 'in', 'the', 'U.S.', ',', 'and', 'charged', 'an', 'average', 'of', '$', '5', 'million', 'for', 'a', '30-second', 'commercial', 'during', 'the', 'game', '.', 'The', 'Super', 'Bowl', '50', 'halftime', 'show', 'was', 'headlined', 'by', 'the', 'British', 'rock', 'group', 'Coldplay', 'with', 'special', 'guest', 'performers', 'Beyoncé', 'and', 'Bruno', 'Mars', ',', 'who', 'headlined', 'the', 'Super', 'Bowl', 'XLVII', 'and', 'Super', 'Bowl', 'XLVIII', 'halftime', 'shows', ',', 'respectively', '.', 'It', 'was', 'the', 'third', '-', 'most', 'watched', 'U.S.', 'broadcast', 'ever', '.']
|
105 |
+
},
|
106 |
+
|
107 |
+
'question': "Who was the main performer at this year's halftime show?",
|
108 |
+
'question_tokens': {
|
109 |
+
'offsets': [0, 4, 8, 12, 17, 27, 30, 35, 39, 42, 51, 55],
|
110 |
+
'tokens': ['Who', 'was', 'the', 'main', 'performer', 'at', 'this', 'year', "'s", 'halftime', 'show', '?']
|
111 |
+
},
|
112 |
+
|
113 |
+
'detected_answers': {
|
114 |
+
'char_spans': [
|
115 |
+
{
|
116 |
+
'end': [201],
|
117 |
+
'start': [194]
|
118 |
+
}, {
|
119 |
+
'end': [201],
|
120 |
+
'start': [194]
|
121 |
+
}, {
|
122 |
+
'end': [201],
|
123 |
+
'start': [194]
|
124 |
+
}
|
125 |
+
],
|
126 |
+
'text': ['Coldplay', 'Coldplay', 'Coldplay'],
|
127 |
+
'token_spans': [
|
128 |
+
{
|
129 |
+
'end': [38],
|
130 |
+
'start': [38]
|
131 |
+
}, {
|
132 |
+
'end': [38],
|
133 |
+
'start': [38]
|
134 |
+
}, {
|
135 |
+
'end': [38],
|
136 |
+
'start': [38]
|
137 |
+
}
|
138 |
+
]
|
139 |
+
},
|
140 |
+
|
141 |
+
'answers': ['Coldplay', 'Coldplay', 'Coldplay'],
|
142 |
+
}
|
143 |
+
```
|
144 |
+
|
145 |
+
### Data Fields
|
146 |
+
|
147 |
+
- `subset`: which of the dataset does this examples come from?
|
148 |
+
- `context`: This is the raw text of the supporting passage. Three special token types have been inserted: `[TLE]` precedes document titles, `[DOC]` denotes document breaks, and `[PAR]` denotes paragraph breaks. The maximum length of the context is 800 tokens.
|
149 |
+
- `context_tokens`: A tokenized version of the supporting passage, using spaCy. Each token is a tuple of the token string and token character offset. The maximum number of tokens is 800.
|
150 |
+
- `tokens`: list of tokens.
|
151 |
+
- `offets`: list of offsets.
|
152 |
+
- `qas`: A list of questions for the given context.
|
153 |
+
- `qid`: A unique identifier for the question. The `qid` is unique across all datasets.
|
154 |
+
- `question`: The raw text of the question.
|
155 |
+
- `question_tokens`: A tokenized version of the question. The tokenizer and token format is the same as for the context.
|
156 |
+
- `tokens`: list of tokens.
|
157 |
+
- `offets`: list of offsets.
|
158 |
+
- `detected_answers`: A list of answer spans for the given question that index into the context. For some datasets these spans have been automatically detected using searching heuristics. The same answer may appear multiple times in the text --- each of these occurrences is recorded. For example, if `42` is the answer, the context `"The answer is 42. 42 is the answer."`, has two occurrences marked.
|
159 |
+
- `text`: The raw text of the detected answer.
|
160 |
+
- `char_spans`: Inclusive (start, end) character spans (indexing into the raw context).
|
161 |
+
- `start`: start (single element)
|
162 |
+
- `end`: end (single element)
|
163 |
+
- `token_spans`: Inclusive (start, end) token spans (indexing into the tokenized context).
|
164 |
+
- `start`: start (single element)
|
165 |
+
- `end`: end (single element)
|
166 |
+
|
167 |
+
|
168 |
+
|
169 |
+
### Data Splits
|
170 |
+
|
171 |
+
**Training data**
|
172 |
+
| Dataset | Number of Examples |
|
173 |
+
| :-----: | :------: |
|
174 |
+
| [SQuAD](https://arxiv.org/abs/1606.05250) | 86,588 |
|
175 |
+
| [NewsQA](https://arxiv.org/abs/1611.09830) | 74,160 |
|
176 |
+
| [TriviaQA](https://arxiv.org/abs/1705.03551)| 61,688 |
|
177 |
+
| [SearchQA](https://arxiv.org/abs/1704.05179)| 117,384 |
|
178 |
+
| [HotpotQA](https://arxiv.org/abs/1809.09600)| 72,928 |
|
179 |
+
| [NaturalQuestions](https://ai.google/research/pubs/pub47761)| 104,071 |
|
180 |
+
|
181 |
+
**Development data**
|
182 |
+
|
183 |
+
This in-domain data may be used for helping develop models.
|
184 |
+
|
185 |
+
| Dataset | Examples |
|
186 |
+
| :-----: | :------: |
|
187 |
+
| [SQuAD](https://arxiv.org/abs/1606.05250) | 10,507 |
|
188 |
+
| [NewsQA](https://arxiv.org/abs/1611.09830) | 4,212 |
|
189 |
+
| [TriviaQA](https://arxiv.org/abs/1705.03551)| 7,785|
|
190 |
+
| [SearchQA](https://arxiv.org/abs/1704.05179)| 16,980 |
|
191 |
+
| [HotpotQA](https://arxiv.org/abs/1809.09600)| 5,904 |
|
192 |
+
| [NaturalQuestions](https://ai.google/research/pubs/pub47761)| 12,836 |
|
193 |
+
|
194 |
+
**Test data**
|
195 |
+
|
196 |
+
The final testing data only contain out-of-domain data.
|
197 |
+
|
198 |
+
| Dataset | Examples |
|
199 |
+
| :-----: | :------: |
|
200 |
+
| [BioASQ](http://bioasq.org/) | 1,504 |
|
201 |
+
| [DROP](https://arxiv.org/abs/1903.00161) | 1,503 |
|
202 |
+
| [DuoRC](https://arxiv.org/abs/1804.07927)| 1,501 |
|
203 |
+
| [RACE](https://arxiv.org/abs/1704.04683) | 674 |
|
204 |
+
| [RelationExtraction](https://arxiv.org/abs/1706.04115) | 2,948|
|
205 |
+
| [TextbookQA](http://ai2-website.s3.amazonaws.com/publications/CVPR17_TQA.pdf)| 1,503 |
|
206 |
+
|
207 |
+
|
208 |
+
|
209 |
+
From the official repository:
|
210 |
+
|
211 |
+
***Note:** As previously mentioned, the out-of-domain dataset have been modified from their original settings to fit the unified MRQA Shared Task paradigm. At a high level, the following two major modifications have been made:*
|
212 |
+
|
213 |
+
*1. All QA-context pairs are extractive. That is, the answer is selected from the context and not via, e.g., multiple-choice.*
|
214 |
+
*2. All contexts are capped at a maximum of `800` tokens. As a result, for longer contexts like Wikipedia articles, we only consider examples where the answer appears in the first `800` tokens.*
|
215 |
+
|
216 |
+
*As a result, some splits are harder than the original datasets (e.g., removal of multiple-choice in RACE), while some are easier (e.g., restricted context length in NaturalQuestions --- we use the short answer selection). Thus one should expect different performance ranges if comparing to previous work on these datasets.*
|
217 |
+
|
218 |
+
## Dataset Creation
|
219 |
+
|
220 |
+
### Curation Rationale
|
221 |
+
|
222 |
+
From the official repository:
|
223 |
+
|
224 |
+
*Both train and test datasets have the same format described above, but may differ in some of the following ways:*
|
225 |
+
- *Passage distribution: Test examples may involve passages from different sources (e.g., science, news, novels, medical abstracts, etc) with pronounced syntactic and lexical differences.*
|
226 |
+
- *Question distribution: Test examples may emphasize different styles of questions (e.g., entity-centric, relational, other tasks reformulated as QA, etc) which may come from different sources (e.g., crowdworkers, domain experts, exam writers, etc.)*
|
227 |
+
- *Joint distribution: Test examples may vary according to the relationship of the question to the passage (e.g., collected independent vs. dependent of evidence, multi-hop, etc)*
|
228 |
+
|
229 |
+
### Source Data
|
230 |
+
|
231 |
+
[More Information Needed]
|
232 |
+
|
233 |
+
#### Initial Data Collection and Normalization
|
234 |
+
|
235 |
+
[More Information Needed]
|
236 |
+
|
237 |
+
#### Who are the source language producers?
|
238 |
+
|
239 |
+
[More Information Needed]
|
240 |
+
|
241 |
+
### Annotations
|
242 |
+
|
243 |
+
[More Information Needed]
|
244 |
+
|
245 |
+
#### Annotation process
|
246 |
+
|
247 |
+
[More Information Needed]
|
248 |
+
|
249 |
+
#### Who are the annotators?
|
250 |
+
|
251 |
+
[More Information Needed]
|
252 |
+
|
253 |
+
### Personal and Sensitive Information
|
254 |
+
|
255 |
+
[More Information Needed]
|
256 |
+
|
257 |
+
## Considerations for Using the Data
|
258 |
+
|
259 |
+
### Social Impact of Dataset
|
260 |
+
|
261 |
+
[More Information Needed]
|
262 |
+
|
263 |
+
### Discussion of Biases
|
264 |
+
|
265 |
+
[More Information Needed]
|
266 |
+
|
267 |
+
### Other Known Limitations
|
268 |
+
|
269 |
+
[More Information Needed]
|
270 |
+
|
271 |
+
## Additional Information
|
272 |
+
|
273 |
+
### Dataset Curators
|
274 |
+
|
275 |
+
[More Information Needed]
|
276 |
+
|
277 |
+
### Licensing Information
|
278 |
+
|
279 |
+
Unknown
|
280 |
+
|
281 |
+
### Citation Information
|
282 |
+
|
283 |
+
```
|
284 |
+
@inproceedings{fisch2019mrqa,
|
285 |
+
title={{MRQA} 2019 Shared Task: Evaluating Generalization in Reading Comprehension},
|
286 |
+
author={Adam Fisch and Alon Talmor and Robin Jia and Minjoon Seo and Eunsol Choi and Danqi Chen},
|
287 |
+
booktitle={Proceedings of 2nd Machine Reading for Reading Comprehension (MRQA) Workshop at EMNLP},
|
288 |
+
year={2019},
|
289 |
+
}
|
290 |
+
```
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"plain_text": {"description": "The MRQA 2019 Shared Task focuses on generalization in question answering.\nAn effective question answering system should do more than merely\ninterpolate from the training set to answer test examples drawn\nfrom the same distribution: it should also be able to extrapolate\nto out-of-distribution examples \u2014 a significantly harder challenge.\n\nThe dataset is a collection of 18 existing QA dataset (carefully selected\nsubset of them) and converted to the same format (SQuAD format). Among\nthese 18 datasets, six datasets were made available for training,\nsix datasets were made available for development, and the final six\nfor testing. The dataset is released as part of the MRQA 2019 Shared Task.\n", "citation": "@inproceedings{fisch2019mrqa,\n title={{MRQA} 2019 Shared Task: Evaluating Generalization in Reading Comprehension},\n author={Adam Fisch and Alon Talmor and Robin Jia and Minjoon Seo and Eunsol Choi and Danqi Chen},\n booktitle={Proceedings of 2nd Machine Reading for Reading Comprehension (MRQA) Workshop at EMNLP},\n year={2019},\n}\n", "homepage": "https://mrqa.github.io/2019/shared.html", "license": "Unknwon", "features": {"subset": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "context_tokens": {"feature": {"tokens": {"dtype": "string", "id": null, "_type": "Value"}, "offsets": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "qid": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "question_tokens": {"feature": {"tokens": {"dtype": "string", "id": null, "_type": "Value"}, "offsets": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "detected_answers": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "char_spans": {"feature": {"start": {"dtype": "int32", "id": null, "_type": "Value"}, "end": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "token_spans": {"feature": {"start": {"dtype": "int32", "id": null, "_type": "Value"}, "end": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "length": -1, "id": null, "_type": "Sequence"}, "answers": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "mrqa", "config_name": "plain_text", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 4090681873, "num_examples": 516819, "dataset_name": "mrqa"}, "test": {"name": "test", "num_bytes": 57712177, "num_examples": 9633, "dataset_name": "mrqa"}, "validation": {"name": "validation", "num_bytes": 484107026, "num_examples": 58221, "dataset_name": "mrqa"}}, "download_checksums": {"https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/SQuAD.jsonl.gz": {"num_bytes": 27621835, "checksum": "b094703b9c6f740cc2dfd70b3201b833553fcec0c8a522f22c2c6ff82ce2cc78"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/NewsQA.jsonl.gz": {"num_bytes": 56451248, "checksum": "f1ccbf2d259ce1094aacde21a53592894248e5778814205dac94f0b086dbe968"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/TriviaQA-web.jsonl.gz": {"num_bytes": 356784923, "checksum": "61fad6884370408282ad3ed0b5f25a9e932d9a724b6929ea03ea5344ff0cd3f7"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/SearchQA.jsonl.gz": {"num_bytes": 641332495, "checksum": "32cda932667b7b65ab3079a8271d4e5726b4b989d0b862b25c77eb03a661b609"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/HotpotQA.jsonl.gz": {"num_bytes": 107394872, "checksum": "3a94712c073dc9f29d88ac149faa01ef9c7c089f97ee25d9cbac39387550825d"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/NaturalQuestionsShort.jsonl.gz": {"num_bytes": 116612493, "checksum": "6cdac324664b94b60be3203a077bf361d0bfa68a17af9b71def1186a6958a68c"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/SQuAD.jsonl.gz": {"num_bytes": 3474262, "checksum": "5afa4b088adf297fc29374ddf2d44d974b8837380e2554e62edf258fee5c32ee"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/NewsQA.jsonl.gz": {"num_bytes": 3142984, "checksum": "66bfb10cab2029bbc7d1afaece20c35fac341b1c179d15b70fde22a207f096ae"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/TriviaQA-web.jsonl.gz": {"num_bytes": 44971198, "checksum": "faf8add436de5a5fa81071a4e7190850d7e9a20acc811439e8a127ba8ec25640"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/SearchQA.jsonl.gz": {"num_bytes": 92526612, "checksum": "c84d2cc02cac5aa9d576ce1cd22900e9d75fe8a37bc795901c36cae6ef9e5ff0"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/HotpotQA.jsonl.gz": {"num_bytes": 10029807, "checksum": "43bb9291525d8b59229ba327b67cca42f0a9c23798c455f6fbe813e9979cca84"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/NaturalQuestionsShort.jsonl.gz": {"num_bytes": 10424248, "checksum": "2ba8b2181b520f81b49d62c0e4a23819f33d5dec0e8cf4a623edcda0feb73530"}, "http://participants-area.bioasq.org/MRQA2019/": {"num_bytes": 2666134, "checksum": "d8f237baea33bd0f4a664ef37ccd893cc682fd9458383dc1d1b8eb4685bb9efc"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/DROP.jsonl.gz": {"num_bytes": 592127, "checksum": "3f7b6b8131cd523d4451e98cf24adc53a92519763597261d28ae83f3920849ab"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/DuoRC.ParaphraseRC.jsonl.gz": {"num_bytes": 1197881, "checksum": "aeb8b9a31044be2ba3d62a456d61b2d447ff76dabe6fa77260b6efed0fb4c010"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/RACE.jsonl.gz": {"num_bytes": 1563018, "checksum": "c620ca043c78504ea02d1cef494207c6c76a5e5dedd7976f5fed5eb9724864b8"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/RelationExtraction.jsonl.gz": {"num_bytes": 850817, "checksum": "845668398356208246605fa1f363de63b45848c946d56514edcc8d00d12530ea"}, "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/TextbookQA.jsonl.gz": {"num_bytes": 1881401, "checksum": "1e861f197e739ead1947c60fa0917a02205dd48a559502194d7085ccd8608b64"}}, "download_size": 1479518355, "post_processing_size": null, "dataset_size": 4632501076, "size_in_bytes": 6112019431}}
|
dummy/plain_text/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ee07877bacc02179ba7ff5d6fb58293ce1e46c4e1ef786401c4f535937228c2c
|
3 |
+
size 40463
|
mrqa.py
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
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 |
+
"""MRQA 2019 Shared task dataset."""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import json
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_CITATION = """\
|
25 |
+
@inproceedings{fisch2019mrqa,
|
26 |
+
title={{MRQA} 2019 Shared Task: Evaluating Generalization in Reading Comprehension},
|
27 |
+
author={Adam Fisch and Alon Talmor and Robin Jia and Minjoon Seo and Eunsol Choi and Danqi Chen},
|
28 |
+
booktitle={Proceedings of 2nd Machine Reading for Reading Comprehension (MRQA) Workshop at EMNLP},
|
29 |
+
year={2019},
|
30 |
+
}
|
31 |
+
"""
|
32 |
+
|
33 |
+
_DESCRIPTION = """\
|
34 |
+
The MRQA 2019 Shared Task focuses on generalization in question answering.
|
35 |
+
An effective question answering system should do more than merely
|
36 |
+
interpolate from the training set to answer test examples drawn
|
37 |
+
from the same distribution: it should also be able to extrapolate
|
38 |
+
to out-of-distribution examples — a significantly harder challenge.
|
39 |
+
|
40 |
+
The dataset is a collection of 18 existing QA dataset (carefully selected
|
41 |
+
subset of them) and converted to the same format (SQuAD format). Among
|
42 |
+
these 18 datasets, six datasets were made available for training,
|
43 |
+
six datasets were made available for development, and the final six
|
44 |
+
for testing. The dataset is released as part of the MRQA 2019 Shared Task.
|
45 |
+
"""
|
46 |
+
|
47 |
+
_HOMEPAGE = "https://mrqa.github.io/2019/shared.html"
|
48 |
+
|
49 |
+
_LICENSE = "Unknwon"
|
50 |
+
|
51 |
+
_URLs = {
|
52 |
+
# Train sub-datasets
|
53 |
+
"train+SQuAD": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/SQuAD.jsonl.gz",
|
54 |
+
"train+NewsQA": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/NewsQA.jsonl.gz",
|
55 |
+
"train+TriviaQA": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/TriviaQA-web.jsonl.gz",
|
56 |
+
"train+SearchQA": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/SearchQA.jsonl.gz",
|
57 |
+
"train+HotpotQA": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/HotpotQA.jsonl.gz",
|
58 |
+
"train+NaturalQuestions": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/train/NaturalQuestionsShort.jsonl.gz",
|
59 |
+
# Validation sub-datasets
|
60 |
+
"validation+SQuAD": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/SQuAD.jsonl.gz",
|
61 |
+
"validation+NewsQA": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/NewsQA.jsonl.gz",
|
62 |
+
"validation+TriviaQA": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/TriviaQA-web.jsonl.gz",
|
63 |
+
"validation+SearchQA": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/SearchQA.jsonl.gz",
|
64 |
+
"validation+HotpotQA": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/HotpotQA.jsonl.gz",
|
65 |
+
"validation+NaturalQuestions": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/NaturalQuestionsShort.jsonl.gz",
|
66 |
+
# Test sub-datasets
|
67 |
+
"test+BioASQ": "http://participants-area.bioasq.org/MRQA2019/", # BioASQ.jsonl.gz
|
68 |
+
"test+DROP": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/DROP.jsonl.gz",
|
69 |
+
"test+DuoRC": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/DuoRC.ParaphraseRC.jsonl.gz",
|
70 |
+
"test+RACE": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/RACE.jsonl.gz",
|
71 |
+
"test+RelationExtraction": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/RelationExtraction.jsonl.gz",
|
72 |
+
"test+TextbookQA": "https://s3.us-east-2.amazonaws.com/mrqa/release/v2/dev/TextbookQA.jsonl.gz",
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
class Mrqa(datasets.GeneratorBasedBuilder):
|
77 |
+
"""MRQA 2019 Shared task dataset."""
|
78 |
+
|
79 |
+
VERSION = datasets.Version("1.1.0")
|
80 |
+
|
81 |
+
BUILDER_CONFIGS = [
|
82 |
+
datasets.BuilderConfig(name="plain_text", description="Plain text", version=VERSION),
|
83 |
+
]
|
84 |
+
|
85 |
+
def _info(self):
|
86 |
+
return datasets.DatasetInfo(
|
87 |
+
description=_DESCRIPTION,
|
88 |
+
# Format is derived from https://github.com/mrqa/MRQA-Shared-Task-2019#mrqa-format
|
89 |
+
features=datasets.Features(
|
90 |
+
{
|
91 |
+
"subset": datasets.Value("string"),
|
92 |
+
"context": datasets.Value("string"),
|
93 |
+
"context_tokens": datasets.Sequence(
|
94 |
+
{
|
95 |
+
"tokens": datasets.Value("string"),
|
96 |
+
"offsets": datasets.Value("int32"),
|
97 |
+
}
|
98 |
+
),
|
99 |
+
"qid": datasets.Value("string"),
|
100 |
+
"question": datasets.Value("string"),
|
101 |
+
"question_tokens": datasets.Sequence(
|
102 |
+
{
|
103 |
+
"tokens": datasets.Value("string"),
|
104 |
+
"offsets": datasets.Value("int32"),
|
105 |
+
}
|
106 |
+
),
|
107 |
+
"detected_answers": datasets.Sequence(
|
108 |
+
{
|
109 |
+
"text": datasets.Value("string"),
|
110 |
+
"char_spans": datasets.Sequence(
|
111 |
+
{
|
112 |
+
"start": datasets.Value("int32"),
|
113 |
+
"end": datasets.Value("int32"),
|
114 |
+
}
|
115 |
+
),
|
116 |
+
"token_spans": datasets.Sequence(
|
117 |
+
{
|
118 |
+
"start": datasets.Value("int32"),
|
119 |
+
"end": datasets.Value("int32"),
|
120 |
+
}
|
121 |
+
),
|
122 |
+
}
|
123 |
+
),
|
124 |
+
"answers": datasets.Sequence(datasets.Value("string")),
|
125 |
+
}
|
126 |
+
),
|
127 |
+
supervised_keys=None,
|
128 |
+
homepage=_HOMEPAGE,
|
129 |
+
license=_LICENSE,
|
130 |
+
citation=_CITATION,
|
131 |
+
)
|
132 |
+
|
133 |
+
def _split_generators(self, dl_manager):
|
134 |
+
"""Returns SplitGenerators."""
|
135 |
+
data_dir = dl_manager.download_and_extract(_URLs)
|
136 |
+
|
137 |
+
return [
|
138 |
+
datasets.SplitGenerator(
|
139 |
+
name=datasets.Split.TRAIN,
|
140 |
+
gen_kwargs={
|
141 |
+
"filepaths_dict": data_dir,
|
142 |
+
"split": "train",
|
143 |
+
},
|
144 |
+
),
|
145 |
+
datasets.SplitGenerator(
|
146 |
+
name=datasets.Split.TEST,
|
147 |
+
gen_kwargs={
|
148 |
+
"filepaths_dict": data_dir,
|
149 |
+
"split": "test",
|
150 |
+
},
|
151 |
+
),
|
152 |
+
datasets.SplitGenerator(
|
153 |
+
name=datasets.Split.VALIDATION,
|
154 |
+
gen_kwargs={
|
155 |
+
"filepaths_dict": data_dir,
|
156 |
+
"split": "validation",
|
157 |
+
},
|
158 |
+
),
|
159 |
+
]
|
160 |
+
|
161 |
+
def _generate_examples(self, filepaths_dict, split):
|
162 |
+
"""Yields examples."""
|
163 |
+
for source, filepath in filepaths_dict.items():
|
164 |
+
if split not in source:
|
165 |
+
continue
|
166 |
+
with open(filepath, encoding="utf-8") as f:
|
167 |
+
header = next(f)
|
168 |
+
subset = json.loads(header)["header"]["dataset"]
|
169 |
+
|
170 |
+
for row in f:
|
171 |
+
paragraph = json.loads(row)
|
172 |
+
context = paragraph["context"].strip()
|
173 |
+
context_tokens = [{"tokens": t[0], "offsets": t[1]} for t in paragraph["context_tokens"]]
|
174 |
+
for qa in paragraph["qas"]:
|
175 |
+
qid = qa["qid"]
|
176 |
+
question = qa["question"].strip()
|
177 |
+
question_tokens = [{"tokens": t[0], "offsets": t[1]} for t in qa["question_tokens"]]
|
178 |
+
detected_answers = []
|
179 |
+
for detect_ans in qa["detected_answers"]:
|
180 |
+
detected_answers.append(
|
181 |
+
{
|
182 |
+
"text": detect_ans["text"].strip(),
|
183 |
+
"char_spans": [{"start": t[0], "end": t[1]} for t in detect_ans["char_spans"]],
|
184 |
+
"token_spans": [{"start": t[0], "end": t[1]} for t in detect_ans["token_spans"]],
|
185 |
+
}
|
186 |
+
)
|
187 |
+
answers = qa["answers"]
|
188 |
+
yield qid, {
|
189 |
+
"subset": subset,
|
190 |
+
"context": context,
|
191 |
+
"context_tokens": context_tokens,
|
192 |
+
"qid": qid,
|
193 |
+
"question": question,
|
194 |
+
"question_tokens": question_tokens,
|
195 |
+
"detected_answers": detected_answers,
|
196 |
+
"answers": answers,
|
197 |
+
}
|