system HF staff commited on
Commit
63ae569
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

.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,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - expert-generated
4
+ language_creators:
5
+ - other
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
+ - 'extended|natural_questions'
16
+ task_categories:
17
+ - question-answering
18
+ task_ids:
19
+ - open-domain-qa
20
+ ---
21
+
22
+ # Dataset Card for nq_open
23
+
24
+ ## Table of Contents
25
+ - [Dataset Card for nq_open](#dataset-card-for-nq_open)
26
+ - [Table of Contents](#table-of-contents)
27
+ - [Dataset Description](#dataset-description)
28
+ - [Dataset Summary](#dataset-summary)
29
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
30
+ - [Languages](#languages)
31
+ - [Dataset Structure](#dataset-structure)
32
+ - [Data Instances](#data-instances)
33
+ - [Data Fields](#data-fields)
34
+ - [Data Splits](#data-splits)
35
+ - [Dataset Creation](#dataset-creation)
36
+ - [Curation Rationale](#curation-rationale)
37
+ - [Source Data](#source-data)
38
+ - [Initial Data Collection and Normalization](#initial-data-collection-and-normalization)
39
+ - [Who are the source language producers?](#who-are-the-source-language-producers)
40
+ - [Annotations](#annotations)
41
+ - [Annotation process](#annotation-process)
42
+ - [Who are the annotators?](#who-are-the-annotators)
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:** https://efficientqa.github.io/
56
+ - **Repository:** https://github.com/google-research-datasets/natural-questions/tree/master/nq_open
57
+ - **Paper:** https://www.aclweb.org/anthology/P19-1612.pdf
58
+ - **Leaderboard:** https://ai.google.com/research/NaturalQuestions/efficientqa
59
+ - **Point of Contact:** efficientqa@googlegroups.com
60
+
61
+ ### Dataset Summary
62
+
63
+ The NQ-Open task, introduced by Lee et.al. 2019,
64
+ is an open domain question answering benchmark that is derived from Natural Questions.
65
+ The goal is to predict an English answer string for an input English question.
66
+ All questions can be answered using the contents of English Wikipedia.
67
+
68
+ ### Supported Tasks and Leaderboards
69
+
70
+ Open Domain Question-Answering,
71
+ EfficientQA Leaderboard: https://ai.google.com/research/NaturalQuestions/efficientqa
72
+
73
+ ### Languages
74
+
75
+ English (`en`)
76
+
77
+ ## Dataset Structure
78
+
79
+ ### Data Instances
80
+
81
+ ```
82
+ {
83
+ "question": "names of the metropolitan municipalities in south africa",
84
+ "answer": [
85
+ "Mangaung Metropolitan Municipality",
86
+ "Nelson Mandela Bay Metropolitan Municipality",
87
+ "eThekwini Metropolitan Municipality",
88
+ "City of Tshwane Metropolitan Municipality",
89
+ "City of Johannesburg Metropolitan Municipality",
90
+ "Buffalo City Metropolitan Municipality",
91
+ "City of Ekurhuleni Metropolitan Municipality"
92
+ ]
93
+ }
94
+ ```
95
+
96
+ ### Data Fields
97
+
98
+ - `question` - Input open domain question.
99
+ - `answer` - List of possible answers to the question
100
+
101
+ ### Data Splits
102
+
103
+ - Train : 87925
104
+ - validation : 1800
105
+
106
+ ## Dataset Creation
107
+
108
+ ### Curation Rationale
109
+
110
+ [Needs More Information]
111
+
112
+ ### Source Data
113
+
114
+ #### Initial Data Collection and Normalization
115
+
116
+ Natural Questions contains question from aggregated queries to Google Search (Kwiatkowski et al., 2019). To gather an open version of this dataset, we only keep questions with short answers and discard the given evidence document. Answers with many tokens often resemble extractive snippets rather than canonical answers, so we discard answers with more than 5 tokens.
117
+
118
+ #### Who are the source language producers?
119
+
120
+ [Needs More Information]
121
+
122
+ ### Annotations
123
+
124
+ #### Annotation process
125
+
126
+ [Needs More Information]
127
+
128
+ #### Who are the annotators?
129
+
130
+ [Needs More Information]
131
+
132
+ ### Personal and Sensitive Information
133
+
134
+ [Needs More Information]
135
+
136
+ ## Considerations for Using the Data
137
+
138
+ ### Social Impact of Dataset
139
+
140
+ [Needs More Information]
141
+
142
+ ### Discussion of Biases
143
+
144
+ Evaluating on this diverse set of question-answer pairs is crucial, because all existing datasets have inherent biases that are problematic for open domain QA systems with learned retrieval.
145
+ In the Natural Questions dataset the question askers do not already know the answer. This accurately reflects a distribution of genuine information-seeking questions.
146
+ However, annotators must separately find correct answers, which requires assistance from automatic tools and can introduce a moderate bias towards results from the tool.
147
+
148
+ ### Other Known Limitations
149
+
150
+ [Needs More Information]
151
+
152
+ ## Additional Information
153
+
154
+ ### Dataset Curators
155
+
156
+ [Needs More Information]
157
+
158
+ ### Licensing Information
159
+
160
+ All of the Natural Questions data is released under the
161
+ [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) license.
162
+
163
+ ### Citation Information
164
+
165
+ ```
166
+ @article{doi:10.1162/tacl\_a\_00276,
167
+ author = {Kwiatkowski, Tom and Palomaki, Jennimaria and Redfield, Olivia and Collins, Michael and Parikh, Ankur and Alberti, Chris and Epstein, Danielle and Polosukhin, Illia and Devlin, Jacob and Lee, Kenton and Toutanova, Kristina and Jones, Llion and Kelcey, Matthew and Chang, Ming-Wei and Dai, Andrew M. and Uszkoreit, Jakob and Le, Quoc and Petrov, Slav},
168
+ title = {Natural Questions: A Benchmark for Question Answering Research},
169
+ journal = {Transactions of the Association for Computational Linguistics},
170
+ volume = {7},
171
+ number = {},
172
+ pages = {453-466},
173
+ year = {2019},
174
+ doi = {10.1162/tacl\_a\_00276},
175
+ URL = {
176
+ https://doi.org/10.1162/tacl_a_00276
177
+ },
178
+ eprint = {
179
+ https://doi.org/10.1162/tacl_a_00276
180
+
181
+ },
182
+ abstract = { We present the Natural Questions corpus, a question answering data set. Questions consist of real anonymized, aggregated queries issued to the Google search engine. An annotator is presented with a question along with a Wikipedia page from the top 5 search results, and annotates a long answer (typically a paragraph) and a short answer (one or more entities) if present on the page, or marks null if no long/short answer is present. The public release consists of 307,373 training examples with single annotations; 7,830 examples with 5-way annotations for development data; and a further 7,842 examples with 5-way annotated sequestered as test data. We present experiments validating quality of the data. We also describe analysis of 25-way annotations on 302 examples, giving insights into human variability on the annotation task. We introduce robust metrics for the purposes of evaluating question answering systems; demonstrate high human upper bounds on these metrics; and establish baseline results using competitive methods drawn from related literature. }
183
+ }
184
+
185
+ @inproceedings{lee-etal-2019-latent,
186
+ title = "Latent Retrieval for Weakly Supervised Open Domain Question Answering",
187
+ author = "Lee, Kenton and
188
+ Chang, Ming-Wei and
189
+ Toutanova, Kristina",
190
+ booktitle = "Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics",
191
+ month = jul,
192
+ year = "2019",
193
+ address = "Florence, Italy",
194
+ publisher = "Association for Computational Linguistics",
195
+ url = "https://www.aclweb.org/anthology/P19-1612",
196
+ doi = "10.18653/v1/P19-1612",
197
+ pages = "6086--6096",
198
+ abstract = "Recent work on open domain question answering (QA) assumes strong supervision of the supporting evidence and/or assumes a blackbox information retrieval (IR) system to retrieve evidence candidates. We argue that both are suboptimal, since gold evidence is not always available, and QA is fundamentally different from IR. We show for the first time that it is possible to jointly learn the retriever and reader from question-answer string pairs and without any IR system. In this setting, evidence retrieval from all of Wikipedia is treated as a latent variable. Since this is impractical to learn from scratch, we pre-train the retriever with an Inverse Cloze Task. We evaluate on open versions of five QA datasets. On datasets where the questioner already knows the answer, a traditional IR system such as BM25 is sufficient. On datasets where a user is genuinely seeking an answer, we show that learned retrieval is crucial, outperforming BM25 by up to 19 points in exact match.",
199
+ }
200
+ ```
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"nq_open": {"description": "The NQ-Open task, introduced by Lee et.al. 2019,\nis an open domain question answering benchmark that is derived from Natural Questions.\nThe goal is to predict an English answer string for an input English question.\nAll questions can be answered using the contents of English Wikipedia.\n", "citation": "@article{doi:10.1162/tacl_a_00276,\n author = {Kwiatkowski, Tom and Palomaki, Jennimaria and Redfield, Olivia and Collins, Michael and Parikh, Ankur and Alberti, Chris and Epstein, Danielle and Polosukhin, Illia and Devlin, Jacob and Lee, Kenton and Toutanova, Kristina and Jones, Llion and Kelcey, Matthew and Chang, Ming-Wei and Dai, Andrew M. and Uszkoreit, Jakob and Le, Quoc and Petrov, Slav},\n title = {Natural Questions: A Benchmark for Question Answering Research},\n journal = {Transactions of the Association for Computational Linguistics},\n volume = {7},\n number = {},\n pages = {453-466},\n year = {2019},\n doi = {10.1162/tacl_a_00276},\n URL = {\n https://doi.org/10.1162/tacl_a_00276\n },\n eprint = {\n https://doi.org/10.1162/tacl_a_00276\n },\n abstract = { We present the Natural Questions corpus, a question answering data set. Questions consist of real anonymized, aggregated queries issued to the Google search engine. An annotator is presented with a question along with a Wikipedia page from the top 5 search results, and annotates a long answer (typically a paragraph) and a short answer (one or more entities) if present on the page, or marks null if no long/short answer is present. The public release consists of 307,373 training examples with single annotations; 7,830 examples with 5-way annotations for development data; and a further 7,842 examples with 5-way annotated sequestered as test data. We present experiments validating quality of the data. We also describe analysis of 25-way annotations on 302 examples, giving insights into human variability on the annotation task. We introduce robust metrics for the purposes of evaluating question answering systems; demonstrate high human upper bounds on these metrics; and establish baseline results using competitive methods drawn from related literature. }\n}\n\n@inproceedings{lee-etal-2019-latent,\n title = \"Latent Retrieval for Weakly Supervised Open Domain Question Answering\",\n author = \"Lee, Kenton and\n Chang, Ming-Wei and\n Toutanova, Kristina\",\n booktitle = \"Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics\",\n month = jul,\n year = \"2019\",\n address = \"Florence, Italy\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/P19-1612\",\n doi = \"10.18653/v1/P19-1612\",\n pages = \"6086--6096\",\n abstract = \"Recent work on open domain question answering (QA) assumes strong supervision of the supporting evidence and/or assumes a blackbox information retrieval (IR) system to retrieve evidence candidates. We argue that both are suboptimal, since gold evidence is not always available, and QA is fundamentally different from IR. We show for the first time that it is possible to jointly learn the retriever and reader from question-answer string pairs and without any IR system. In this setting, evidence retrieval from all of Wikipedia is treated as a latent variable. Since this is impractical to learn from scratch, we pre-train the retriever with an Inverse Cloze Task. We evaluate on open versions of five QA datasets. On datasets where the questioner already knows the answer, a traditional IR system such as BM25 is sufficient. On datasets where a user is genuinely seeking an answer, we show that learned retrieval is crucial, outperforming BM25 by up to 19 points in exact match.\",\n}\n", "homepage": "https://efficientqa.github.io/", "license": "", "features": {"question": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "nq_open", "config_name": "nq_open", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 6651344, "num_examples": 87925, "dataset_name": "nq_open"}, "validation": {"name": "validation", "num_bytes": 156124, "num_examples": 1800, "dataset_name": "nq_open"}}, "download_checksums": {"https://raw.githubusercontent.com/google-research-datasets/natural-questions/master/nq_open/NQ-open.efficientqa.dev.1.1.jsonl": {"num_bytes": 194998, "checksum": "0ad45e2fa9fd32d10b3cf08c63e6d22f97ba1a0ce44ea98040f4c18bce7e268d"}, "https://raw.githubusercontent.com/google-research-datasets/natural-questions/master/nq_open/NQ-open.train.jsonl": {"num_bytes": 8522298, "checksum": "0c93aaf13b12f855628489665e4ef85ffb8573ad444646f11f4fabdc57a0aabf"}}, "download_size": 8717296, "post_processing_size": null, "dataset_size": 6807468, "size_in_bytes": 15524764}}
dummy/nq_open/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a107f7b42fd4784910221dcbb626379d7402e4dc0db4025603790d1535744f1
3
+ size 904
nq_open.py ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 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
+
16
+ # Lint as: python3
17
+ import json
18
+
19
+ import datasets
20
+
21
+
22
+ _DESCRIPTION = """\
23
+ The NQ-Open task, introduced by Lee et.al. 2019,
24
+ is an open domain question answering benchmark that is derived from Natural Questions.
25
+ The goal is to predict an English answer string for an input English question.
26
+ All questions can be answered using the contents of English Wikipedia.
27
+ """
28
+
29
+ _HOMEPAGE_URL = "https://efficientqa.github.io/"
30
+
31
+ _CITATION = """\
32
+ @article{doi:10.1162/tacl_a_00276,
33
+ author = {Kwiatkowski, Tom and Palomaki, Jennimaria and Redfield, Olivia and Collins, Michael and Parikh, Ankur and Alberti, Chris and Epstein, Danielle and Polosukhin, Illia and Devlin, Jacob and Lee, Kenton and Toutanova, Kristina and Jones, Llion and Kelcey, Matthew and Chang, Ming-Wei and Dai, Andrew M. and Uszkoreit, Jakob and Le, Quoc and Petrov, Slav},
34
+ title = {Natural Questions: A Benchmark for Question Answering Research},
35
+ journal = {Transactions of the Association for Computational Linguistics},
36
+ volume = {7},
37
+ number = {},
38
+ pages = {453-466},
39
+ year = {2019},
40
+ doi = {10.1162/tacl_a_00276},
41
+ URL = {
42
+ https://doi.org/10.1162/tacl_a_00276
43
+ },
44
+ eprint = {
45
+ https://doi.org/10.1162/tacl_a_00276
46
+ },
47
+ abstract = { We present the Natural Questions corpus, a question answering data set. Questions consist of real anonymized, aggregated queries issued to the Google search engine. An annotator is presented with a question along with a Wikipedia page from the top 5 search results, and annotates a long answer (typically a paragraph) and a short answer (one or more entities) if present on the page, or marks null if no long/short answer is present. The public release consists of 307,373 training examples with single annotations; 7,830 examples with 5-way annotations for development data; and a further 7,842 examples with 5-way annotated sequestered as test data. We present experiments validating quality of the data. We also describe analysis of 25-way annotations on 302 examples, giving insights into human variability on the annotation task. We introduce robust metrics for the purposes of evaluating question answering systems; demonstrate high human upper bounds on these metrics; and establish baseline results using competitive methods drawn from related literature. }
48
+ }
49
+
50
+ @inproceedings{lee-etal-2019-latent,
51
+ title = "Latent Retrieval for Weakly Supervised Open Domain Question Answering",
52
+ author = "Lee, Kenton and
53
+ Chang, Ming-Wei and
54
+ Toutanova, Kristina",
55
+ booktitle = "Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics",
56
+ month = jul,
57
+ year = "2019",
58
+ address = "Florence, Italy",
59
+ publisher = "Association for Computational Linguistics",
60
+ url = "https://www.aclweb.org/anthology/P19-1612",
61
+ doi = "10.18653/v1/P19-1612",
62
+ pages = "6086--6096",
63
+ abstract = "Recent work on open domain question answering (QA) assumes strong supervision of the supporting evidence and/or assumes a blackbox information retrieval (IR) system to retrieve evidence candidates. We argue that both are suboptimal, since gold evidence is not always available, and QA is fundamentally different from IR. We show for the first time that it is possible to jointly learn the retriever and reader from question-answer string pairs and without any IR system. In this setting, evidence retrieval from all of Wikipedia is treated as a latent variable. Since this is impractical to learn from scratch, we pre-train the retriever with an Inverse Cloze Task. We evaluate on open versions of five QA datasets. On datasets where the questioner already knows the answer, a traditional IR system such as BM25 is sufficient. On datasets where a user is genuinely seeking an answer, we show that learned retrieval is crucial, outperforming BM25 by up to 19 points in exact match.",
64
+ }
65
+ """
66
+
67
+ _URLS = {
68
+ "dev": "https://raw.githubusercontent.com/google-research-datasets/natural-questions/master/nq_open/NQ-open.efficientqa.dev.1.1.jsonl",
69
+ "train": "https://raw.githubusercontent.com/google-research-datasets/natural-questions/master/nq_open/NQ-open.train.jsonl",
70
+ }
71
+
72
+
73
+ class NQOpenConfig(datasets.BuilderConfig):
74
+ """BuilderConfig for NQ_Open."""
75
+
76
+ def __init__(self, **kwargs):
77
+ """BuilderConfig for NQ_Open.
78
+ Args:
79
+ **kwargs: keyword arguments forwarded to super.
80
+ """
81
+ super(NQOpenConfig, self).__init__(**kwargs)
82
+
83
+
84
+ class NQOpen(datasets.GeneratorBasedBuilder):
85
+ """ NQ_Open open domain question answering dataset. """
86
+
87
+ BUILDER_CONFIGS = [
88
+ NQOpenConfig(
89
+ name="nq_open",
90
+ version=datasets.Version("1.0.0", ""),
91
+ description=f"NQ_Open open domain question answering dataset.",
92
+ ),
93
+ ]
94
+ BUILDER_CONFIG_CLASS = NQOpenConfig
95
+
96
+ def _info(self):
97
+ return datasets.DatasetInfo(
98
+ description=_DESCRIPTION,
99
+ features=datasets.Features(
100
+ {
101
+ "question": datasets.Value("string"),
102
+ "answer": datasets.Sequence(datasets.Value("string")),
103
+ }
104
+ ),
105
+ supervised_keys=None,
106
+ homepage=_HOMEPAGE_URL,
107
+ citation=_CITATION,
108
+ )
109
+
110
+ def _split_generators(self, dl_manager):
111
+ paths = dl_manager.download_and_extract(_URLS)
112
+
113
+ return [
114
+ datasets.SplitGenerator(
115
+ name=datasets.Split.TRAIN,
116
+ gen_kwargs={"datapath": paths["train"]},
117
+ ),
118
+ datasets.SplitGenerator(
119
+ name=datasets.Split.VALIDATION,
120
+ gen_kwargs={"datapath": paths["dev"]},
121
+ ),
122
+ ]
123
+
124
+ def _generate_examples(self, datapath):
125
+ """Generate NQ_Open examples."""
126
+
127
+ with open(datapath, encoding="utf-8") as json_file:
128
+ for i, json_str in enumerate(json_file):
129
+ result = json.loads(json_str)
130
+ yield i, result