Datasets:

ArXiv:
License:
system HF staff commited on
Commit
bc0ee5c
0 Parent(s):

Update files from the datasets library (from 1.2.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.2.0

Files changed (5) hide show
  1. .gitattributes +27 -0
  2. README.md +246 -0
  3. dataset_infos.json +1 -0
  4. dummy/mkqa/1.0.0/dummy_data.zip +3 -0
  5. mkqa.py +150 -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,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - ar
8
+ - da
9
+ - de
10
+ - en
11
+ - es
12
+ - fi
13
+ - fr
14
+ - he
15
+ - hu
16
+ - it
17
+ - ja
18
+ - ko
19
+ - km
20
+ - ms
21
+ - nl
22
+ - no
23
+ - pl
24
+ - pt
25
+ - ru
26
+ - sv
27
+ - th
28
+ - tr
29
+ - vi
30
+ - zh
31
+ licenses:
32
+ - cc-by-3-0
33
+ multilinguality:
34
+ - multilingual
35
+ - translation
36
+ size_categories:
37
+ - 1K<n<10K
38
+ source_datasets:
39
+ - extended|natural_questions
40
+ - original
41
+ task_categories:
42
+ - question-answering
43
+ task_ids:
44
+ - open-domain-qa
45
+ ---
46
+
47
+ # Dataset Card for MKQA: Multilingual Knowledge Questions & Answers
48
+
49
+ ## Table of Contents
50
+ - [Dataset Description](#dataset-description)
51
+ - [Dataset Summary](#dataset-summary)
52
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
53
+ - [Languages](#languages)
54
+ - [Dataset Structure](#dataset-structure)
55
+ - [Data Instances](#data-instances)
56
+ - [Data Fields](#data-instances)
57
+ - [Data Splits](#data-instances)
58
+ - [Dataset Creation](#dataset-creation)
59
+ - [Curation Rationale](#curation-rationale)
60
+ - [Source Data](#source-data)
61
+ - [Annotations](#annotations)
62
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
63
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
64
+ - [Social Impact of Dataset](#social-impact-of-dataset)
65
+ - [Discussion of Biases](#discussion-of-biases)
66
+ - [Other Known Limitations](#other-known-limitations)
67
+ - [Additional Information](#additional-information)
68
+ - [Dataset Curators](#dataset-curators)
69
+ - [Licensing Information](#licensing-information)
70
+ - [Citation Information](#citation-information)
71
+
72
+ ## Dataset Description
73
+
74
+ - [**Homepage:**](https://github.com/apple/ml-mkqa/)
75
+ - [**Paper:**](https://arxiv.org/abs/2007.15207)
76
+
77
+ ### Dataset Summary
78
+
79
+ MKQA contains 10,000 queries sampled from the [Google Natural Questions dataset](https://github.com/google-research-datasets/natural-questions).
80
+
81
+ For each query we collect new passage-independent answers.
82
+ These queries and answers are then human translated into 25 Non-English languages.
83
+
84
+ ### Supported Tasks and Leaderboards
85
+
86
+ `question-answering`
87
+
88
+ ### Languages
89
+
90
+ | Language code | Language name |
91
+ |---------------|---------------|
92
+ | `ar` | `Arabic` |
93
+ | `da` | `Danish` |
94
+ | `de` | `German` |
95
+ | `en` | `English` |
96
+ | `es` | `Spanish` |
97
+ | `fi` | `Finnish` |
98
+ | `fr` | `French` |
99
+ | `he` | `Hebrew` |
100
+ | `hu` | `Hungarian` |
101
+ | `it` | `Italian` |
102
+ | `ja` | `Japanese` |
103
+ | `ko` | `Korean` |
104
+ | `km` | `Khmer` |
105
+ | `ms` | `Malay` |
106
+ | `nl` | `Dutch` |
107
+ | `no` | `Norwegian` |
108
+ | `pl` | `Polish` |
109
+ | `pt` | `Portuguese` |
110
+ | `ru` | `Russian` |
111
+ | `sv` | `Swedish` |
112
+ | `th` | `Thai` |
113
+ | `tr` | `Turkish` |
114
+ | `vi` | `Vietnamese` |
115
+ | `zh_cn` | `Chinese (Simplified)` |
116
+ | `zh_hk` | `Chinese (Hong kong)` |
117
+ | `zh_tw` | `Chinese (Traditional)` |
118
+
119
+ ## Dataset Structure
120
+
121
+ ### Data Instances
122
+
123
+ An example from the data set looks as follows:
124
+
125
+ ```
126
+ {
127
+ 'example_id': 563260143484355911,
128
+ 'queries': {
129
+ 'en': "who sings i hear you knocking but you can't come in",
130
+ 'ru': "кто поет i hear you knocking but you can't come in",
131
+ 'ja': '「 I hear you knocking」は誰が歌っていますか',
132
+ 'zh_cn': "《i hear you knocking but you can't come in》是谁演唱的",
133
+ ...
134
+ },
135
+ 'query': "who sings i hear you knocking but you can't come in",
136
+ 'answers': {'en': [{'type': 'entity',
137
+ 'entity': 'Q545186',
138
+ 'text': 'Dave Edmunds',
139
+ 'aliases': []}],
140
+ 'ru': [{'type': 'entity',
141
+ 'entity': 'Q545186',
142
+ 'text': 'Эдмундс, Дэйв',
143
+ 'aliases': ['Эдмундс', 'Дэйв Эдмундс', 'Эдмундс Дэйв', 'Dave Edmunds']}],
144
+ 'ja': [{'type': 'entity',
145
+ 'entity': 'Q545186',
146
+ 'text': 'デイヴ・エドモンズ',
147
+ 'aliases': ['デーブ・エドモンズ', 'デイブ・エドモンズ']}],
148
+ 'zh_cn': [{'type': 'entity', 'text': '戴维·埃德蒙兹 ', 'entity': 'Q545186'}],
149
+ ...
150
+ },
151
+ }
152
+
153
+ ```
154
+
155
+ ### Data Fields
156
+
157
+ Each example in the dataset contains the unique Natural Questions `example_id`, the original English `query`, and then `queries` and `answers` in 26 languages.
158
+ Each answer is labelled with an answer type. The breakdown is:
159
+
160
+ | Answer Type | Occurrence |
161
+ |---------------|---------------|
162
+ | `entity` | `4221` |
163
+ | `long_answer` | `1815` |
164
+ | `unanswerable` | `1427` |
165
+ | `date` | `1174` |
166
+ | `number` | `485` |
167
+ | `number_with_unit` | `394` |
168
+ | `short_phrase` | `346` |
169
+ | `binary` | `138` |
170
+
171
+ For each language, there can be more than one acceptable textual answer, in order to capture a variety of possible valid answers.
172
+
173
+ Detailed explanation of fields taken from [here](https://github.com/apple/ml-mkqa/#dataset)
174
+
175
+ when `entity` field is not available it is set to an empty string ''.
176
+ when `aliases` field is not available it is set to an empty list [].
177
+
178
+ ### Data Splits
179
+
180
+ - Train: 10000
181
+
182
+ ## Dataset Creation
183
+
184
+ ### Curation Rationale
185
+
186
+ [More Information Needed]
187
+
188
+ ### Source Data
189
+
190
+ [Google Natural Questions dataset](https://github.com/google-research-datasets/natural-questions)
191
+
192
+ #### Initial Data Collection and Normalization
193
+
194
+ [More Information Needed]
195
+
196
+ #### Who are the source language producers?
197
+
198
+ [More Information Needed]
199
+
200
+ ### Annotations
201
+
202
+ #### Annotation process
203
+
204
+ [More Information Needed]
205
+
206
+ #### Who are the annotators?
207
+
208
+ [More Information Needed]
209
+
210
+ ### Personal and Sensitive Information
211
+
212
+ [More Information Needed]
213
+
214
+ ## Considerations for Using the Data
215
+
216
+ ### Social Impact of Dataset
217
+
218
+ [More Information Needed]
219
+
220
+ ### Discussion of Biases
221
+
222
+ [More Information Needed]
223
+
224
+ ### Other Known Limitations
225
+
226
+ [More Information Needed]
227
+
228
+ ## Additional Information
229
+
230
+ ### Dataset Curators
231
+
232
+ [More Information Needed]
233
+
234
+ ### Licensing Information
235
+
236
+ [CC BY-SA 3.0](https://github.com/apple/ml-mkqa#license)
237
+
238
+ ### Citation Information
239
+ ```
240
+ @misc{mkqa,
241
+ title = {MKQA: A Linguistically Diverse Benchmark for Multilingual Open Domain Question Answering},
242
+ author = {Shayne Longpre and Yi Lu and Joachim Daiber},
243
+ year = {2020},
244
+ URL = {https://arxiv.org/pdf/2007.15207.pdf}
245
+ }
246
+ ```
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"mkqa": {"description": "We introduce MKQA, an open-domain question answering evaluation set comprising 10k question-answer pairs aligned across 26 typologically diverse languages (260k question-answer pairs in total). The goal of this dataset is to provide a challenging benchmark for question answering quality across a wide set of languages.\n", "citation": "@misc{mkqa,\n title = {MKQA: A Linguistically Diverse Benchmark for Multilingual Open Domain Question Answering},\n author = {Shayne Longpre and Yi Lu and Joachim Daiber},\n year = {2020},\n URL = {https://arxiv.org/pdf/2007.15207.pdf}\n}\n", "homepage": "https://github.com/apple/ml-mkqa", "license": "CC BY-SA 3.0", "features": {"example_id": {"dtype": "string", "id": null, "_type": "Value"}, "queries": {"ar": {"dtype": "string", "id": null, "_type": "Value"}, "da": {"dtype": "string", "id": null, "_type": "Value"}, "de": {"dtype": "string", "id": null, "_type": "Value"}, "en": {"dtype": "string", "id": null, "_type": "Value"}, "es": {"dtype": "string", "id": null, "_type": "Value"}, "fi": {"dtype": "string", "id": null, "_type": "Value"}, "fr": {"dtype": "string", "id": null, "_type": "Value"}, "he": {"dtype": "string", "id": null, "_type": "Value"}, "hu": {"dtype": "string", "id": null, "_type": "Value"}, "it": {"dtype": "string", "id": null, "_type": "Value"}, "ja": {"dtype": "string", "id": null, "_type": "Value"}, "ko": {"dtype": "string", "id": null, "_type": "Value"}, "km": {"dtype": "string", "id": null, "_type": "Value"}, "ms": {"dtype": "string", "id": null, "_type": "Value"}, "nl": {"dtype": "string", "id": null, "_type": "Value"}, "no": {"dtype": "string", "id": null, "_type": "Value"}, "pl": {"dtype": "string", "id": null, "_type": "Value"}, "pt": {"dtype": "string", "id": null, "_type": "Value"}, "ru": {"dtype": "string", "id": null, "_type": "Value"}, "sv": {"dtype": "string", "id": null, "_type": "Value"}, "th": {"dtype": "string", "id": null, "_type": "Value"}, "tr": {"dtype": "string", "id": null, "_type": "Value"}, "vi": {"dtype": "string", "id": null, "_type": "Value"}, "zh_cn": {"dtype": "string", "id": null, "_type": "Value"}, "zh_hk": {"dtype": "string", "id": null, "_type": "Value"}, "zh_tw": {"dtype": "string", "id": null, "_type": "Value"}}, "query": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"ar": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "da": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "de": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "en": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "es": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "fi": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "fr": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "he": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "hu": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "it": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "ja": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "ko": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "km": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "ms": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "nl": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "no": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "pl": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "pt": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "ru": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "sv": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "th": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "tr": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "vi": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "zh_cn": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "zh_hk": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}], "zh_tw": [{"type": {"num_classes": 8, "names": ["entity", "long_answer", "unanswerable", "date", "number", "number_with_unit", "short_phrase", "binary"], "names_file": null, "id": null, "_type": "ClassLabel"}, "entity": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "aliases": [{"dtype": "string", "id": null, "_type": "Value"}]}]}}, "post_processed": null, "supervised_keys": null, "builder_name": "mkqa", "config_name": "mkqa", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 35958422, "num_examples": 10000, "dataset_name": "mkqa"}}, "download_checksums": {"https://github.com/apple/ml-mkqa/raw/master/dataset/mkqa.jsonl.gz": {"num_bytes": 11903948, "checksum": "f77ac6bf6306e98816c5c047880db71a3c67d2f1491b169896d63e9bb14ef3d3"}}, "download_size": 11903948, "post_processing_size": null, "dataset_size": 35958422, "size_in_bytes": 47862370}}
dummy/mkqa/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19ee501097ba297de6004aef3e529b3d53930a1f74eac78008847b3f4b627be2
3
+ size 5752
mkqa.py ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
16
+ """MKQA: Multilingual Knowledge Questions & Answers"""
17
+
18
+ from __future__ import absolute_import, division, print_function
19
+
20
+ import json
21
+
22
+ import datasets
23
+
24
+
25
+ _CITATION = """\
26
+ @misc{mkqa,
27
+ title = {MKQA: A Linguistically Diverse Benchmark for Multilingual Open Domain Question Answering},
28
+ author = {Shayne Longpre and Yi Lu and Joachim Daiber},
29
+ year = {2020},
30
+ URL = {https://arxiv.org/pdf/2007.15207.pdf}
31
+ }
32
+ """
33
+
34
+ _DESCRIPTION = """\
35
+ We introduce MKQA, an open-domain question answering evaluation set comprising 10k question-answer pairs sampled from the Google Natural Questions dataset, aligned across 26 typologically diverse languages (260k question-answer pairs in total). For each query we collected new passage-independent answers. These queries and answers were then human translated into 25 Non-English languages.
36
+ """
37
+ _HOMEPAGE = "https://github.com/apple/ml-mkqa"
38
+ _LICENSE = "CC BY-SA 3.0"
39
+
40
+
41
+ _URLS = {"train": "https://github.com/apple/ml-mkqa/raw/master/dataset/mkqa.jsonl.gz"}
42
+
43
+
44
+ class Mkqa(datasets.GeneratorBasedBuilder):
45
+ """MKQA dataset"""
46
+
47
+ VERSION = datasets.Version("1.0.0")
48
+ BUILDER_CONFIGS = [
49
+ datasets.BuilderConfig(
50
+ name="mkqa",
51
+ version=VERSION,
52
+ description=_DESCRIPTION,
53
+ ),
54
+ ]
55
+
56
+ def _info(self):
57
+ langs = [
58
+ "ar",
59
+ "da",
60
+ "de",
61
+ "en",
62
+ "es",
63
+ "fi",
64
+ "fr",
65
+ "he",
66
+ "hu",
67
+ "it",
68
+ "ja",
69
+ "ko",
70
+ "km",
71
+ "ms",
72
+ "nl",
73
+ "no",
74
+ "pl",
75
+ "pt",
76
+ "ru",
77
+ "sv",
78
+ "th",
79
+ "tr",
80
+ "vi",
81
+ "zh_cn",
82
+ "zh_hk",
83
+ "zh_tw",
84
+ ]
85
+
86
+ # Preferring list type instead of datasets.Sequence
87
+ queries_features = {lan: datasets.Value("string") for lan in langs}
88
+ answer_feature = [
89
+ {
90
+ "type": datasets.ClassLabel(
91
+ names=[
92
+ "entity",
93
+ "long_answer",
94
+ "unanswerable",
95
+ "date",
96
+ "number",
97
+ "number_with_unit",
98
+ "short_phrase",
99
+ "binary",
100
+ ]
101
+ ),
102
+ "entity": datasets.Value("string"),
103
+ "text": datasets.Value("string"),
104
+ "aliases": [datasets.Value("string")],
105
+ }
106
+ ]
107
+ answer_features = {lan: answer_feature for lan in langs}
108
+
109
+ features = datasets.Features(
110
+ {
111
+ "example_id": datasets.Value("string"),
112
+ "queries": queries_features,
113
+ "query": datasets.Value("string"),
114
+ "answers": answer_features,
115
+ }
116
+ )
117
+
118
+ return datasets.DatasetInfo(
119
+ description=_DESCRIPTION,
120
+ features=features,
121
+ supervised_keys=None,
122
+ homepage=_HOMEPAGE,
123
+ license=_LICENSE,
124
+ citation=_CITATION,
125
+ )
126
+
127
+ def _split_generators(self, dl_manager):
128
+ """Returns SplitGenerators."""
129
+ # download and extract URLs
130
+ urls_to_download = _URLS
131
+ downloaded_files = dl_manager.download_and_extract(urls_to_download)
132
+
133
+ return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]})]
134
+
135
+ def _generate_examples(self, filepath):
136
+ """Yields examples."""
137
+ with open(filepath, encoding="utf-8") as f:
138
+ for row in f:
139
+ data = json.loads(row)
140
+ data["example_id"] = str(data["example_id"])
141
+ id_ = data["example_id"]
142
+ for language in data["answers"].keys():
143
+ # Add default values for possible missing keys
144
+ for a in data["answers"][language]:
145
+ if "aliases" not in a:
146
+ a["aliases"] = []
147
+ if "entity" not in a:
148
+ a["entity"] = ""
149
+
150
+ yield id_, data