Datasets:
Abinaya Mahendiran
commited on
Commit
•
6d465c1
1
Parent(s):
3d3697e
Updated data loader script
Browse files- squad_v2.py +42 -0
squad_v2.py
CHANGED
@@ -134,6 +134,48 @@ class SquadV2(datasets.GeneratorBasedBuilder):
|
|
134 |
"split": "test",
|
135 |
},
|
136 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
]
|
138 |
|
139 |
def _generate_examples(self, filepath, split):
|
|
|
134 |
"split": "test",
|
135 |
},
|
136 |
),
|
137 |
+
datasets.SplitGenerator(
|
138 |
+
name="question_type_train",
|
139 |
+
gen_kwargs={
|
140 |
+
"filepath": downloaded_files["question_type_split"]["train"],
|
141 |
+
"split": "train",
|
142 |
+
},
|
143 |
+
),
|
144 |
+
datasets.SplitGenerator(
|
145 |
+
name="question_type_test",
|
146 |
+
gen_kwargs={
|
147 |
+
"filepath": downloaded_files["question_type_split"]["test"],
|
148 |
+
"split": "test",
|
149 |
+
},
|
150 |
+
),
|
151 |
+
datasets.SplitGenerator(
|
152 |
+
name="question_type_validation",
|
153 |
+
gen_kwargs={
|
154 |
+
"filepath": downloaded_files["question_type_split"]["validation"],
|
155 |
+
"split": "validation",
|
156 |
+
},
|
157 |
+
),
|
158 |
+
datasets.SplitGenerator(
|
159 |
+
name="answerable_question_train",
|
160 |
+
gen_kwargs={
|
161 |
+
"filepath": downloaded_files["answerable_question_split"]["train"],
|
162 |
+
"split": "train",
|
163 |
+
},
|
164 |
+
),
|
165 |
+
datasets.SplitGenerator(
|
166 |
+
name="answerable_question_test",
|
167 |
+
gen_kwargs={
|
168 |
+
"filepath": downloaded_files["answerable_question_split"]["test"],
|
169 |
+
"split": "test",
|
170 |
+
},
|
171 |
+
),
|
172 |
+
datasets.SplitGenerator(
|
173 |
+
name="answerable_question_validation",
|
174 |
+
gen_kwargs={
|
175 |
+
"filepath": downloaded_files["answerable_question_split"]["validation"],
|
176 |
+
"split": "validation",
|
177 |
+
},
|
178 |
+
),
|
179 |
]
|
180 |
|
181 |
def _generate_examples(self, filepath, split):
|