Datasets:
GEM
/

Tasks:
Other
Modalities:
Text
Languages:
English
ArXiv:
Libraries:
Datasets
License:
parquet-converter commited on
Commit
ec58b4b
1 Parent(s): 6719980

Update parquet files

Browse files
.gitattributes DELETED
@@ -1,28 +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
28
- *.json filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
GEM_Challenge_Set_Creation.ipynb DELETED
The diff for this file is too large to render. See raw diff
 
README.md DELETED
@@ -1,596 +0,0 @@
1
- ---
2
- annotations_creators:
3
- - crowd-sourced
4
- language_creators:
5
- - unknown
6
- language:
7
- - en
8
- license:
9
- - cc-by-sa-4.0
10
- multilinguality:
11
- - unknown
12
- size_categories:
13
- - unknown
14
- source_datasets:
15
- - original
16
- task_categories:
17
- - other
18
- task_ids: []
19
- pretty_name: squad_v2
20
- tags:
21
- - question-generation
22
- ---
23
-
24
- # Dataset Card for GEM/squad_v2
25
-
26
- ## Dataset Description
27
-
28
- - **Homepage:** https://rajpurkar.github.io/SQuAD-explorer/
29
- - **Repository:** https://rajpurkar.github.io/SQuAD-explorer/
30
- - **Paper:** https://arxiv.org/abs/1806.03822v1
31
- - **Leaderboard:** https://rajpurkar.github.io/SQuAD-explorer/
32
- - **Point of Contact:** Robin Jia
33
-
34
- ### Link to Main Data Card
35
-
36
- You can find the main data card on the [GEM Website](https://gem-benchmark.com/data_cards/squad_v2).
37
-
38
- ### Dataset Summary
39
-
40
- SQuAD2.0 is a dataset that tests the ability of a system to not only answer reading comprehension questions, but also abstain when presented with a question that cannot be answered based on the provided paragraph. F1 score is used to evaluate models on the leaderboard. In GEM, we are using this dataset for the question-generation task in which a model should generate squad-like questions from an input text.
41
-
42
- You can load the dataset via:
43
- ```
44
- import datasets
45
- data = datasets.load_dataset('GEM/squad_v2')
46
- ```
47
- The data loader can be found [here](https://huggingface.co/datasets/GEM/squad_v2).
48
-
49
- #### website
50
- [Website](https://rajpurkar.github.io/SQuAD-explorer/)
51
-
52
- #### paper
53
- [Arxiv](https://arxiv.org/abs/1806.03822v1)
54
-
55
- #### authors
56
- Pranav Rajpurkar, Robin Jia and Percy Liang
57
-
58
- ## Dataset Overview
59
-
60
- ### Where to find the Data and its Documentation
61
-
62
- #### Webpage
63
-
64
- <!-- info: What is the webpage for the dataset (if it exists)? -->
65
- <!-- scope: telescope -->
66
- [Website](https://rajpurkar.github.io/SQuAD-explorer/)
67
-
68
- #### Download
69
-
70
- <!-- info: What is the link to where the original dataset is hosted? -->
71
- <!-- scope: telescope -->
72
- [Website](https://rajpurkar.github.io/SQuAD-explorer/)
73
-
74
- #### Paper
75
-
76
- <!-- info: What is the link to the paper describing the dataset (open access preferred)? -->
77
- <!-- scope: telescope -->
78
- [Arxiv](https://arxiv.org/abs/1806.03822v1)
79
-
80
- #### BibTex
81
-
82
- <!-- info: Provide the BibTex-formatted reference for the dataset. Please use the correct published version (ACL anthology, etc.) instead of google scholar created Bibtex. -->
83
- <!-- scope: microscope -->
84
- ```
85
- @inproceedings{Rajpurkar2018KnowWY,
86
- title={Know What You Don’t Know: Unanswerable Questions for SQuAD},
87
- author={Pranav Rajpurkar and Robin Jia and Percy Liang},
88
- booktitle={ACL},
89
- year={2018}
90
- }
91
- ```
92
-
93
- #### Contact Name
94
-
95
- <!-- quick -->
96
- <!-- info: If known, provide the name of at least one person the reader can contact for questions about the dataset. -->
97
- <!-- scope: periscope -->
98
- Robin Jia
99
-
100
- #### Contact Email
101
-
102
- <!-- info: If known, provide the email of at least one person the reader can contact for questions about the dataset. -->
103
- <!-- scope: periscope -->
104
- robinjia@stanford.edu
105
-
106
- #### Has a Leaderboard?
107
-
108
- <!-- info: Does the dataset have an active leaderboard? -->
109
- <!-- scope: telescope -->
110
- yes
111
-
112
- #### Leaderboard Link
113
-
114
- <!-- info: Provide a link to the leaderboard. -->
115
- <!-- scope: periscope -->
116
- [Website](https://rajpurkar.github.io/SQuAD-explorer/)
117
-
118
- #### Leaderboard Details
119
-
120
- <!-- info: Briefly describe how the leaderboard evaluates models. -->
121
- <!-- scope: microscope -->
122
- SQuAD2.0 tests the ability of a system to not only answer reading comprehension questions, but also abstain when presented with a question that cannot be answered based on the provided paragraph. F1 score is used to evaluate models on the leaderboard.
123
-
124
-
125
- ### Languages and Intended Use
126
-
127
- #### Multilingual?
128
-
129
- <!-- quick -->
130
- <!-- info: Is the dataset multilingual? -->
131
- <!-- scope: telescope -->
132
- no
133
-
134
- #### Covered Languages
135
-
136
- <!-- quick -->
137
- <!-- info: What languages/dialects are covered in the dataset? -->
138
- <!-- scope: telescope -->
139
- `English`
140
-
141
- #### License
142
-
143
- <!-- quick -->
144
- <!-- info: What is the license of the dataset? -->
145
- <!-- scope: telescope -->
146
- cc-by-sa-4.0: Creative Commons Attribution Share Alike 4.0 International
147
-
148
- #### Intended Use
149
-
150
- <!-- info: What is the intended use of the dataset? -->
151
- <!-- scope: microscope -->
152
- The idea behind SQuAD2.0 dataset is to make the models understand when a question cannot be answered given a context. This will help in building models such that they know what they don't know, and therefore make the models understand language at a deeper level. The tasks that can be supported by the dataset are machine reading comprehension, extractive QA, and question generation.
153
-
154
- #### Primary Task
155
-
156
- <!-- info: What primary task does the dataset support? -->
157
- <!-- scope: telescope -->
158
- Question Generation
159
-
160
- #### Communicative Goal
161
-
162
- <!-- quick -->
163
- <!-- info: Provide a short description of the communicative goal of a model trained for this task on this dataset. -->
164
- <!-- scope: periscope -->
165
- Given an input passage and an answer span, the goal is to generate a question that asks for the answer.
166
-
167
-
168
- ### Credit
169
-
170
- #### Curation Organization Type(s)
171
-
172
- <!-- info: In what kind of organization did the dataset curation happen? -->
173
- <!-- scope: telescope -->
174
- `academic`
175
-
176
- #### Curation Organization(s)
177
-
178
- <!-- info: Name the organization(s). -->
179
- <!-- scope: periscope -->
180
- Stanford University
181
-
182
- #### Dataset Creators
183
-
184
- <!-- info: Who created the original dataset? List the people involved in collecting the dataset and their affiliation(s). -->
185
- <!-- scope: microscope -->
186
- Pranav Rajpurkar, Robin Jia and Percy Liang
187
-
188
- #### Funding
189
-
190
- <!-- info: Who funded the data creation? -->
191
- <!-- scope: microscope -->
192
- Facebook and NSF Graduate Research Fellowship under Grant No. DGE-114747
193
-
194
- #### Who added the Dataset to GEM?
195
-
196
- <!-- info: Who contributed to the data card and adding the dataset to GEM? List the people+affiliations involved in creating this data card and who helped integrate this dataset into GEM. -->
197
- <!-- scope: microscope -->
198
- (Abinaya Mahendiran)[https://github.com/AbinayaM02], Manager Data Science, NEXT Labs,
199
-
200
-
201
- ### Dataset Structure
202
-
203
- #### Data Fields
204
-
205
- <!-- info: List and describe the fields present in the dataset. -->
206
- <!-- scope: telescope -->
207
- The data fields are the same among all splits.
208
-
209
- #### squad_v2
210
-
211
- - `id`: a `string` feature.
212
- - `gem_id`: a `string` feature.
213
- - `title`: a `string` feature.
214
- - `context`: a `string` feature.
215
- - `question`: a `string` feature.
216
- - `answers`: a dictionary feature containing:
217
- - `text`: a `string` feature.
218
- - `answer_start`: a `int32` feature.
219
-
220
- #### Example Instance
221
-
222
- <!-- info: Provide a JSON formatted example of a typical instance in the dataset. -->
223
- <!-- scope: periscope -->
224
- Here is an example of a validation data point. This example was too long and was cropped:
225
-
226
- ```
227
- {
228
- "gem_id": "gem-squad_v2-validation-1",
229
- "id": "56ddde6b9a695914005b9629",
230
- "answers": {
231
- "answer_start": [94, 87, 94, 94],
232
- "text": ["10th and 11th centuries", "in the 10th and 11th centuries", "10th and 11th centuries", "10th and 11th centuries"]
233
- },
234
- "context": "\"The Normans (Norman: Nourmands; French: Normands; Latin: Normanni) were the people who in the 10th and 11th centuries gave thei...",
235
- "question": "When were the Normans in Normandy?",
236
- "title": "Normans"
237
- }
238
- ```
239
-
240
- #### Data Splits
241
-
242
- <!-- info: Describe and name the splits in the dataset if there are more than one. -->
243
- <!-- scope: periscope -->
244
- The original SQuAD2.0 dataset has only training and dev (validation) splits. The train split is further divided into test split and added as part of the GEM datasets.
245
-
246
- | name | train | validation | test |
247
- | -------------- | --------: | -------------: | -------: |
248
- | squad_v2 | 90403 | 11873 | 39916 |
249
-
250
-
251
-
252
- ## Dataset in GEM
253
-
254
- ### Rationale for Inclusion in GEM
255
-
256
- #### Why is the Dataset in GEM?
257
-
258
- <!-- info: What does this dataset contribute toward better generation evaluation and why is it part of GEM? -->
259
- <!-- scope: microscope -->
260
- SQuAD2.0 will encourage the development of new reading comprehension models
261
- that know what they don’t know, and therefore understand language at a deeper level. It can also help in building better models for answer-aware question generation .
262
-
263
- #### Similar Datasets
264
-
265
- <!-- info: Do other datasets for the high level task exist? -->
266
- <!-- scope: telescope -->
267
- no
268
-
269
- #### Unique Language Coverage
270
-
271
- <!-- info: Does this dataset cover other languages than other datasets for the same task? -->
272
- <!-- scope: periscope -->
273
- yes
274
-
275
- #### Ability that the Dataset measures
276
-
277
- <!-- info: What aspect of model ability can be measured with this dataset? -->
278
- <!-- scope: periscope -->
279
- Reasoning capability
280
-
281
-
282
- ### GEM-Specific Curation
283
-
284
- #### Modificatied for GEM?
285
-
286
- <!-- info: Has the GEM version of the dataset been modified in any way (data, processing, splits) from the original curated data? -->
287
- <!-- scope: telescope -->
288
- yes
289
-
290
- #### GEM Modifications
291
-
292
- <!-- info: What changes have been made to he original dataset? -->
293
- <!-- scope: periscope -->
294
- `other`
295
-
296
- #### Additional Splits?
297
-
298
- <!-- info: Does GEM provide additional splits to the dataset? -->
299
- <!-- scope: telescope -->
300
- yes
301
-
302
- #### Split Information
303
-
304
- <!-- info: Describe how the new splits were created -->
305
- <!-- scope: periscope -->
306
- The train(80%) and validation(10%) split of SQuAD2.0 are made available to public whereas the test(10%) split is not available.
307
-
308
- As part of GEM, the train split, 80% of the original data is split into two train split (90%) and test split (remaining 10%). The idea is to provide all three splits for the users to use.
309
-
310
-
311
- ### Getting Started with the Task
312
-
313
-
314
-
315
-
316
- ## Previous Results
317
-
318
- ### Previous Results
319
-
320
- #### Measured Model Abilities
321
-
322
- <!-- info: What aspect of model ability can be measured with this dataset? -->
323
- <!-- scope: telescope -->
324
- Extractive QA, Question Generation
325
-
326
- #### Metrics
327
-
328
- <!-- info: What metrics are typically used for this task? -->
329
- <!-- scope: periscope -->
330
- `Other: Other Metrics`, `METEOR`, `ROUGE`, `BLEU`
331
-
332
- #### Other Metrics
333
-
334
- <!-- info: Definitions of other metrics -->
335
- <!-- scope: periscope -->
336
- - Extractive QA uses Exact Match and F1 Score
337
- - Question generation users METEOR, ROUGE-L, BLEU-4
338
-
339
- #### Previous results available?
340
-
341
- <!-- info: Are previous results available? -->
342
- <!-- scope: telescope -->
343
- yes
344
-
345
- #### Other Evaluation Approaches
346
-
347
- <!-- info: What evaluation approaches have others used? -->
348
- <!-- scope: periscope -->
349
- Question generation users METEOR, ROUGE-L, BLEU-4
350
-
351
- #### Relevant Previous Results
352
-
353
- <!-- info: What are the most relevant previous results for this task/dataset? -->
354
- <!-- scope: microscope -->
355
- @article{Dong2019UnifiedLM,
356
- title={Unified Language Model Pre-training for Natural Language Understanding and Generation},
357
- author={Li Dong and Nan Yang and Wenhui Wang and Furu Wei and Xiaodong Liu and Yu Wang and Jianfeng Gao and M. Zhou and Hsiao-Wuen Hon},
358
- journal={ArXiv},
359
- year={2019},
360
- volume={abs/1905.03197}
361
- }
362
-
363
-
364
-
365
- ## Dataset Curation
366
-
367
- ### Original Curation
368
-
369
- #### Original Curation Rationale
370
-
371
- <!-- info: Original curation rationale -->
372
- <!-- scope: telescope -->
373
- The dataset is curated in three stages:
374
- - Curating passages,
375
- - Crowdsourcing question-answers on those passages,
376
- - Obtaining additional answers
377
- As part of SQuAD1.1, 10000 high-quality articles from English Wikipedia is extracted using Project Nayuki’s Wikipedia’s internal PageRanks, from which 536 articles are sampled uniformly at random. From each of these articles, individual paragraphs are extracted, stripping away images, figures, tables, and discarding paragraphs shorter than 500 characters.
378
-
379
- SQuAD2.0 combines the 100,000 questions in SQuAD1.1 with over 50,000 unanswerable questions written adversarially by crowdworkers to look similar to answerable ones.
380
-
381
-
382
- #### Communicative Goal
383
-
384
- <!-- info: What was the communicative goal? -->
385
- <!-- scope: periscope -->
386
- To build systems that not only answer questions when possible, but also determine when no
387
- answer is supported by the paragraph and abstain from answering.
388
-
389
- #### Sourced from Different Sources
390
-
391
- <!-- info: Is the dataset aggregated from different data sources? -->
392
- <!-- scope: telescope -->
393
- yes
394
-
395
- #### Source Details
396
-
397
- <!-- info: List the sources (one per line) -->
398
- <!-- scope: periscope -->
399
- Wikipedia
400
-
401
-
402
- ### Language Data
403
-
404
- #### How was Language Data Obtained?
405
-
406
- <!-- info: How was the language data obtained? -->
407
- <!-- scope: telescope -->
408
- `Found`
409
-
410
- #### Where was it found?
411
-
412
- <!-- info: If found, where from? -->
413
- <!-- scope: telescope -->
414
- `Single website`
415
-
416
- #### Topics Covered
417
-
418
- <!-- info: Does the language in the dataset focus on specific topics? How would you describe them? -->
419
- <!-- scope: periscope -->
420
- The dataset contains 536 articles covering a wide range of topics, from musical celebrities to abstract concepts.
421
-
422
- #### Data Validation
423
-
424
- <!-- info: Was the text validated by a different worker or a data curator? -->
425
- <!-- scope: telescope -->
426
- validated by crowdworker
427
-
428
- #### Data Preprocessing
429
-
430
- <!-- info: How was the text data pre-processed? (Enter N/A if the text was not pre-processed) -->
431
- <!-- scope: microscope -->
432
- From the sampled articles from Wikipedia, individual paragraphs are extracted, stripping
433
- away images, figures, tables, and discarding paragraphs shorter than 500 characters and partitioned into training(80%), development set(10%) and test set(10%).
434
-
435
- #### Was Data Filtered?
436
-
437
- <!-- info: Were text instances selected or filtered? -->
438
- <!-- scope: telescope -->
439
- algorithmically
440
-
441
- #### Filter Criteria
442
-
443
- <!-- info: What were the selection criteria? -->
444
- <!-- scope: microscope -->
445
- To retrieve high-quality articles, Project Nayuki’s Wikipedia’s internal PageRanks was used to obtain the top 10000 articles of English Wikipedia, from which 536 articles are sampled uniformly at random.
446
-
447
-
448
- ### Structured Annotations
449
-
450
- #### Additional Annotations?
451
-
452
- <!-- quick -->
453
- <!-- info: Does the dataset have additional annotations for each instance? -->
454
- <!-- scope: telescope -->
455
- crowd-sourced
456
-
457
- #### Number of Raters
458
-
459
- <!-- info: What is the number of raters -->
460
- <!-- scope: telescope -->
461
- unknown
462
-
463
- #### Rater Qualifications
464
-
465
- <!-- info: Describe the qualifications required of an annotator. -->
466
- <!-- scope: periscope -->
467
- Crowdworkers from the United States or Canada with a 97% HIT acceptance rate, a minimum of 1000 HITs, were employed to create questions.
468
-
469
- #### Raters per Training Example
470
-
471
- <!-- info: How many annotators saw each training example? -->
472
- <!-- scope: periscope -->
473
- 0
474
-
475
- #### Raters per Test Example
476
-
477
- <!-- info: How many annotators saw each test example? -->
478
- <!-- scope: periscope -->
479
- 0
480
-
481
- #### Annotation Service?
482
-
483
- <!-- info: Was an annotation service used? -->
484
- <!-- scope: telescope -->
485
- yes
486
-
487
- #### Which Annotation Service
488
-
489
- <!-- info: Which annotation services were used? -->
490
- <!-- scope: periscope -->
491
- `other`, `Amazon Mechanical Turk`
492
-
493
- #### Annotation Values
494
-
495
- <!-- info: Purpose and values for each annotation -->
496
- <!-- scope: microscope -->
497
- For SQuAD 1.1 , crowdworkers were tasked with asking and answering up to 5 questions on the
498
- content of that paragraph. The questions had to be entered in a text field, and the answers had to be
499
- highlighted in the paragraph.
500
-
501
- For SQuAD2.0, each task consisted of an entire article from SQuAD 1.1. For each paragraph in the article, workers were asked to pose up to five questions that were impossible to answer
502
- based on the paragraph alone, while referencing entities in the paragraph and ensuring that a plausible answer is present.
503
-
504
- #### Any Quality Control?
505
-
506
- <!-- info: Quality control measures? -->
507
- <!-- scope: telescope -->
508
- validated by another rater
509
-
510
- #### Quality Control Details
511
-
512
- <!-- info: Describe the quality control measures that were taken. -->
513
- <!-- scope: microscope -->
514
- Questions from workers who wrote 25 or fewer questions on an article is removed; this filter
515
- helped remove noise from workers who had trouble understanding the task, and therefore quit before completing the whole article. This filter to both SQuAD2.0 and the existing answerable questions from SQuAD 1.1.
516
-
517
-
518
- ### Consent
519
-
520
- #### Any Consent Policy?
521
-
522
- <!-- info: Was there a consent policy involved when gathering the data? -->
523
- <!-- scope: telescope -->
524
- no
525
-
526
-
527
- ### Private Identifying Information (PII)
528
-
529
- #### Contains PII?
530
-
531
- <!-- quick -->
532
- <!-- info: Does the source language data likely contain Personal Identifying Information about the data creators or subjects? -->
533
- <!-- scope: telescope -->
534
- unlikely
535
-
536
- #### Any PII Identification?
537
-
538
- <!-- info: Did the curators use any automatic/manual method to identify PII in the dataset? -->
539
- <!-- scope: periscope -->
540
- no identification
541
-
542
-
543
- ### Maintenance
544
-
545
- #### Any Maintenance Plan?
546
-
547
- <!-- info: Does the original dataset have a maintenance plan? -->
548
- <!-- scope: telescope -->
549
- no
550
-
551
-
552
-
553
- ## Broader Social Context
554
-
555
- ### Previous Work on the Social Impact of the Dataset
556
-
557
- #### Usage of Models based on the Data
558
-
559
- <!-- info: Are you aware of cases where models trained on the task featured in this dataset ore related tasks have been used in automated systems? -->
560
- <!-- scope: telescope -->
561
- no
562
-
563
-
564
- ### Impact on Under-Served Communities
565
-
566
- #### Addresses needs of underserved Communities?
567
-
568
- <!-- info: Does this dataset address the needs of communities that are traditionally underserved in language technology, and particularly language generation technology? Communities may be underserved for exemple because their language, language variety, or social or geographical context is underepresented in NLP and NLG resources (datasets and models). -->
569
- <!-- scope: telescope -->
570
- no
571
-
572
-
573
- ### Discussion of Biases
574
-
575
- #### Any Documented Social Biases?
576
-
577
- <!-- info: Are there documented social biases in the dataset? Biases in this context are variations in the ways members of different social categories are represented that can have harmful downstream consequences for members of the more disadvantaged group. -->
578
- <!-- scope: telescope -->
579
- yes
580
-
581
-
582
-
583
- ## Considerations for Using the Data
584
-
585
- ### PII Risks and Liability
586
-
587
-
588
-
589
- ### Licenses
590
-
591
-
592
-
593
- ### Known Technical Limitations
594
-
595
-
596
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
challenge_sets/answerable_question_split/challenge_answer_filter_test.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:75bdf6da30547639f50f5f57838204c752ce0a517970db2e0262d5cfb10d066f
3
- size 364853
 
 
 
 
data_preparation.py DELETED
@@ -1,130 +0,0 @@
1
- """ Script to prepare the SQuAD2.0 data to the GEM format
2
-
3
- @author: AbinayaM02
4
- """
5
-
6
- # Import libraries
7
- import json
8
- import pandas as pd
9
- from sklearn.model_selection import train_test_split
10
-
11
- # Function to generate gem id
12
- def add_gem_id(data: dict, split: str) -> dict:
13
- """
14
- Add gem id for each of the datapoint in the dataset.
15
-
16
- Parameters:
17
- -----------
18
- data: dict,
19
- data.
20
- split: str,
21
- split of data (train, test or validation).
22
-
23
- Returns:
24
- --------
25
- dict
26
- dictionary with updated id
27
- """
28
- gem_id = -1
29
- generated_data = {"data": []}
30
- id_list =[]
31
- for example in data:
32
- title = example["title"]
33
- for paragraph in example["paragraphs"]:
34
- context = paragraph["context"] # do not strip leading blank spaces GH-2585
35
- for qa in paragraph["qas"]:
36
- temp_dict = {}
37
- question = qa["question"]
38
- qa_id = qa["id"]
39
- answer_starts = [answer["answer_start"] for answer in qa["answers"]]
40
- answers = [answer["text"] for answer in qa["answers"]]
41
- # Features currently used are "context", "question", and "answers".
42
- # Others are extracted here for the ease of future expansions.
43
- gem_id += 1
44
- temp_dict["id"] = qa_id
45
- temp_dict["gem_id"] = f"gem-squad_v2-{split}-{gem_id}"
46
- temp_dict["title"] = title
47
- temp_dict["context"] = context
48
- temp_dict["question"] = question
49
- temp_dict["answers"] = {
50
- "answer_start": answer_starts,
51
- "text": answers,
52
- }
53
- generated_data["data"].append(temp_dict)
54
- return generated_data
55
-
56
-
57
- # Function to split data
58
- def split_data(file_name: str, data_type: str) -> (dict, dict):
59
- """
60
- Method to split the data specific to SQuAD2.0
61
-
62
- Parameters:
63
- -----------
64
- file_name: str,
65
- name of the file.
66
- data_type: str,
67
- type of the data file.
68
-
69
- Returns:
70
- --------
71
- (dict, dict)
72
- split of data
73
- """
74
-
75
- if data_type == "json":
76
- with open(file_name, 'r') as json_file:
77
- data = json.load(json_file)["data"]
78
- json_file.close()
79
-
80
- # split the data into train and test
81
- # 90% train data 10% test data
82
- train, test = train_test_split(data, train_size=0.9, random_state = 42)
83
- return(train, test)
84
-
85
- # Function to save json file
86
- def save_json(data: dict, file_name: str):
87
- """
88
- Method to save the json file.
89
-
90
- Parameters:
91
- ----------
92
- data: dict,
93
- data to be saved in file.
94
- file_name: str,
95
- name of the file.
96
-
97
- Returns:
98
- --------
99
- None
100
- """
101
-
102
- # save the split
103
- with open(file_name, "w") as data_file:
104
- json.dump(data, data_file, indent = 2)
105
- data_file.close()
106
-
107
-
108
- if __name__ == "__main__":
109
- # split the train data
110
- train, test = split_data("squad_data/train-v2.0.json", "json")
111
-
112
- # add gem id to train split
113
- train = add_gem_id(train, "train")
114
- # save the train split
115
- save_json(train, "train.json")
116
-
117
- # add gem id to test split
118
- test = add_gem_id(test, "test")
119
- # save the test split
120
- save_json(test, "test.json")
121
-
122
- # load validation data
123
- with open("squad_data/dev-v2.0.json", "r") as dev_file:
124
- validation = json.load(dev_file)["data"]
125
- dev_file.close()
126
-
127
- # add gem id and save valid.json
128
- validation = add_gem_id(validation, "validation")
129
- save_json(validation, "validation.json")
130
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
challenge_sets/question_type_split/challenge_question_filter_test.json → gem_data_split/squad_v2-test.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:eff922b3673e036337b200c97333c23cb969069ab0ef73c05af81b29424a8049
3
- size 331408
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:48dbd0e9f640bee2be2387a58246a88047464ee8426e7faf5f05ab588b59afb4
3
+ size 2720889
gem_data_split/{test.json → squad_v2-train.parquet} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0491481fa9f87b853325955a723f4f016a1b2c7c36102e0f1a6d719cef2f2fe7
3
- size 15489062
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f4ffb56e0d44a23a46c117ace98cfe9b5448760b3f60768b16b23832e52da8f
3
+ size 22844624
dataset_infos.json → gem_data_split/squad_v2-validation.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2b57dedd58342e6e56bdb4f3b140ea5fd7098c3e441866d216d5eea44b10752a
3
- size 2660
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2b31f2ef13339b05ed0d6bdacfc92905ce044573ca7aad850c111a912e94c90
3
+ size 2170392
gem_data_split/train.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:3bdf14d2447662444e33ff98308d414e2f7cdad4a0d5bd1eafa2964dbcd45f53
3
- size 129237655
 
 
 
 
gem_data_split/validation.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a046fe6cb3e5acd6af6297d7882b0d04318ca4d4f53e850e2789e516a51fc8ca
3
- size 14480863
 
 
 
 
squad_data/dev-v2.0.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:80a5225e94905956a6446d296ca1093975c4d3b3260f1d6c8f68bc2ab77182d8
3
- size 4370528
 
 
 
 
squad_data/train-v2.0.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:68dcfbb971bd3e96d5b46c7177b16c1a4e7d4bdef19fb204502738552dede002
3
- size 42123633
 
 
 
 
squad_v2.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:6852b9cc30a2c0e08b860c593a10d0ce3ac1df7be80fe3ea42971dabbb308449
3
- size 10649
 
 
 
 
squad_v2.py DELETED
@@ -1,151 +0,0 @@
1
- """TODO(squad_v2): Add a description here."""
2
-
3
-
4
- import json
5
-
6
- import datasets
7
-
8
-
9
- # TODO(squad_v2): BibTeX citation
10
- _CITATION = """\
11
- @article{2016arXiv160605250R,
12
- author = {{Rajpurkar}, Pranav and {Zhang}, Jian and {Lopyrev},
13
- Konstantin and {Liang}, Percy},
14
- title = "{SQuAD: 100,000+ Questions for Machine Comprehension of Text}",
15
- journal = {arXiv e-prints},
16
- year = 2016,
17
- eid = {arXiv:1606.05250},
18
- pages = {arXiv:1606.05250},
19
- archivePrefix = {arXiv},
20
- eprint = {1606.05250},
21
- }
22
- """
23
-
24
- _DESCRIPTION = """\
25
- SQuAD2.0 combines the 100,000 questions in SQuAD1.1 with over 50,000 unanswerable questions written adversarially by crowdworkers
26
- to look similar to answerable ones. To do well on SQuAD2.0, systems must not only answer questions when possible, but
27
- also determine when no answer is supported by the paragraph and abstain from answering.
28
- """
29
-
30
- _URLS = {
31
- "gem_data_split":
32
- {
33
- "train": "./gem_data_split/train.json",
34
- "test": "./gem_data_split/test.json",
35
- "validation": "./gem_data_split/validation.json",
36
- },
37
- }
38
-
39
-
40
-
41
- class SquadV2Config(datasets.BuilderConfig):
42
- """BuilderConfig for SQUAD."""
43
-
44
- def __init__(self, **kwargs):
45
- """BuilderConfig for SQUADV2.
46
-
47
- Args:
48
- **kwargs: keyword arguments forwarded to super.
49
- """
50
- super(SquadV2Config, self).__init__(**kwargs)
51
-
52
-
53
- class SquadV2(datasets.GeneratorBasedBuilder):
54
- """TODO(squad_v2): Short description of my dataset."""
55
-
56
- # TODO(squad_v2): Set up version.
57
- VERSION_1 = datasets.Version("1.0.0")
58
-
59
- BUILDER_CONFIGS = [
60
- SquadV2Config(name="gem_data_split", version=VERSION_1, description="SQuAD2.0 - GEM version 1"),
61
- ]
62
-
63
- DEFAULT_CONFIG_NAME = "gem_data_split"
64
-
65
- def _info(self):
66
- # TODO(squad_v2): Specifies the datasets.DatasetInfo object
67
- return datasets.DatasetInfo(
68
- # This is the description that will appear on the datasets page.
69
- description=_DESCRIPTION,
70
- # datasets.features.FeatureConnectors
71
- features=datasets.Features(
72
- {
73
- "gem_id": datasets.Value("string"),
74
- "id": datasets.Value("string"),
75
- "title": datasets.Value("string"),
76
- "context": datasets.Value("string"),
77
- "question": datasets.Value("string"),
78
- "target": datasets.Value("string"),
79
- "references": [datasets.Value("string")],
80
- "answers": datasets.features.Sequence(
81
- {
82
- "text": datasets.Value("string"),
83
- "answer_start": datasets.Value("int32"),
84
- }
85
- ),
86
- # These are the features of your dataset like images, labels ...
87
- }
88
- ),
89
- # If there's a common (input, target) tuple from the features,
90
- # specify them here. They'll be used if as_supervised=True in
91
- # builder.as_dataset.
92
- supervised_keys=None,
93
- # Homepage of the dataset for documentation
94
- homepage="https://rajpurkar.github.io/SQuAD-explorer/",
95
- license="CC BY-SA 4.0",
96
- citation=_CITATION,
97
- )
98
-
99
- def _split_generators(self, dl_manager):
100
- """Returns SplitGenerators."""
101
- # TODO(squad_v2): Downloads the data and defines the splits
102
- # dl_manager is a datasets.download.DownloadManager that can be used to
103
- # download and extract URLs
104
- urls_to_download = _URLS[self.config.name]
105
- downloaded_files = dl_manager.download_and_extract(urls_to_download)
106
-
107
- return [
108
- datasets.SplitGenerator(
109
- name=datasets.Split.TRAIN,
110
- gen_kwargs={
111
- "filepath": downloaded_files["train"],
112
- "split": "train",
113
- },
114
- ),
115
- datasets.SplitGenerator(
116
- name=datasets.Split.VALIDATION,
117
- gen_kwargs={
118
- "filepath": downloaded_files["validation"],
119
- "split": "validation",
120
- },
121
- ),
122
- datasets.SplitGenerator(
123
- name=datasets.Split.TEST,
124
- gen_kwargs={
125
- "filepath": downloaded_files["test"],
126
- "split": "test",
127
- },
128
- ),
129
- ]
130
-
131
- def _generate_examples(self, filepath, split):
132
- """Yields examples."""
133
- # TODO(squad_v2): Yields (key, example) tuples from the dataset
134
- with open(filepath, encoding="utf-8") as f:
135
- data = json.load(f)
136
- for id_, row in enumerate(data["data"]):
137
- # Features currently used are "context", "question", and "answers".
138
- # Others are extracted here for the ease of future expansions.
139
- yield id_, {
140
- "id": row["id"],
141
- "gem_id": row["gem_id"],
142
- "title": row["title"],
143
- "context": row["context"],
144
- "question": row["question"],
145
- "answers": row["answers"],
146
- "target": row["question"],
147
- "references": [row["question"]],
148
- }
149
-
150
-
151
-