Convert dataset to Parquet
#3
by
albertvillanova
HF staff
- opened
- README.md +291 -16
- mode=first,char_skip=25/adversarial-00000-of-00001.parquet +3 -0
- mode=first,char_skip=25/buzzdev-00000-of-00001.parquet +3 -0
- mode=first,char_skip=25/buzztest-00000-of-00001.parquet +3 -0
- mode=first,char_skip=25/buzztrain-00000-of-00001.parquet +3 -0
- mode=first,char_skip=25/guessdev-00000-of-00001.parquet +3 -0
- mode=first,char_skip=25/guesstest-00000-of-00001.parquet +3 -0
- mode=first,char_skip=25/guesstrain-00000-of-00001.parquet +3 -0
- mode=full,char_skip=25/adversarial-00000-of-00001.parquet +3 -0
- mode=full,char_skip=25/buzzdev-00000-of-00001.parquet +3 -0
- mode=full,char_skip=25/buzztest-00000-of-00001.parquet +3 -0
- mode=full,char_skip=25/buzztrain-00000-of-00001.parquet +3 -0
- mode=full,char_skip=25/guessdev-00000-of-00001.parquet +3 -0
- mode=full,char_skip=25/guesstest-00000-of-00001.parquet +3 -0
- mode=full,char_skip=25/guesstrain-00000-of-00001.parquet +3 -0
- mode=runs,char_skip=25/adversarial-00000-of-00001.parquet +3 -0
- mode=runs,char_skip=25/buzzdev-00000-of-00001.parquet +3 -0
- mode=runs,char_skip=25/buzztest-00000-of-00001.parquet +3 -0
- mode=runs,char_skip=25/buzztrain-00000-of-00002.parquet +3 -0
- mode=runs,char_skip=25/buzztrain-00001-of-00002.parquet +3 -0
- mode=runs,char_skip=25/guessdev-00000-of-00001.parquet +3 -0
- mode=runs,char_skip=25/guesstest-00000-of-00001.parquet +3 -0
- mode=runs,char_skip=25/guesstrain-00000-of-00008.parquet +3 -0
- mode=runs,char_skip=25/guesstrain-00001-of-00008.parquet +3 -0
- mode=runs,char_skip=25/guesstrain-00002-of-00008.parquet +3 -0
- mode=runs,char_skip=25/guesstrain-00003-of-00008.parquet +3 -0
- mode=runs,char_skip=25/guesstrain-00004-of-00008.parquet +3 -0
- mode=runs,char_skip=25/guesstrain-00005-of-00008.parquet +3 -0
- mode=runs,char_skip=25/guesstrain-00006-of-00008.parquet +3 -0
- mode=runs,char_skip=25/guesstrain-00007-of-00008.parquet +3 -0
- mode=sentences,char_skip=25/adversarial-00000-of-00001.parquet +3 -0
- mode=sentences,char_skip=25/buzzdev-00000-of-00001.parquet +3 -0
- mode=sentences,char_skip=25/buzztest-00000-of-00001.parquet +3 -0
- mode=sentences,char_skip=25/buzztrain-00000-of-00001.parquet +3 -0
- mode=sentences,char_skip=25/guessdev-00000-of-00001.parquet +3 -0
- mode=sentences,char_skip=25/guesstest-00000-of-00001.parquet +3 -0
- mode=sentences,char_skip=25/guesstrain-00000-of-00002.parquet +3 -0
- mode=sentences,char_skip=25/guesstrain-00001-of-00002.parquet +3 -0
- qanta.py +0 -289
README.md
CHANGED
@@ -1,15 +1,14 @@
|
|
1 |
---
|
2 |
annotations_creators:
|
3 |
- machine-generated
|
4 |
-
language:
|
5 |
-
- en
|
6 |
language_creators:
|
7 |
- found
|
|
|
|
|
8 |
license:
|
9 |
- unknown
|
10 |
multilinguality:
|
11 |
- monolingual
|
12 |
-
pretty_name: Quizbowl
|
13 |
size_categories:
|
14 |
- 100K<n<1M
|
15 |
source_datasets:
|
@@ -18,9 +17,11 @@ task_categories:
|
|
18 |
- question-answering
|
19 |
task_ids: []
|
20 |
paperswithcode_id: quizbowl
|
|
|
21 |
tags:
|
22 |
- quizbowl
|
23 |
dataset_info:
|
|
|
24 |
features:
|
25 |
- name: id
|
26 |
dtype: string
|
@@ -66,31 +67,305 @@ dataset_info:
|
|
66 |
dtype: string
|
67 |
- name: year
|
68 |
dtype: int32
|
69 |
-
config_name: mode=first,char_skip=25
|
70 |
splits:
|
71 |
-
- name:
|
72 |
-
num_bytes:
|
73 |
-
num_examples:
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
- name: buzzdev
|
75 |
-
num_bytes:
|
76 |
num_examples: 1161
|
|
|
|
|
|
|
77 |
- name: buzztest
|
78 |
-
num_bytes:
|
79 |
num_examples: 1953
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
- name: buzztrain
|
81 |
-
num_bytes:
|
82 |
num_examples: 16706
|
83 |
- name: guessdev
|
84 |
-
num_bytes:
|
85 |
num_examples: 1055
|
|
|
|
|
|
|
86 |
- name: guesstest
|
87 |
-
num_bytes:
|
88 |
num_examples: 2151
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
- name: guesstrain
|
90 |
-
num_bytes:
|
91 |
-
num_examples:
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
---
|
95 |
|
96 |
# Dataset Card for "qanta"
|
|
|
1 |
---
|
2 |
annotations_creators:
|
3 |
- machine-generated
|
|
|
|
|
4 |
language_creators:
|
5 |
- found
|
6 |
+
language:
|
7 |
+
- en
|
8 |
license:
|
9 |
- unknown
|
10 |
multilinguality:
|
11 |
- monolingual
|
|
|
12 |
size_categories:
|
13 |
- 100K<n<1M
|
14 |
source_datasets:
|
|
|
17 |
- question-answering
|
18 |
task_ids: []
|
19 |
paperswithcode_id: quizbowl
|
20 |
+
pretty_name: Quizbowl
|
21 |
tags:
|
22 |
- quizbowl
|
23 |
dataset_info:
|
24 |
+
- config_name: mode=first,char_skip=25
|
25 |
features:
|
26 |
- name: id
|
27 |
dtype: string
|
|
|
67 |
dtype: string
|
68 |
- name: year
|
69 |
dtype: int32
|
|
|
70 |
splits:
|
71 |
+
- name: guesstrain
|
72 |
+
num_bytes: 117599150
|
73 |
+
num_examples: 96221
|
74 |
+
- name: buzztrain
|
75 |
+
num_bytes: 19699616
|
76 |
+
num_examples: 16706
|
77 |
+
- name: guessdev
|
78 |
+
num_bytes: 1414822
|
79 |
+
num_examples: 1055
|
80 |
- name: buzzdev
|
81 |
+
num_bytes: 1553576
|
82 |
num_examples: 1161
|
83 |
+
- name: guesstest
|
84 |
+
num_bytes: 2997063
|
85 |
+
num_examples: 2151
|
86 |
- name: buzztest
|
87 |
+
num_bytes: 2653365
|
88 |
num_examples: 1953
|
89 |
+
- name: adversarial
|
90 |
+
num_bytes: 1258784
|
91 |
+
num_examples: 1145
|
92 |
+
download_size: 90840024
|
93 |
+
dataset_size: 147176376
|
94 |
+
- config_name: mode=full,char_skip=25
|
95 |
+
features:
|
96 |
+
- name: id
|
97 |
+
dtype: string
|
98 |
+
- name: qanta_id
|
99 |
+
dtype: int32
|
100 |
+
- name: proto_id
|
101 |
+
dtype: string
|
102 |
+
- name: qdb_id
|
103 |
+
dtype: int32
|
104 |
+
- name: dataset
|
105 |
+
dtype: string
|
106 |
+
- name: text
|
107 |
+
dtype: string
|
108 |
+
- name: full_question
|
109 |
+
dtype: string
|
110 |
+
- name: first_sentence
|
111 |
+
dtype: string
|
112 |
+
- name: char_idx
|
113 |
+
dtype: int32
|
114 |
+
- name: sentence_idx
|
115 |
+
dtype: int32
|
116 |
+
- name: tokenizations
|
117 |
+
sequence:
|
118 |
+
sequence: int32
|
119 |
+
length: 2
|
120 |
+
- name: answer
|
121 |
+
dtype: string
|
122 |
+
- name: page
|
123 |
+
dtype: string
|
124 |
+
- name: raw_answer
|
125 |
+
dtype: string
|
126 |
+
- name: fold
|
127 |
+
dtype: string
|
128 |
+
- name: gameplay
|
129 |
+
dtype: bool
|
130 |
+
- name: category
|
131 |
+
dtype: string
|
132 |
+
- name: subcategory
|
133 |
+
dtype: string
|
134 |
+
- name: tournament
|
135 |
+
dtype: string
|
136 |
+
- name: difficulty
|
137 |
+
dtype: string
|
138 |
+
- name: year
|
139 |
+
dtype: int32
|
140 |
+
splits:
|
141 |
+
- name: guesstrain
|
142 |
+
num_bytes: 168874612
|
143 |
+
num_examples: 96221
|
144 |
- name: buzztrain
|
145 |
+
num_bytes: 27989445
|
146 |
num_examples: 16706
|
147 |
- name: guessdev
|
148 |
+
num_bytes: 2098857
|
149 |
num_examples: 1055
|
150 |
+
- name: buzzdev
|
151 |
+
num_bytes: 2301145
|
152 |
+
num_examples: 1161
|
153 |
- name: guesstest
|
154 |
+
num_bytes: 4434626
|
155 |
num_examples: 2151
|
156 |
+
- name: buzztest
|
157 |
+
num_bytes: 3930150
|
158 |
+
num_examples: 1953
|
159 |
+
- name: adversarial
|
160 |
+
num_bytes: 1799969
|
161 |
+
num_examples: 1145
|
162 |
+
download_size: 133005755
|
163 |
+
dataset_size: 211428804
|
164 |
+
- config_name: mode=runs,char_skip=25
|
165 |
+
features:
|
166 |
+
- name: id
|
167 |
+
dtype: string
|
168 |
+
- name: qanta_id
|
169 |
+
dtype: int32
|
170 |
+
- name: proto_id
|
171 |
+
dtype: string
|
172 |
+
- name: qdb_id
|
173 |
+
dtype: int32
|
174 |
+
- name: dataset
|
175 |
+
dtype: string
|
176 |
+
- name: text
|
177 |
+
dtype: string
|
178 |
+
- name: full_question
|
179 |
+
dtype: string
|
180 |
+
- name: first_sentence
|
181 |
+
dtype: string
|
182 |
+
- name: char_idx
|
183 |
+
dtype: int32
|
184 |
+
- name: sentence_idx
|
185 |
+
dtype: int32
|
186 |
+
- name: tokenizations
|
187 |
+
sequence:
|
188 |
+
sequence: int32
|
189 |
+
length: 2
|
190 |
+
- name: answer
|
191 |
+
dtype: string
|
192 |
+
- name: page
|
193 |
+
dtype: string
|
194 |
+
- name: raw_answer
|
195 |
+
dtype: string
|
196 |
+
- name: fold
|
197 |
+
dtype: string
|
198 |
+
- name: gameplay
|
199 |
+
dtype: bool
|
200 |
+
- name: category
|
201 |
+
dtype: string
|
202 |
+
- name: subcategory
|
203 |
+
dtype: string
|
204 |
+
- name: tournament
|
205 |
+
dtype: string
|
206 |
+
- name: difficulty
|
207 |
+
dtype: string
|
208 |
+
- name: year
|
209 |
+
dtype: int32
|
210 |
+
splits:
|
211 |
- name: guesstrain
|
212 |
+
num_bytes: 3975570298
|
213 |
+
num_examples: 2641161
|
214 |
+
- name: buzztrain
|
215 |
+
num_bytes: 622976884
|
216 |
+
num_examples: 433552
|
217 |
+
- name: guessdev
|
218 |
+
num_bytes: 55281178
|
219 |
+
num_examples: 33602
|
220 |
+
- name: buzzdev
|
221 |
+
num_bytes: 60226416
|
222 |
+
num_examples: 36803
|
223 |
+
- name: guesstest
|
224 |
+
num_bytes: 120192213
|
225 |
+
num_examples: 70772
|
226 |
+
- name: buzztest
|
227 |
+
num_bytes: 104422131
|
228 |
+
num_examples: 63050
|
229 |
+
- name: adversarial
|
230 |
+
num_bytes: 37874827
|
231 |
+
num_examples: 27986
|
232 |
+
download_size: 306157359
|
233 |
+
dataset_size: 4976543947
|
234 |
+
- config_name: mode=sentences,char_skip=25
|
235 |
+
features:
|
236 |
+
- name: id
|
237 |
+
dtype: string
|
238 |
+
- name: qanta_id
|
239 |
+
dtype: int32
|
240 |
+
- name: proto_id
|
241 |
+
dtype: string
|
242 |
+
- name: qdb_id
|
243 |
+
dtype: int32
|
244 |
+
- name: dataset
|
245 |
+
dtype: string
|
246 |
+
- name: text
|
247 |
+
dtype: string
|
248 |
+
- name: full_question
|
249 |
+
dtype: string
|
250 |
+
- name: first_sentence
|
251 |
+
dtype: string
|
252 |
+
- name: char_idx
|
253 |
+
dtype: int32
|
254 |
+
- name: sentence_idx
|
255 |
+
dtype: int32
|
256 |
+
- name: tokenizations
|
257 |
+
sequence:
|
258 |
+
sequence: int32
|
259 |
+
length: 2
|
260 |
+
- name: answer
|
261 |
+
dtype: string
|
262 |
+
- name: page
|
263 |
+
dtype: string
|
264 |
+
- name: raw_answer
|
265 |
+
dtype: string
|
266 |
+
- name: fold
|
267 |
+
dtype: string
|
268 |
+
- name: gameplay
|
269 |
+
dtype: bool
|
270 |
+
- name: category
|
271 |
+
dtype: string
|
272 |
+
- name: subcategory
|
273 |
+
dtype: string
|
274 |
+
- name: tournament
|
275 |
+
dtype: string
|
276 |
+
- name: difficulty
|
277 |
+
dtype: string
|
278 |
+
- name: year
|
279 |
+
dtype: int32
|
280 |
+
splits:
|
281 |
+
- name: guesstrain
|
282 |
+
num_bytes: 629450237
|
283 |
+
num_examples: 505321
|
284 |
+
- name: buzztrain
|
285 |
+
num_bytes: 98941633
|
286 |
+
num_examples: 82574
|
287 |
+
- name: guessdev
|
288 |
+
num_bytes: 9112676
|
289 |
+
num_examples: 6818
|
290 |
+
- name: buzzdev
|
291 |
+
num_bytes: 9924887
|
292 |
+
num_examples: 7451
|
293 |
+
- name: guesstest
|
294 |
+
num_bytes: 19470155
|
295 |
+
num_examples: 14069
|
296 |
+
- name: buzztest
|
297 |
+
num_bytes: 17011859
|
298 |
+
num_examples: 12610
|
299 |
+
- name: adversarial
|
300 |
+
num_bytes: 6491504
|
301 |
+
num_examples: 5812
|
302 |
+
download_size: 150604036
|
303 |
+
dataset_size: 790402951
|
304 |
+
configs:
|
305 |
+
- config_name: mode=first,char_skip=25
|
306 |
+
data_files:
|
307 |
+
- split: guesstrain
|
308 |
+
path: mode=first,char_skip=25/guesstrain-*
|
309 |
+
- split: buzztrain
|
310 |
+
path: mode=first,char_skip=25/buzztrain-*
|
311 |
+
- split: guessdev
|
312 |
+
path: mode=first,char_skip=25/guessdev-*
|
313 |
+
- split: buzzdev
|
314 |
+
path: mode=first,char_skip=25/buzzdev-*
|
315 |
+
- split: guesstest
|
316 |
+
path: mode=first,char_skip=25/guesstest-*
|
317 |
+
- split: buzztest
|
318 |
+
path: mode=first,char_skip=25/buzztest-*
|
319 |
+
- split: adversarial
|
320 |
+
path: mode=first,char_skip=25/adversarial-*
|
321 |
+
- config_name: mode=full,char_skip=25
|
322 |
+
data_files:
|
323 |
+
- split: guesstrain
|
324 |
+
path: mode=full,char_skip=25/guesstrain-*
|
325 |
+
- split: buzztrain
|
326 |
+
path: mode=full,char_skip=25/buzztrain-*
|
327 |
+
- split: guessdev
|
328 |
+
path: mode=full,char_skip=25/guessdev-*
|
329 |
+
- split: buzzdev
|
330 |
+
path: mode=full,char_skip=25/buzzdev-*
|
331 |
+
- split: guesstest
|
332 |
+
path: mode=full,char_skip=25/guesstest-*
|
333 |
+
- split: buzztest
|
334 |
+
path: mode=full,char_skip=25/buzztest-*
|
335 |
+
- split: adversarial
|
336 |
+
path: mode=full,char_skip=25/adversarial-*
|
337 |
+
- config_name: mode=runs,char_skip=25
|
338 |
+
data_files:
|
339 |
+
- split: guesstrain
|
340 |
+
path: mode=runs,char_skip=25/guesstrain-*
|
341 |
+
- split: buzztrain
|
342 |
+
path: mode=runs,char_skip=25/buzztrain-*
|
343 |
+
- split: guessdev
|
344 |
+
path: mode=runs,char_skip=25/guessdev-*
|
345 |
+
- split: buzzdev
|
346 |
+
path: mode=runs,char_skip=25/buzzdev-*
|
347 |
+
- split: guesstest
|
348 |
+
path: mode=runs,char_skip=25/guesstest-*
|
349 |
+
- split: buzztest
|
350 |
+
path: mode=runs,char_skip=25/buzztest-*
|
351 |
+
- split: adversarial
|
352 |
+
path: mode=runs,char_skip=25/adversarial-*
|
353 |
+
- config_name: mode=sentences,char_skip=25
|
354 |
+
data_files:
|
355 |
+
- split: guesstrain
|
356 |
+
path: mode=sentences,char_skip=25/guesstrain-*
|
357 |
+
- split: buzztrain
|
358 |
+
path: mode=sentences,char_skip=25/buzztrain-*
|
359 |
+
- split: guessdev
|
360 |
+
path: mode=sentences,char_skip=25/guessdev-*
|
361 |
+
- split: buzzdev
|
362 |
+
path: mode=sentences,char_skip=25/buzzdev-*
|
363 |
+
- split: guesstest
|
364 |
+
path: mode=sentences,char_skip=25/guesstest-*
|
365 |
+
- split: buzztest
|
366 |
+
path: mode=sentences,char_skip=25/buzztest-*
|
367 |
+
- split: adversarial
|
368 |
+
path: mode=sentences,char_skip=25/adversarial-*
|
369 |
---
|
370 |
|
371 |
# Dataset Card for "qanta"
|
mode=first,char_skip=25/adversarial-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:94b100a21fb9afd1640b334986a655c5022d053c28fa290c647fbd93519aa8a7
|
3 |
+
size 770014
|
mode=first,char_skip=25/buzzdev-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1d8a80736df03adb1d16ac95420e4c4396f1110974367a889341cb596cb939aa
|
3 |
+
size 980444
|
mode=first,char_skip=25/buzztest-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:63cdc76f205a543814d4f6f8565dd01b7d2abf4885297a09380859e32755e0a5
|
3 |
+
size 1650491
|
mode=first,char_skip=25/buzztrain-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:32469536c6ab65a91ed8bc6c41cc13eaa6ca8bb0dce052c5b39cb2a6d7d09472
|
3 |
+
size 12210910
|
mode=first,char_skip=25/guessdev-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f3090a22826fa0bc91d44a3e2e8ca2b12d4782b964ebe47aa7a32138f1df204b
|
3 |
+
size 891115
|
mode=first,char_skip=25/guesstest-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ad39b303820514f51d2e532ddf704a63680818ffaa42b8fc6529d04676db6d12
|
3 |
+
size 1901004
|
mode=first,char_skip=25/guesstrain-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e43f7eba58852710e66d01b7014da4b6dd9737cc948b3de3fbe9b484cf393e0
|
3 |
+
size 72436046
|
mode=full,char_skip=25/adversarial-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:727baf965b8ad14e2f5dfea2280dbd44bee2ec68d8995a147f7dda4f5fc8f314
|
3 |
+
size 1116353
|
mode=full,char_skip=25/buzzdev-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7d33b329ed07ac99add0fe6e5dcc214c80e95b3a4c7b4bcc5df73b91b4ae866f
|
3 |
+
size 1472303
|
mode=full,char_skip=25/buzztest-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:77c0a543f083843d81b0a55896103c108c6c7308ae8b9957ee2d0da52e41d403
|
3 |
+
size 2485355
|
mode=full,char_skip=25/buzztrain-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3e2dcffd27d8ed3bf3b59b85e110f5d8b784682d8792064296aad5a7f2a04c0c
|
3 |
+
size 17676176
|
mode=full,char_skip=25/guessdev-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b66605d58d5d63799239eec88376e644989a8599563f3c04da684a8fded82fc9
|
3 |
+
size 1341979
|
mode=full,char_skip=25/guesstest-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:19344a88ff5416fdfa4b8aa8f72789e5416f7c3fe393337f2d5dadb6b31987b0
|
3 |
+
size 2858156
|
mode=full,char_skip=25/guesstrain-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e9eb03606064e553051a62081cd86b837fe9d35356cf62aa98001693b3744d2a
|
3 |
+
size 106055433
|
mode=runs,char_skip=25/adversarial-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a194f1ab2077bb68f10ebac6142ca21dc43aa1356e0315a8ad6c8a5cd4085292
|
3 |
+
size 2483463
|
mode=runs,char_skip=25/buzzdev-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:14a54a7a6c653151cd34f10eb8cad9b05734ed83a04dfc0a84e59485070855c1
|
3 |
+
size 3538241
|
mode=runs,char_skip=25/buzztest-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5f9796ce21c7abc4fa8a593cc8a66576e5a41f220c2e2f9bb36b4db5b04407b7
|
3 |
+
size 6091480
|
mode=runs,char_skip=25/buzztrain-00000-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:32da2e4e3e02a70f6bbd3c3c48a8c401a6a61c3c53ee5629af33776dc4dfa03b
|
3 |
+
size 19827793
|
mode=runs,char_skip=25/buzztrain-00001-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4388511edc145c298d52f73e5098d4ab7e5e7fee7102dbc250ae130684fcc57c
|
3 |
+
size 19653219
|
mode=runs,char_skip=25/guessdev-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf48d89f521cc384cb4fb8544d7faad5e1352645a51e9095c5d6bfb648714085
|
3 |
+
size 3229731
|
mode=runs,char_skip=25/guesstest-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5415f795762650c737f69f3ac1b0186a6d5538559db1a185b034a30ddfe6b747
|
3 |
+
size 6922466
|
mode=runs,char_skip=25/guesstrain-00000-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:79e4e35a908aeea1c4d1a5fa3cab45eb3ebf19a9b27a2ee7a78f09a64f34a5f7
|
3 |
+
size 29979582
|
mode=runs,char_skip=25/guesstrain-00001-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1afc0da95afb22c7de9ec6b8b0a0b66644f026164342ba28283a03fd7e0df388
|
3 |
+
size 30310019
|
mode=runs,char_skip=25/guesstrain-00002-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:136720c81a2091a099b54ccd10eda721f7434aee59815602a3616215d6026cb0
|
3 |
+
size 30754000
|
mode=runs,char_skip=25/guesstrain-00003-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5a7c7ced3ae81494afbd42c29ec6da038a854b64d3b7f1cd03017bb4164162e8
|
3 |
+
size 29750890
|
mode=runs,char_skip=25/guesstrain-00004-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:70d7aa5fe388f435df5e9c7a7b953191d32163c9d6a9f5d0dff18f459257870f
|
3 |
+
size 29755602
|
mode=runs,char_skip=25/guesstrain-00005-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dc3a581d2d6cccf698c7d0ebc0c3a6309ae576ff4994199ad62702e64be517d3
|
3 |
+
size 30705912
|
mode=runs,char_skip=25/guesstrain-00006-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:650f0a76228d133b6e55c5d6520122ea973148d6b390ec3b33c0cc4a30dbc0fb
|
3 |
+
size 31883444
|
mode=runs,char_skip=25/guesstrain-00007-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3dac50bdba1169ef9fe895f1fd179b2cb6ad1261080a55fbf079de0418df4c22
|
3 |
+
size 31271517
|
mode=sentences,char_skip=25/adversarial-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9ef4799197f4831a13a93150ad18827d24f3a2a9ca6404395c4ba52dcb530fed
|
3 |
+
size 1256948
|
mode=sentences,char_skip=25/buzzdev-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:63408e5b5864704bc4f5e24b63ed5c30e83e7f48e61279965c83e7610dc21a93
|
3 |
+
size 1685836
|
mode=sentences,char_skip=25/buzztest-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4da0c2ef47a9738fe7540f1d1fda278aeb8b963d3444db9865a3545e9a217598
|
3 |
+
size 2851362
|
mode=sentences,char_skip=25/buzztrain-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cd2b7d1f4039739e42a807ee79a36ba48ede9537a53b0dd6ccf322b3a75fb952
|
3 |
+
size 19969743
|
mode=sentences,char_skip=25/guessdev-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:990ab0efa8b134b327d17a01f52d683ca9aa257859c98498a5e76c4fe9ff4128
|
3 |
+
size 1525236
|
mode=sentences,char_skip=25/guesstest-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2ccecb889631a07b484b06282301facc4ae846e9d23b7e8fbae588e5e43298c0
|
3 |
+
size 3261298
|
mode=sentences,char_skip=25/guesstrain-00000-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fbb99933df3ffed10063cf18570d992d81057894039b997bf19589439ad8ca9f
|
3 |
+
size 61438112
|
mode=sentences,char_skip=25/guesstrain-00001-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:81c92c592bb29ee25a491359f41004633ac7d39c30f476e00144bfd1ca78792f
|
3 |
+
size 58615501
|
qanta.py
DELETED
@@ -1,289 +0,0 @@
|
|
1 |
-
"""qanta dataset."""
|
2 |
-
|
3 |
-
|
4 |
-
import json
|
5 |
-
from typing import List, Tuple
|
6 |
-
|
7 |
-
import datasets
|
8 |
-
|
9 |
-
|
10 |
-
_CITATION = """
|
11 |
-
@article{Rodriguez2019QuizbowlTC,
|
12 |
-
title={Quizbowl: The Case for Incremental Question Answering},
|
13 |
-
author={Pedro Rodriguez and Shi Feng and Mohit Iyyer and He He and Jordan L. Boyd-Graber},
|
14 |
-
journal={ArXiv},
|
15 |
-
year={2019},
|
16 |
-
volume={abs/1904.04792}
|
17 |
-
}
|
18 |
-
"""
|
19 |
-
|
20 |
-
_DESCRIPTION = """
|
21 |
-
The Qanta dataset is a question answering dataset based on the academic trivia game Quizbowl.
|
22 |
-
"""
|
23 |
-
|
24 |
-
|
25 |
-
_QANTA_URL = "https://s3-us-west-2.amazonaws.com/pinafore-us-west-2/qanta-jmlr-datasets/qanta.mapped.2018.04.18.json"
|
26 |
-
_TRICK_URL = "https://s3-us-west-2.amazonaws.com/pinafore-us-west-2/trick-tacl-datasets/qanta.tacl-trick.json"
|
27 |
-
_VERSION = datasets.Version("2018.04.18")
|
28 |
-
_FIRST = "first"
|
29 |
-
_FULL = "full"
|
30 |
-
_SENTENCES = "sentences"
|
31 |
-
_RUNS = "runs"
|
32 |
-
# Order matters, the first one is default
|
33 |
-
_MODES = [_FULL, _FIRST, _SENTENCES, _RUNS]
|
34 |
-
_DEFAULT_CHAR_SKIP = 25
|
35 |
-
|
36 |
-
|
37 |
-
class QantaConfig(datasets.BuilderConfig):
|
38 |
-
"""BuilderConfig for Qanta."""
|
39 |
-
|
40 |
-
def __init__(self, mode: str, char_skip: int, **kwargs):
|
41 |
-
super(QantaConfig, self).__init__(version=_VERSION, **kwargs)
|
42 |
-
self.mode = mode
|
43 |
-
self.char_skip = char_skip
|
44 |
-
|
45 |
-
|
46 |
-
def create_char_runs(text: str, char_skip: int) -> List[Tuple[str, int]]:
|
47 |
-
"""
|
48 |
-
Returns runs of the question based on skipping char_skip characters at a time. Also returns the indices used
|
49 |
-
q: name this first united states president.
|
50 |
-
runs with char_skip=10:
|
51 |
-
['name this ',
|
52 |
-
'name this first unit',
|
53 |
-
'name this first united state p',
|
54 |
-
'name this first united state president.']
|
55 |
-
:param char_skip: Number of characters to skip each time
|
56 |
-
"""
|
57 |
-
char_indices = list(range(char_skip, len(text) + char_skip, char_skip))
|
58 |
-
return [(text[:idx], idx) for idx in char_indices]
|
59 |
-
|
60 |
-
|
61 |
-
def with_default(key, lookup, default):
|
62 |
-
if key in lookup:
|
63 |
-
value = lookup[key]
|
64 |
-
if value is None:
|
65 |
-
return default
|
66 |
-
else:
|
67 |
-
return value
|
68 |
-
else:
|
69 |
-
return default
|
70 |
-
|
71 |
-
|
72 |
-
def question_to_examples(question, mode: str, char_skip: int):
|
73 |
-
features = {
|
74 |
-
"qanta_id": question["qanta_id"],
|
75 |
-
"proto_id": with_default("proto_id", question, ""),
|
76 |
-
"qdb_id": with_default("qdb_id", question, -1),
|
77 |
-
# We refer to the actual answer as page, but this
|
78 |
-
# may be misleading externally, so rename here to
|
79 |
-
# be clearer
|
80 |
-
"page": question["page"],
|
81 |
-
"answer": question["page"],
|
82 |
-
"raw_answer": question["answer"],
|
83 |
-
"dataset": with_default("dataset", question, ""),
|
84 |
-
"full_question": question["text"],
|
85 |
-
"first_sentence": question["first_sentence"],
|
86 |
-
"tokenizations": question["tokenizations"],
|
87 |
-
"fold": question["fold"],
|
88 |
-
"gameplay": question["gameplay"],
|
89 |
-
"category": with_default("category", question, ""),
|
90 |
-
"subcategory": with_default("subcategory", question, ""),
|
91 |
-
"tournament": question["tournament"],
|
92 |
-
"difficulty": with_default("difficulty", question, ""),
|
93 |
-
"year": question["year"],
|
94 |
-
"char_idx": -1,
|
95 |
-
"sentence_idx": -1,
|
96 |
-
}
|
97 |
-
if mode == _FULL:
|
98 |
-
yield {
|
99 |
-
"text": question["text"],
|
100 |
-
"id": str(question["qanta_id"]) + "-full",
|
101 |
-
**features,
|
102 |
-
}
|
103 |
-
elif mode == _FIRST:
|
104 |
-
yield {
|
105 |
-
"text": question["first_sentence"],
|
106 |
-
"id": str(question["qanta_id"]) + "-first",
|
107 |
-
**features,
|
108 |
-
}
|
109 |
-
elif mode == _RUNS:
|
110 |
-
text = question["text"]
|
111 |
-
for text_run, char_idx in create_char_runs(text, char_skip):
|
112 |
-
yield {
|
113 |
-
"text": text_run,
|
114 |
-
"char_idx": char_idx,
|
115 |
-
"id": str(question["qanta_id"]) + "-char-" + str(char_idx),
|
116 |
-
**features,
|
117 |
-
}
|
118 |
-
elif mode == _SENTENCES:
|
119 |
-
for sentence_idx, (start, end) in enumerate(question["tokenizations"]):
|
120 |
-
sentence = question["text"][start:end]
|
121 |
-
yield {
|
122 |
-
"text": sentence,
|
123 |
-
"sentence_idx": sentence_idx,
|
124 |
-
"id": str(question["qanta_id"]) + "-sentence-" + str(sentence_idx),
|
125 |
-
**features,
|
126 |
-
}
|
127 |
-
else:
|
128 |
-
raise ValueError(f"Invalid mode: {mode}")
|
129 |
-
|
130 |
-
|
131 |
-
_FEATURES = {
|
132 |
-
# Generated ID based modes set, unique
|
133 |
-
"id": datasets.Value("string"),
|
134 |
-
# Dataset defined IDs
|
135 |
-
"qanta_id": datasets.Value("int32"),
|
136 |
-
"proto_id": datasets.Value("string"),
|
137 |
-
"qdb_id": datasets.Value("int32"),
|
138 |
-
"dataset": datasets.Value("string"),
|
139 |
-
# Inputs
|
140 |
-
"text": datasets.Value("string"),
|
141 |
-
"full_question": datasets.Value("string"),
|
142 |
-
"first_sentence": datasets.Value("string"),
|
143 |
-
"char_idx": datasets.Value("int32"),
|
144 |
-
"sentence_idx": datasets.Value("int32"),
|
145 |
-
# Character indices of sentences: List[Tuple[int, int]]
|
146 |
-
"tokenizations": datasets.features.Sequence(datasets.features.Sequence(datasets.Value("int32"), length=2)),
|
147 |
-
# Labels: Number is equal to number of unique pages across all folds
|
148 |
-
"answer": datasets.Value("string"),
|
149 |
-
"page": datasets.Value("string"),
|
150 |
-
"raw_answer": datasets.Value("string"),
|
151 |
-
# Meta Information
|
152 |
-
"fold": datasets.Value("string"),
|
153 |
-
"gameplay": datasets.Value("bool"),
|
154 |
-
"category": datasets.Value("string"),
|
155 |
-
"subcategory": datasets.Value("string"),
|
156 |
-
"tournament": datasets.Value("string"),
|
157 |
-
"difficulty": datasets.Value("string"),
|
158 |
-
"year": datasets.Value("int32"),
|
159 |
-
}
|
160 |
-
|
161 |
-
|
162 |
-
class Qanta(datasets.GeneratorBasedBuilder):
|
163 |
-
"""The Qanta dataset is a question answering dataset based on the academic trivia game Quizbowl."""
|
164 |
-
|
165 |
-
VERSION = _VERSION
|
166 |
-
BUILDER_CONFIGS = [
|
167 |
-
QantaConfig(
|
168 |
-
name=f"mode={mode},char_skip={_DEFAULT_CHAR_SKIP}",
|
169 |
-
description=f"Question format: {mode}, char_skip: {_DEFAULT_CHAR_SKIP}",
|
170 |
-
mode=mode,
|
171 |
-
char_skip=_DEFAULT_CHAR_SKIP,
|
172 |
-
)
|
173 |
-
for mode in _MODES
|
174 |
-
]
|
175 |
-
|
176 |
-
def _info(self):
|
177 |
-
return datasets.DatasetInfo(
|
178 |
-
# This is the description that will appear on the datasets page.
|
179 |
-
description=_DESCRIPTION,
|
180 |
-
# datasets.features.FeatureConnectors
|
181 |
-
features=datasets.Features(_FEATURES),
|
182 |
-
# Number of classes is a function of the dataset, ClassLabel doesn't support dynamic
|
183 |
-
# definition, so have to defer conversion to classes to later, so can't define
|
184 |
-
# supervied keys
|
185 |
-
supervised_keys=None,
|
186 |
-
# Homepage of the dataset for documentation
|
187 |
-
homepage="http://www.qanta.org/",
|
188 |
-
citation=_CITATION,
|
189 |
-
)
|
190 |
-
|
191 |
-
def _split_generators(self, dl_manager):
|
192 |
-
"""Returns SplitGenerators."""
|
193 |
-
qanta_path = dl_manager.download_and_extract(_QANTA_URL)
|
194 |
-
trick_path = dl_manager.download_and_extract(_TRICK_URL)
|
195 |
-
return [
|
196 |
-
datasets.SplitGenerator(
|
197 |
-
name=datasets.Split("guesstrain"),
|
198 |
-
gen_kwargs={
|
199 |
-
"qanta_filepath": qanta_path,
|
200 |
-
"trick_filepath": trick_path,
|
201 |
-
"fold": "guesstrain",
|
202 |
-
"mode": self.config.mode,
|
203 |
-
"char_skip": self.config.char_skip,
|
204 |
-
},
|
205 |
-
),
|
206 |
-
datasets.SplitGenerator(
|
207 |
-
name=datasets.Split("buzztrain"),
|
208 |
-
gen_kwargs={
|
209 |
-
"qanta_filepath": qanta_path,
|
210 |
-
"trick_filepath": trick_path,
|
211 |
-
"fold": "buzztrain",
|
212 |
-
"mode": self.config.mode,
|
213 |
-
"char_skip": self.config.char_skip,
|
214 |
-
},
|
215 |
-
),
|
216 |
-
datasets.SplitGenerator(
|
217 |
-
name=datasets.Split("guessdev"),
|
218 |
-
gen_kwargs={
|
219 |
-
"qanta_filepath": qanta_path,
|
220 |
-
"trick_filepath": trick_path,
|
221 |
-
"fold": "guessdev",
|
222 |
-
"mode": self.config.mode,
|
223 |
-
"char_skip": self.config.char_skip,
|
224 |
-
},
|
225 |
-
),
|
226 |
-
datasets.SplitGenerator(
|
227 |
-
name=datasets.Split("buzzdev"),
|
228 |
-
gen_kwargs={
|
229 |
-
"qanta_filepath": qanta_path,
|
230 |
-
"trick_filepath": trick_path,
|
231 |
-
"fold": "buzzdev",
|
232 |
-
"mode": self.config.mode,
|
233 |
-
"char_skip": self.config.char_skip,
|
234 |
-
},
|
235 |
-
),
|
236 |
-
datasets.SplitGenerator(
|
237 |
-
name=datasets.Split("guesstest"),
|
238 |
-
gen_kwargs={
|
239 |
-
"qanta_filepath": qanta_path,
|
240 |
-
"trick_filepath": trick_path,
|
241 |
-
"fold": "guesstest",
|
242 |
-
"mode": self.config.mode,
|
243 |
-
"char_skip": self.config.char_skip,
|
244 |
-
},
|
245 |
-
),
|
246 |
-
datasets.SplitGenerator(
|
247 |
-
name=datasets.Split("buzztest"),
|
248 |
-
gen_kwargs={
|
249 |
-
"qanta_filepath": qanta_path,
|
250 |
-
"trick_filepath": trick_path,
|
251 |
-
"fold": "buzztest",
|
252 |
-
"mode": self.config.mode,
|
253 |
-
"char_skip": self.config.char_skip,
|
254 |
-
},
|
255 |
-
),
|
256 |
-
datasets.SplitGenerator(
|
257 |
-
name=datasets.Split("adversarial"),
|
258 |
-
gen_kwargs={
|
259 |
-
"qanta_filepath": qanta_path,
|
260 |
-
"trick_filepath": trick_path,
|
261 |
-
"fold": "adversarial",
|
262 |
-
"mode": self.config.mode,
|
263 |
-
"char_skip": self.config.char_skip,
|
264 |
-
},
|
265 |
-
),
|
266 |
-
]
|
267 |
-
|
268 |
-
def _generate_examples(
|
269 |
-
self,
|
270 |
-
qanta_filepath: str,
|
271 |
-
trick_filepath: str,
|
272 |
-
fold: str,
|
273 |
-
mode: str,
|
274 |
-
char_skip: int,
|
275 |
-
):
|
276 |
-
"""Yields examples."""
|
277 |
-
if mode not in _MODES:
|
278 |
-
raise ValueError(f"Invalid mode: {mode}")
|
279 |
-
|
280 |
-
if fold == "adversarial":
|
281 |
-
path = trick_filepath
|
282 |
-
else:
|
283 |
-
path = qanta_filepath
|
284 |
-
with open(path, encoding="utf-8") as f:
|
285 |
-
questions = json.load(f)["questions"]
|
286 |
-
for q in questions:
|
287 |
-
if q["page"] is not None and q["fold"] == fold:
|
288 |
-
for example in question_to_examples(q, mode, char_skip):
|
289 |
-
yield example["id"], example
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|