system HF staff commited on
Commit
32a0cde
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,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - found
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - bg
8
+ licenses:
9
+ - apache-2-0
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - n<1K
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - question-answering
18
+ task_ids:
19
+ - multiple-choice-qa
20
+ ---
21
+ # Dataset Card for reasoning_bg
22
+
23
+ ## Table of Contents
24
+ - [Dataset Description](#dataset-description)
25
+ - [Dataset Summary](#dataset-summary)
26
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
27
+ - [Languages](#languages)
28
+ - [Dataset Structure](#dataset-structure)
29
+ - [Data Instances](#data-instances)
30
+ - [Data Fields](#data-instances)
31
+ - [Data Splits](#data-instances)
32
+ - [Dataset Creation](#dataset-creation)
33
+ - [Curation Rationale](#curation-rationale)
34
+ - [Source Data](#source-data)
35
+ - [Annotations](#annotations)
36
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
37
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
38
+ - [Social Impact of Dataset](#social-impact-of-dataset)
39
+ - [Discussion of Biases](#discussion-of-biases)
40
+ - [Other Known Limitations](#other-known-limitations)
41
+ - [Additional Information](#additional-information)
42
+ - [Dataset Curators](#dataset-curators)
43
+ - [Licensing Information](#licensing-information)
44
+ - [Citation Information](#citation-information)
45
+
46
+ ## Dataset Description
47
+
48
+ - **Homepage:** https://github.com/mhardalov/bg-reason-BERT
49
+ - **Repository:** https://github.com/mhardalov/bg-reason-BERT
50
+ - **Paper:** [Beyond English-Only Reading Comprehension: Experiments in Zero-Shot Multilingual Transfer for Bulgarian](https://arxiv.org/abs/1908.01519)
51
+ - **Leaderboard:** [N/A]
52
+ - **Point of Contact:** [Momchil Hardalov](mailto:hardalov@fmi.uni-sofia.bg)
53
+
54
+ ### Dataset Summary
55
+
56
+ Recently, reading comprehension models achieved near-human performance on large-scale datasets such as SQuAD, CoQA, MS Macro, RACE, etc. This is largely due to the release of pre-trained contextualized representations such as BERT and ELMo, which can be fine-tuned for the target task. Despite those advances and the creation of more challenging datasets, most of the work is still done for English. Here, we study the effectiveness of multilingual BERT fine-tuned on large-scale English datasets for reading comprehension (e.g., for RACE), and we apply it to Bulgarian multiple-choice reading comprehension. We propose a new dataset containing 2,221 questions from matriculation exams for twelfth grade in various subjects -history, biology, geography and philosophy-, and 412 additional questions from online quizzes in history. While the quiz authors gave no relevant context, we incorporate knowledge from Wikipedia, retrieving documents matching the combination of question + each answer option.
57
+
58
+ ### Supported Tasks and Leaderboards
59
+
60
+ [Needs More Information]
61
+
62
+ ### Languages
63
+
64
+ Bulgarian
65
+
66
+ ## Dataset Structure
67
+
68
+ ### Data Instances
69
+
70
+ A typical data point comprises of question sentence and 4 possible choice answers and the correct answer.
71
+
72
+ ```
73
+ {
74
+ "id": "21181dda96414fd9b7a5e336ad84b45d",
75
+ "qid": 1,
76
+ "question": "!0<>AB>OB5;=> AJI5AB2C20I8 6828 A8AB5<8 A0:",
77
+ "answers": [
78
+ "28@CA8B5",
79
+ "BJ:0=8B5",
80
+ "<8B>E>=4@88B5",
81
+ "54=>:;5BJG=8B5 >@30=87<8"
82
+ ],
83
+ "correct": "54=>:;5BJG=8B5 >@30=87<8",
84
+ "url": "http://zamatura.eu/files/dzi/biologiq/2010/matura-biologiq-2010.pdf"
85
+ },
86
+ ```
87
+
88
+ ### Data Fields
89
+
90
+ - url : A string having the url from which the question has been sourced from
91
+ - id: A string question identifier for each example
92
+ - qid: An integer which shows the sequence of the question in that particular URL
93
+ - question: The title of the question
94
+ - answers: A list of each answers
95
+ - correct: The correct answer
96
+
97
+ ### Data Splits
98
+
99
+ The dataset covers the following domains
100
+
101
+ | Domain | #QA-paris | #Choices | Len Question | Len Options | Vocab Size |
102
+ |:-------|:---------:|:--------:|:------------:|:-----------:|:----------:|
103
+ | **12th Grade Matriculation Exam** |
104
+ | Biology | 437 | 4 | 10.44 | 2.64 | 2,414 (12,922)|
105
+ | Philosophy | 630 | 4 | 8.91 | 2.94| 3,636 (20,392) |
106
+ | Geography | 612 | 4 | 12.83 | 2.47 | 3,239 (17,668) |
107
+ | History | 542 | 4 | 23.74 | 3.64 | 5,466 (20,456) |
108
+ | **Online History Quizzes** |
109
+ | Bulgarian History | 229 | 4 | 14.05 | 2.80 | 2,287 (10,620) |
110
+ | PzHistory | 183 | 3 | 38.89 | 2.44 | 1,261 (7,518) |
111
+ | **Total** | 2,633 | 3.93 | 15.67 | 2.89 | 13,329 (56,104) |
112
+
113
+
114
+ ## Dataset Creation
115
+
116
+ ### Curation Rationale
117
+
118
+ The dataset has been curated from matriculation exams and online quizzes. These questions cover a large variety of science topics in biology, philosophy, geography, and history.
119
+
120
+ ### Source Data
121
+
122
+ #### Initial Data Collection and Normalization
123
+
124
+ Data has been sourced from the matriculation exams and online quizzes.
125
+
126
+ #### Who are the source language producers?
127
+
128
+ [Needs More Information]
129
+
130
+ ### Annotations
131
+
132
+ #### Annotation process
133
+
134
+ [Needs More Information]
135
+
136
+ #### Who are the annotators?
137
+
138
+ [Needs More Information]
139
+
140
+ ### Personal and Sensitive Information
141
+
142
+ [Needs More Information]
143
+
144
+ ## Considerations for Using the Data
145
+
146
+ ### Social Impact of Dataset
147
+
148
+ [Needs More Information]
149
+
150
+ ### Discussion of Biases
151
+
152
+ [Needs More Information]
153
+
154
+ ### Other Known Limitations
155
+
156
+ [Needs More Information]
157
+
158
+ ## Additional Information
159
+
160
+ ### Dataset Curators
161
+
162
+ [Needs More Information]
163
+
164
+ ### Licensing Information
165
+
166
+ [Needs More Information]
167
+
168
+ ### Citation Information
169
+
170
+ [Needs More Information]
171
+
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"biology-12th": {"description": "This new dataset is designed to do reading comprehension in Bulgarian language. \n", "citation": "@article{hardalov2019beyond,\n title={Beyond english-only reading comprehension: Experiments in zero-shot multilingual transfer for bulgarian},\n author={Hardalov, Momchil and Koychev, Ivan and Nakov, Preslav},\n journal={arXiv preprint arXiv:1908.01519},\n year={2019}\n}\n", "homepage": "https://github.com/mhardalov/bg-reason-BERT", "license": "Apache-2.0 License", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "qid": {"dtype": "int32", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "correct": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "reasoning_bg", "config_name": "biology-12th", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 197725, "num_examples": 437, "dataset_name": "reasoning_bg"}}, "download_checksums": {"https://raw.githubusercontent.com/mhardalov/bg-reason-BERT/master/data/bg_rc-v1.0.json": {"num_bytes": 1753795, "checksum": "330f900893d9c27e8f3f780415df03d5a2545c4e453c471021c1c77b117ca77a"}}, "download_size": 1753795, "post_processing_size": null, "dataset_size": 197725, "size_in_bytes": 1951520}, "philosophy-12th": {"description": "This new dataset is designed to do reading comprehension in Bulgarian language. \n", "citation": "@article{hardalov2019beyond,\n title={Beyond english-only reading comprehension: Experiments in zero-shot multilingual transfer for bulgarian},\n author={Hardalov, Momchil and Koychev, Ivan and Nakov, Preslav},\n journal={arXiv preprint arXiv:1908.01519},\n year={2019}\n}\n", "homepage": "https://github.com/mhardalov/bg-reason-BERT", "license": "Apache-2.0 License", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "qid": {"dtype": "int32", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "correct": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "reasoning_bg", "config_name": "philosophy-12th", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 286999, "num_examples": 630, "dataset_name": "reasoning_bg"}}, "download_checksums": {"https://raw.githubusercontent.com/mhardalov/bg-reason-BERT/master/data/bg_rc-v1.0.json": {"num_bytes": 1753795, "checksum": "330f900893d9c27e8f3f780415df03d5a2545c4e453c471021c1c77b117ca77a"}}, "download_size": 1753795, "post_processing_size": null, "dataset_size": 286999, "size_in_bytes": 2040794}, "geography-12th": {"description": "This new dataset is designed to do reading comprehension in Bulgarian language. \n", "citation": "@article{hardalov2019beyond,\n title={Beyond english-only reading comprehension: Experiments in zero-shot multilingual transfer for bulgarian},\n author={Hardalov, Momchil and Koychev, Ivan and Nakov, Preslav},\n journal={arXiv preprint arXiv:1908.01519},\n year={2019}\n}\n", "homepage": "https://github.com/mhardalov/bg-reason-BERT", "license": "Apache-2.0 License", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "qid": {"dtype": "int32", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "correct": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "reasoning_bg", "config_name": "geography-12th", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 283417, "num_examples": 612, "dataset_name": "reasoning_bg"}}, "download_checksums": {"https://raw.githubusercontent.com/mhardalov/bg-reason-BERT/master/data/bg_rc-v1.0.json": {"num_bytes": 1753795, "checksum": "330f900893d9c27e8f3f780415df03d5a2545c4e453c471021c1c77b117ca77a"}}, "download_size": 1753795, "post_processing_size": null, "dataset_size": 283417, "size_in_bytes": 2037212}, "history-12th": {"description": "This new dataset is designed to do reading comprehension in Bulgarian language. \n", "citation": "@article{hardalov2019beyond,\n title={Beyond english-only reading comprehension: Experiments in zero-shot multilingual transfer for bulgarian},\n author={Hardalov, Momchil and Koychev, Ivan and Nakov, Preslav},\n journal={arXiv preprint arXiv:1908.01519},\n year={2019}\n}\n", "homepage": "https://github.com/mhardalov/bg-reason-BERT", "license": "Apache-2.0 License", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "qid": {"dtype": "int32", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "correct": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "reasoning_bg", "config_name": "history-12th", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 341472, "num_examples": 542, "dataset_name": "reasoning_bg"}}, "download_checksums": {"https://raw.githubusercontent.com/mhardalov/bg-reason-BERT/master/data/bg_rc-v1.0.json": {"num_bytes": 1753795, "checksum": "330f900893d9c27e8f3f780415df03d5a2545c4e453c471021c1c77b117ca77a"}}, "download_size": 1753795, "post_processing_size": null, "dataset_size": 341472, "size_in_bytes": 2095267}, "history-quiz": {"description": "This new dataset is designed to do reading comprehension in Bulgarian language. \n", "citation": "@article{hardalov2019beyond,\n title={Beyond english-only reading comprehension: Experiments in zero-shot multilingual transfer for bulgarian},\n author={Hardalov, Momchil and Koychev, Ivan and Nakov, Preslav},\n journal={arXiv preprint arXiv:1908.01519},\n year={2019}\n}\n", "homepage": "https://github.com/mhardalov/bg-reason-BERT", "license": "Apache-2.0 License", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}, "qid": {"dtype": "int32", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "correct": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "reasoning_bg", "config_name": "history-quiz", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 164495, "num_examples": 412, "dataset_name": "reasoning_bg"}}, "download_checksums": {"https://raw.githubusercontent.com/mhardalov/bg-reason-BERT/master/data/bg_rc-v1.0.json": {"num_bytes": 1753795, "checksum": "330f900893d9c27e8f3f780415df03d5a2545c4e453c471021c1c77b117ca77a"}}, "download_size": 1753795, "post_processing_size": null, "dataset_size": 164495, "size_in_bytes": 1918290}}
dummy/biology-12th/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee03300604e528fbae89d469611fce34a72904531da021bcab49c96fef9d1e1f
3
+ size 1257
dummy/geography-12th/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab13cc8bfd3fb477f1342702e073e3c50c8b86e556da0e0c9dd1cf4ae7a191d1
3
+ size 1347
dummy/history-12th/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6605df66869ebe4703f305694731193d3fc358ec8818c251ed572d4e328dcb89
3
+ size 1534
dummy/history-quiz/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:821ef8608a18c5e0a0709f798953e476fbcc228e9845970d58485e33a22ce6a2
3
+ size 1843
dummy/philosophy-12th/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:80b4c8f34d8d90a43a1362c93a5cd486987760c9e24f10922ee95d8a1f151bf1
3
+ size 1164
reasoning_bg.py ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """TODO: Add a description here."""
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
+ @article{hardalov2019beyond,
27
+ title={Beyond english-only reading comprehension: Experiments in zero-shot multilingual transfer for bulgarian},
28
+ author={Hardalov, Momchil and Koychev, Ivan and Nakov, Preslav},
29
+ journal={arXiv preprint arXiv:1908.01519},
30
+ year={2019}
31
+ }
32
+ """
33
+
34
+ _DESCRIPTION = """\
35
+ This new dataset is designed to do reading comprehension in Bulgarian language.
36
+ """
37
+
38
+ _HOMEPAGE = "https://github.com/mhardalov/bg-reason-BERT"
39
+
40
+ _LICENSE = "Apache-2.0 License"
41
+
42
+ _URL = "https://raw.githubusercontent.com/mhardalov/bg-reason-BERT/master/data/bg_rc-v1.0.json"
43
+
44
+
45
+ class ReasoningBg(datasets.GeneratorBasedBuilder):
46
+ """To test reasoning comprehension in Bulgarian Language"""
47
+
48
+ VERSION = datasets.Version("1.1.0")
49
+
50
+ BUILDER_CONFIGS = [
51
+ datasets.BuilderConfig(
52
+ name="biology-12th", version=VERSION, description="MCQs in Biology of 12th Grade Matriculation Exam"
53
+ ),
54
+ datasets.BuilderConfig(
55
+ name="philosophy-12th", version=VERSION, description="MCQs in Philosophy of 12th Grade Matriculation Exam"
56
+ ),
57
+ datasets.BuilderConfig(
58
+ name="geography-12th", version=VERSION, description="MCQs in Geography of 12th Grade Matriculation Exam"
59
+ ),
60
+ datasets.BuilderConfig(
61
+ name="history-12th", version=VERSION, description="MCQs in History of 12th Grade Matriculation Exam"
62
+ ),
63
+ datasets.BuilderConfig(
64
+ name="history-quiz", version=VERSION, description="MCQs in Bulgarian History from Online History Quizzes"
65
+ ),
66
+ ]
67
+
68
+ def _info(self):
69
+ features = datasets.Features(
70
+ {
71
+ "id": datasets.Value("string"),
72
+ "url": datasets.Value("string"),
73
+ "qid": datasets.Value("int32"),
74
+ "question": datasets.Value("string"),
75
+ "answers": datasets.Sequence(datasets.Value("string")),
76
+ "correct": datasets.Value("string"),
77
+ }
78
+ )
79
+ return datasets.DatasetInfo(
80
+ description=_DESCRIPTION,
81
+ features=features,
82
+ supervised_keys=None,
83
+ homepage=_HOMEPAGE,
84
+ license=_LICENSE,
85
+ citation=_CITATION,
86
+ )
87
+
88
+ def _split_generators(self, dl_manager):
89
+ """Returns SplitGenerators."""
90
+
91
+ downloaded_path = dl_manager.download(_URL)
92
+ return [
93
+ datasets.SplitGenerator(
94
+ name=datasets.Split.TRAIN,
95
+ # These kwargs will be passed to _generate_examples
96
+ gen_kwargs={
97
+ "filepath": os.path.join(downloaded_path),
98
+ "split": "train",
99
+ },
100
+ ),
101
+ ]
102
+
103
+ def _generate_examples(self, filepath, split):
104
+ """ Yields examples. """
105
+
106
+ with open(filepath, encoding="utf-8") as f:
107
+ content = f.read()
108
+ data = json.loads(content)["data"][self.config.name]
109
+ for page in data:
110
+ url = page["url"]
111
+ for question in page["questions"]:
112
+ yield str(question["id"]), {
113
+ "url": url,
114
+ "id": question["id"],
115
+ "qid": question["qid"],
116
+ "question": question["question"],
117
+ "answers": question["answers"],
118
+ "correct": question["correct"],
119
+ }