parquet-converter
commited on
Commit
•
832562c
1
Parent(s):
9c95546
Update parquet files
Browse files- .gitattributes +0 -27
- README.md +0 -286
- dataset_infos.json +0 -1
- mode=first,char_skip=25/qanta-adversarial.parquet +3 -0
- mode=first,char_skip=25/qanta-buzzdev.parquet +3 -0
- mode=first,char_skip=25/qanta-buzztest.parquet +3 -0
- mode=first,char_skip=25/qanta-buzztrain.parquet +3 -0
- mode=first,char_skip=25/qanta-guessdev.parquet +3 -0
- mode=first,char_skip=25/qanta-guesstest.parquet +3 -0
- mode=first,char_skip=25/qanta-guesstrain.parquet +3 -0
- mode=full,char_skip=25/qanta-adversarial.parquet +3 -0
- mode=full,char_skip=25/qanta-buzzdev.parquet +3 -0
- mode=full,char_skip=25/qanta-buzztest.parquet +3 -0
- mode=full,char_skip=25/qanta-buzztrain.parquet +3 -0
- mode=full,char_skip=25/qanta-guessdev.parquet +3 -0
- mode=full,char_skip=25/qanta-guesstest.parquet +3 -0
- mode=full,char_skip=25/qanta-guesstrain.parquet +3 -0
- mode=runs,char_skip=25/qanta-adversarial.parquet +3 -0
- mode=runs,char_skip=25/qanta-buzzdev.parquet +3 -0
- mode=runs,char_skip=25/qanta-buzztest.parquet +3 -0
- mode=runs,char_skip=25/qanta-buzztrain-00000-of-00002.parquet +3 -0
- mode=runs,char_skip=25/qanta-buzztrain-00001-of-00002.parquet +3 -0
- mode=runs,char_skip=25/qanta-guessdev.parquet +3 -0
- mode=runs,char_skip=25/qanta-guesstest.parquet +3 -0
- mode=runs,char_skip=25/qanta-guesstrain-00000-of-00008.parquet +3 -0
- mode=runs,char_skip=25/qanta-guesstrain-00001-of-00008.parquet +3 -0
- mode=runs,char_skip=25/qanta-guesstrain-00002-of-00008.parquet +3 -0
- mode=runs,char_skip=25/qanta-guesstrain-00003-of-00008.parquet +3 -0
- mode=runs,char_skip=25/qanta-guesstrain-00004-of-00008.parquet +3 -0
- mode=runs,char_skip=25/qanta-guesstrain-00005-of-00008.parquet +3 -0
- mode=runs,char_skip=25/qanta-guesstrain-00006-of-00008.parquet +3 -0
- mode=runs,char_skip=25/qanta-guesstrain-00007-of-00008.parquet +3 -0
- mode=sentences,char_skip=25/qanta-adversarial.parquet +3 -0
- mode=sentences,char_skip=25/qanta-buzzdev.parquet +3 -0
- mode=sentences,char_skip=25/qanta-buzztest.parquet +3 -0
- mode=sentences,char_skip=25/qanta-buzztrain.parquet +3 -0
- mode=sentences,char_skip=25/qanta-guessdev.parquet +3 -0
- mode=sentences,char_skip=25/qanta-guesstest.parquet +3 -0
- mode=sentences,char_skip=25/qanta-guesstrain-00000-of-00002.parquet +3 -0
- mode=sentences,char_skip=25/qanta-guesstrain-00001-of-00002.parquet +3 -0
- qanta.py +0 -289
.gitattributes
DELETED
@@ -1,27 +0,0 @@
|
|
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
DELETED
@@ -1,286 +0,0 @@
|
|
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:
|
16 |
-
- original
|
17 |
-
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
|
27 |
-
- name: qanta_id
|
28 |
-
dtype: int32
|
29 |
-
- name: proto_id
|
30 |
-
dtype: string
|
31 |
-
- name: qdb_id
|
32 |
-
dtype: int32
|
33 |
-
- name: dataset
|
34 |
-
dtype: string
|
35 |
-
- name: text
|
36 |
-
dtype: string
|
37 |
-
- name: full_question
|
38 |
-
dtype: string
|
39 |
-
- name: first_sentence
|
40 |
-
dtype: string
|
41 |
-
- name: char_idx
|
42 |
-
dtype: int32
|
43 |
-
- name: sentence_idx
|
44 |
-
dtype: int32
|
45 |
-
- name: tokenizations
|
46 |
-
sequence:
|
47 |
-
sequence: int32
|
48 |
-
length: 2
|
49 |
-
- name: answer
|
50 |
-
dtype: string
|
51 |
-
- name: page
|
52 |
-
dtype: string
|
53 |
-
- name: raw_answer
|
54 |
-
dtype: string
|
55 |
-
- name: fold
|
56 |
-
dtype: string
|
57 |
-
- name: gameplay
|
58 |
-
dtype: bool
|
59 |
-
- name: category
|
60 |
-
dtype: string
|
61 |
-
- name: subcategory
|
62 |
-
dtype: string
|
63 |
-
- name: tournament
|
64 |
-
dtype: string
|
65 |
-
- name: difficulty
|
66 |
-
dtype: string
|
67 |
-
- name: year
|
68 |
-
dtype: int32
|
69 |
-
config_name: mode=first,char_skip=25
|
70 |
-
splits:
|
71 |
-
- name: adversarial
|
72 |
-
num_bytes: 1258844
|
73 |
-
num_examples: 1145
|
74 |
-
- name: buzzdev
|
75 |
-
num_bytes: 1553636
|
76 |
-
num_examples: 1161
|
77 |
-
- name: buzztest
|
78 |
-
num_bytes: 2653425
|
79 |
-
num_examples: 1953
|
80 |
-
- name: buzztrain
|
81 |
-
num_bytes: 19699736
|
82 |
-
num_examples: 16706
|
83 |
-
- name: guessdev
|
84 |
-
num_bytes: 1414882
|
85 |
-
num_examples: 1055
|
86 |
-
- name: guesstest
|
87 |
-
num_bytes: 2997123
|
88 |
-
num_examples: 2151
|
89 |
-
- name: guesstrain
|
90 |
-
num_bytes: 117599750
|
91 |
-
num_examples: 96221
|
92 |
-
download_size: 170754918
|
93 |
-
dataset_size: 147177396
|
94 |
-
---
|
95 |
-
|
96 |
-
# Dataset Card for "qanta"
|
97 |
-
|
98 |
-
## Table of Contents
|
99 |
-
- [Dataset Description](#dataset-description)
|
100 |
-
- [Dataset Summary](#dataset-summary)
|
101 |
-
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
102 |
-
- [Languages](#languages)
|
103 |
-
- [Dataset Structure](#dataset-structure)
|
104 |
-
- [Data Instances](#data-instances)
|
105 |
-
- [Data Fields](#data-fields)
|
106 |
-
- [Data Splits](#data-splits)
|
107 |
-
- [Dataset Creation](#dataset-creation)
|
108 |
-
- [Curation Rationale](#curation-rationale)
|
109 |
-
- [Source Data](#source-data)
|
110 |
-
- [Annotations](#annotations)
|
111 |
-
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
112 |
-
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
113 |
-
- [Social Impact of Dataset](#social-impact-of-dataset)
|
114 |
-
- [Discussion of Biases](#discussion-of-biases)
|
115 |
-
- [Other Known Limitations](#other-known-limitations)
|
116 |
-
- [Additional Information](#additional-information)
|
117 |
-
- [Dataset Curators](#dataset-curators)
|
118 |
-
- [Licensing Information](#licensing-information)
|
119 |
-
- [Citation Information](#citation-information)
|
120 |
-
- [Contributions](#contributions)
|
121 |
-
|
122 |
-
## Dataset Description
|
123 |
-
|
124 |
-
- **Homepage:** [http://www.qanta.org/](http://www.qanta.org/)
|
125 |
-
- **Repository:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
126 |
-
- **Paper:** [Quizbowl: The Case for Incremental Question Answering](https://arxiv.org/abs/1904.04792)
|
127 |
-
- **Point of Contact:** [Jordan Boyd-Graber](mailto:jbg@umiacs.umd.edu)
|
128 |
-
- **Size of downloaded dataset files:** 162.84 MB
|
129 |
-
- **Size of the generated dataset:** 140.36 MB
|
130 |
-
- **Total amount of disk used:** 303.20 MB
|
131 |
-
|
132 |
-
### Dataset Summary
|
133 |
-
|
134 |
-
The Qanta dataset is a question answering dataset based on the academic trivia game Quizbowl.
|
135 |
-
|
136 |
-
### Supported Tasks and Leaderboards
|
137 |
-
|
138 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
139 |
-
|
140 |
-
### Languages
|
141 |
-
|
142 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
143 |
-
|
144 |
-
## Dataset Structure
|
145 |
-
|
146 |
-
### Data Instances
|
147 |
-
|
148 |
-
#### mode=first,char_skip=25
|
149 |
-
|
150 |
-
- **Size of downloaded dataset files:** 162.84 MB
|
151 |
-
- **Size of the generated dataset:** 140.36 MB
|
152 |
-
- **Total amount of disk used:** 303.20 MB
|
153 |
-
|
154 |
-
An example of 'guessdev' looks as follows.
|
155 |
-
```
|
156 |
-
This example was too long and was cropped:
|
157 |
-
|
158 |
-
{
|
159 |
-
"answer": "Apollo_program",
|
160 |
-
"category": "History",
|
161 |
-
"char_idx": -1,
|
162 |
-
"dataset": "quizdb.org",
|
163 |
-
"difficulty": "easy_college",
|
164 |
-
"first_sentence": "As part of this program, William Anders took a photo that Galen Rowell called \"the most influential environmental photograph ever taken.\"",
|
165 |
-
"fold": "guessdev",
|
166 |
-
"full_question": "\"As part of this program, William Anders took a photo that Galen Rowell called \\\"the most influential environmental photograph e...",
|
167 |
-
"gameplay": false,
|
168 |
-
"id": "127028-first",
|
169 |
-
"page": "Apollo_program",
|
170 |
-
"proto_id": "",
|
171 |
-
"qanta_id": 127028,
|
172 |
-
"qdb_id": 126689,
|
173 |
-
"raw_answer": "Apollo program [or Project Apollo; accept Apollo 8; accept Apollo 1; accept Apollo 11; prompt on landing on the moon]",
|
174 |
-
"sentence_idx": -1,
|
175 |
-
"subcategory": "American",
|
176 |
-
"text": "As part of this program, William Anders took a photo that Galen Rowell called \"the most influential environmental photograph ever taken.\"",
|
177 |
-
"tokenizations": [[0, 137], [138, 281], [282, 412], [413, 592], [593, 675]],
|
178 |
-
"tournament": "ACF Fall",
|
179 |
-
"year": 2016
|
180 |
-
}
|
181 |
-
```
|
182 |
-
|
183 |
-
### Data Fields
|
184 |
-
|
185 |
-
The data fields are the same among all splits.
|
186 |
-
|
187 |
-
#### mode=first,char_skip=25
|
188 |
-
- `id`: a `string` feature.
|
189 |
-
- `qanta_id`: a `int32` feature.
|
190 |
-
- `proto_id`: a `string` feature.
|
191 |
-
- `qdb_id`: a `int32` feature.
|
192 |
-
- `dataset`: a `string` feature.
|
193 |
-
- `text`: a `string` feature.
|
194 |
-
- `full_question`: a `string` feature.
|
195 |
-
- `first_sentence`: a `string` feature.
|
196 |
-
- `char_idx`: a `int32` feature.
|
197 |
-
- `sentence_idx`: a `int32` feature.
|
198 |
-
- `tokenizations`: a dictionary feature containing:
|
199 |
-
- `feature`: a `int32` feature.
|
200 |
-
- `answer`: a `string` feature.
|
201 |
-
- `page`: a `string` feature.
|
202 |
-
- `raw_answer`: a `string` feature.
|
203 |
-
- `fold`: a `string` feature.
|
204 |
-
- `gameplay`: a `bool` feature.
|
205 |
-
- `category`: a `string` feature.
|
206 |
-
- `subcategory`: a `string` feature.
|
207 |
-
- `tournament`: a `string` feature.
|
208 |
-
- `difficulty`: a `string` feature.
|
209 |
-
- `year`: a `int32` feature.
|
210 |
-
|
211 |
-
### Data Splits
|
212 |
-
|
213 |
-
| name |adversarial|buzzdev|buzztrain|guessdev|guesstrain|buzztest|guesstest|
|
214 |
-
|-----------------------|----------:|------:|--------:|-------:|---------:|-------:|--------:|
|
215 |
-
|mode=first,char_skip=25| 1145| 1161| 16706| 1055| 96221| 1953| 2151|
|
216 |
-
|
217 |
-
## Dataset Creation
|
218 |
-
|
219 |
-
### Curation Rationale
|
220 |
-
|
221 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
222 |
-
|
223 |
-
### Source Data
|
224 |
-
|
225 |
-
#### Initial Data Collection and Normalization
|
226 |
-
|
227 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
228 |
-
|
229 |
-
#### Who are the source language producers?
|
230 |
-
|
231 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
232 |
-
|
233 |
-
### Annotations
|
234 |
-
|
235 |
-
#### Annotation process
|
236 |
-
|
237 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
238 |
-
|
239 |
-
#### Who are the annotators?
|
240 |
-
|
241 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
242 |
-
|
243 |
-
### Personal and Sensitive Information
|
244 |
-
|
245 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
246 |
-
|
247 |
-
## Considerations for Using the Data
|
248 |
-
|
249 |
-
### Social Impact of Dataset
|
250 |
-
|
251 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
252 |
-
|
253 |
-
### Discussion of Biases
|
254 |
-
|
255 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
256 |
-
|
257 |
-
### Other Known Limitations
|
258 |
-
|
259 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
260 |
-
|
261 |
-
## Additional Information
|
262 |
-
|
263 |
-
### Dataset Curators
|
264 |
-
|
265 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
266 |
-
|
267 |
-
### Licensing Information
|
268 |
-
|
269 |
-
[More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
|
270 |
-
|
271 |
-
### Citation Information
|
272 |
-
|
273 |
-
```
|
274 |
-
@article{Rodriguez2019QuizbowlTC,
|
275 |
-
title={Quizbowl: The Case for Incremental Question Answering},
|
276 |
-
author={Pedro Rodriguez and Shi Feng and Mohit Iyyer and He He and Jordan L. Boyd-Graber},
|
277 |
-
journal={ArXiv},
|
278 |
-
year={2019},
|
279 |
-
volume={abs/1904.04792}
|
280 |
-
}
|
281 |
-
```
|
282 |
-
|
283 |
-
|
284 |
-
### Contributions
|
285 |
-
|
286 |
-
Thanks to [@thomwolf](https://github.com/thomwolf), [@patrickvonplaten](https://github.com/patrickvonplaten), [@lewtun](https://github.com/lewtun) for adding this dataset.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset_infos.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"mode=first,char_skip=25": {"description": "\nThe Qanta dataset is a question answering dataset based on the academic trivia game Quizbowl.\n", "citation": "\n@article{Rodriguez2019QuizbowlTC,\n title={Quizbowl: The Case for Incremental Question Answering},\n author={Pedro Rodriguez and Shi Feng and Mohit Iyyer and He He and Jordan L. Boyd-Graber},\n journal={ArXiv},\n year={2019},\n volume={abs/1904.04792}\n}\n", "homepage": "http://www.qanta.org/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "qanta_id": {"dtype": "int32", "id": null, "_type": "Value"}, "proto_id": {"dtype": "string", "id": null, "_type": "Value"}, "qdb_id": {"dtype": "int32", "id": null, "_type": "Value"}, "dataset": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "full_question": {"dtype": "string", "id": null, "_type": "Value"}, "first_sentence": {"dtype": "string", "id": null, "_type": "Value"}, "char_idx": {"dtype": "int32", "id": null, "_type": "Value"}, "sentence_idx": {"dtype": "int32", "id": null, "_type": "Value"}, "tokenizations": {"feature": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": 2, "id": null, "_type": "Sequence"}, "length": -1, "id": null, "_type": "Sequence"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "page": {"dtype": "string", "id": null, "_type": "Value"}, "raw_answer": {"dtype": "string", "id": null, "_type": "Value"}, "fold": {"dtype": "string", "id": null, "_type": "Value"}, "gameplay": {"dtype": "bool", "id": null, "_type": "Value"}, "category": {"dtype": "string", "id": null, "_type": "Value"}, "subcategory": {"dtype": "string", "id": null, "_type": "Value"}, "tournament": {"dtype": "string", "id": null, "_type": "Value"}, "difficulty": {"dtype": "string", "id": null, "_type": "Value"}, "year": {"dtype": "int32", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "qanta", "config_name": "mode=first,char_skip=25", "version": {"version_str": "2018.04.18", "description": null, "datasets_version_to_prepare": null, "major": 2018, "minor": 4, "patch": 18}, "splits": {"adversarial": {"name": "adversarial", "num_bytes": 1258844, "num_examples": 1145, "dataset_name": "qanta"}, "buzzdev": {"name": "buzzdev", "num_bytes": 1553636, "num_examples": 1161, "dataset_name": "qanta"}, "buzztest": {"name": "buzztest", "num_bytes": 2653425, "num_examples": 1953, "dataset_name": "qanta"}, "buzztrain": {"name": "buzztrain", "num_bytes": 19699736, "num_examples": 16706, "dataset_name": "qanta"}, "guessdev": {"name": "guessdev", "num_bytes": 1414882, "num_examples": 1055, "dataset_name": "qanta"}, "guesstest": {"name": "guesstest", "num_bytes": 2997123, "num_examples": 2151, "dataset_name": "qanta"}, "guesstrain": {"name": "guesstrain", "num_bytes": 117599750, "num_examples": 96221, "dataset_name": "qanta"}}, "download_checksums": {"https://s3-us-west-2.amazonaws.com/pinafore-us-west-2/qanta-jmlr-datasets/qanta.mapped.2018.04.18.json": {"num_bytes": 169001564, "checksum": "5f2f429724e13df1d4b216dba5549dac597fbaf884ed0c3e01f90ee72cb2753a"}, "https://s3-us-west-2.amazonaws.com/pinafore-us-west-2/trick-tacl-datasets/qanta.tacl-trick.json": {"num_bytes": 1753354, "checksum": "73535d6493d63bad48cd61031911faf77efb584976475185d8aca5a124d1822b"}}, "download_size": 170754918, "dataset_size": 147177396, "size_in_bytes": 317932314}}
|
|
|
|
mode=first,char_skip=25/qanta-adversarial.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8c2cef4e1b4cfaa97ebc485c26678c9b806bf2824c085d4f1e38103f89420dec
|
3 |
+
size 769983
|
mode=first,char_skip=25/qanta-buzzdev.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:211332eff68343138bab786c5844748789ca5be026d417af2a9d16477eb4d73d
|
3 |
+
size 980413
|
mode=first,char_skip=25/qanta-buzztest.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0d6f9c51bb7b5cb9cb74c079146444ebcabcfdb6e7e8dea28233d17a2fb5c0e5
|
3 |
+
size 1650460
|
mode=first,char_skip=25/qanta-buzztrain.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2010b27322651886f8ad7668487fe31d322759205c8e7695671ccf999ca0595b
|
3 |
+
size 12210699
|
mode=first,char_skip=25/qanta-guessdev.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf87644bf6a309839c38e603ff820a1a0319a9b0a8219bd66ae7f60a84de67e5
|
3 |
+
size 891084
|
mode=first,char_skip=25/qanta-guesstest.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f9411cd9af270efbf6824b2bcab9b7150ccc0b9610b1752a9b2a1d265a771d8a
|
3 |
+
size 1900961
|
mode=first,char_skip=25/qanta-guesstrain.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1a8eb1b800fcf5e455ae633662a7c4f2071940ab554e65c3468cb2f915d4b715
|
3 |
+
size 72434875
|
mode=full,char_skip=25/qanta-adversarial.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:eb21effa79e61010c5ecafc3ad635d81a0e508d4943b0cc4c9b39ec0637daa5f
|
3 |
+
size 1116322
|
mode=full,char_skip=25/qanta-buzzdev.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b3f4972d14d93a6d17be639fdb7df1dc160c5d6a6037f9a298629b790ca972a8
|
3 |
+
size 1472272
|
mode=full,char_skip=25/qanta-buzztest.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f6a5614f77a57571bf0741cf7d51c48ac0efcb025bc5deeb213c56c9776f9360
|
3 |
+
size 2485324
|
mode=full,char_skip=25/qanta-buzztrain.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:52b5353c850ac91615d8fd65f48753551469b96451920520dc457a70a7145c1a
|
3 |
+
size 17675965
|
mode=full,char_skip=25/qanta-guessdev.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e664f7353e9760c44841c1e841741544c0af838aa0f43cd042a3e351d179c252
|
3 |
+
size 1341948
|
mode=full,char_skip=25/qanta-guesstest.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf82b1b70c2f8cac586d3a20a3ee596df4ad83f02b546bc3cc7bb5de42254dd1
|
3 |
+
size 2858113
|
mode=full,char_skip=25/qanta-guesstrain.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dfe0aae4d9b3d69bec20ee35187ee56394f0a0080023b8000ace499b0e51a08b
|
3 |
+
size 106054262
|
mode=runs,char_skip=25/qanta-adversarial.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b4bd1bbe80f87c573736c462504e91126c7dbdce7a7e1ab6a0d46c4ebf823e14
|
3 |
+
size 2483120
|
mode=runs,char_skip=25/qanta-buzzdev.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9f79685b888f5c76d3f52019830e9788604099829624c0231a2cfadecc66fb3a
|
3 |
+
size 3537790
|
mode=runs,char_skip=25/qanta-buzztest.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ce35f5c0c926f698bf79f8669588dbcab4b0f4241cd7d852ebeb766847c8fe94
|
3 |
+
size 6090705
|
mode=runs,char_skip=25/qanta-buzztrain-00000-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2cf2f8469ae299154a711fcb6ad1b46d945dd3cbd58e4c7d4ef493bbf9f8ba90
|
3 |
+
size 31595167
|
mode=runs,char_skip=25/qanta-buzztrain-00001-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6be62bc8214145dd3b0d7c115e95091b4d3208ffae3972a313e4af80bccb5ce2
|
3 |
+
size 7876724
|
mode=runs,char_skip=25/qanta-guessdev.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9a4166c5e2da5212786b9c3b7118bb9b9a4f1fd37bf8813a163245356268f03d
|
3 |
+
size 3229316
|
mode=runs,char_skip=25/qanta-guesstest.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4877fa5de46ef55ed13fc9781ed6977d6a8b084b7eacd25e9047e6ef89b50e5f
|
3 |
+
size 6921607
|
mode=runs,char_skip=25/qanta-guesstrain-00000-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:12502fc23dca9ef94c78c9c9bb25a13f505ed5452a2b42ce06b0e8865714e9d7
|
3 |
+
size 32126655
|
mode=runs,char_skip=25/qanta-guesstrain-00001-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d35f7e2963e731741358fc51ee251a5a84b624c5e0d70ff4f5242cea81baf99b
|
3 |
+
size 30525861
|
mode=runs,char_skip=25/qanta-guesstrain-00002-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:55d83658c381e254a42a301c0510182dfc8e5c58f975743f9874af5db83dfb7a
|
3 |
+
size 30236192
|
mode=runs,char_skip=25/qanta-guesstrain-00003-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d143965c400d788ec0d3c1126ea360abdcf4853af04b29deb4ce1fa58bb1b76b
|
3 |
+
size 32309575
|
mode=runs,char_skip=25/qanta-guesstrain-00004-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:28723ab02a4fd1b52340daadb8cc730d5d54817cedb719389e159769a7c63f6f
|
3 |
+
size 31991111
|
mode=runs,char_skip=25/qanta-guesstrain-00005-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9bd5925ded3f9740f8460b2f2c1d6140c7d95eb66e7562a41510e390f283dec5
|
3 |
+
size 29938727
|
mode=runs,char_skip=25/qanta-guesstrain-00006-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6db121f4d37a8aad29391566f6782d09d2ae24bc1dbf255fbfa7e16f80730681
|
3 |
+
size 28757502
|
mode=runs,char_skip=25/qanta-guesstrain-00007-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e66ee645648550212732823624d1867f6352906ab997ba497fda0af6a94df313
|
3 |
+
size 28426157
|
mode=sentences,char_skip=25/qanta-adversarial.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5452526498893871df501fed201b96b5842ec80a5fd9fd88d1fd436726d008c4
|
3 |
+
size 1256867
|
mode=sentences,char_skip=25/qanta-buzzdev.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1ad2e377afe2f6c1a54ce42f7d568c00e7e08423f521d7cda6c3614236be0221
|
3 |
+
size 1685733
|
mode=sentences,char_skip=25/qanta-buzztest.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:675f36bf0fcd36aa48f49f8e0aeef562692fb079f0b530a84e272bff6ba98e61
|
3 |
+
size 2851199
|
mode=sentences,char_skip=25/qanta-buzztrain.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:194e658e1829d6569d3832bf4b3f9b6b0d5c92863f8a622eb446a977d1a1345e
|
3 |
+
size 19968740
|
mode=sentences,char_skip=25/qanta-guessdev.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ffbb8fb98c56fa53020d920ffc33a709e71b713170f0c95f206db681e4085897
|
3 |
+
size 1525145
|
mode=sentences,char_skip=25/qanta-guesstest.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:da1560b4d25ec44bf529305977b40212733ff4515c1fc49aa767278075b30e7c
|
3 |
+
size 3261111
|
mode=sentences,char_skip=25/qanta-guesstrain-00000-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:69ab8dd3b31a96f6d93831b3c6510f434140ecc27eb6df46f05dda7fd9f16a17
|
3 |
+
size 97521056
|
mode=sentences,char_skip=25/qanta-guesstrain-00001-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0149bae7fdd503893f224c9df89361a17435125244b787acb6078e479d6e77ac
|
3 |
+
size 22510454
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|