Datasets:
GEM
/

Tasks:
Other
Modalities:
Text
Languages:
English
ArXiv:
Libraries:
Datasets
License:
Abinaya Mahendiran commited on
Commit
0d15ee3
1 Parent(s): 2ea833c

Updated data script

Browse files
Files changed (2) hide show
  1. dataset_infos.json +0 -1
  2. squad_v2.py +6 -6
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"squad_v2": {"description": "combines the 100,000 questions in SQuAD1.1 with over 50,000 unanswerable questions written adversarially by crowdworkers\n to look similar to answerable ones. To do well on SQuAD2.0, systems must not only answer questions when possible, but\n also determine when no answer is supported by the paragraph and abstain from answering.\n", "citation": "@article{2016arXiv160605250R,\n author = {{Rajpurkar}, Pranav and {Zhang}, Jian and {Lopyrev},\n Konstantin and {Liang}, Percy},\n title = \"{SQuAD: 100,000+ Questions for Machine Comprehension of Text}\",\n journal = {arXiv e-prints},\n year = 2016,\n eid = {arXiv:1606.05250},\n pages = {arXiv:1606.05250},\narchivePrefix = {arXiv},\n eprint = {1606.05250},\n}\n", "homepage": "https://rajpurkar.github.io/SQuAD-explorer/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "answer_start": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [{"task": "question-answering-extractive", "question_column": "question", "context_column": "context", "answers_column": "answers"}], "builder_name": "squad_v2", "config_name": "squad_v2", "version": {"version_str": "2.0.0", "description": null, "major": 2, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 116699950, "num_examples": 130319, "dataset_name": "squad_v2"}, "validation": {"name": "validation", "num_bytes": 11660302, "num_examples": 11873, "dataset_name": "squad_v2"}}, "download_checksums": {"https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v2.0.json": {"num_bytes": 42123633, "checksum": "68dcfbb971bd3e96d5b46c7177b16c1a4e7d4bdef19fb204502738552dede002"}, "https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v2.0.json": {"num_bytes": 4370528, "checksum": "80a5225e94905956a6446d296ca1093975c4d3b3260f1d6c8f68bc2ab77182d8"}}, "download_size": 46494161, "post_processing_size": null, "dataset_size": 128360252, "size_in_bytes": 174854413}}
 
 
squad_v2.py CHANGED
@@ -63,7 +63,7 @@ class SquadV2(datasets.GeneratorBasedBuilder):
63
  # datasets.features.FeatureConnectors
64
  features=datasets.Features(
65
  {
66
- "id": datasets.Value("string"),
67
  "title": datasets.Value("string"),
68
  "context": datasets.Value("string"),
69
  "question": datasets.Value("string"),
@@ -99,11 +99,11 @@ class SquadV2(datasets.GeneratorBasedBuilder):
99
  downloaded_files = dl_manager.download_and_extract(urls_to_download)
100
 
101
  return [
102
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
103
- datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
104
  ]
105
 
106
- def _generate_examples(self, filepath):
107
  """Yields examples."""
108
  # TODO(squad_v2): Yields (key, example) tuples from the dataset
109
  with open(filepath, encoding="utf-8") as f:
@@ -125,9 +125,9 @@ class SquadV2(datasets.GeneratorBasedBuilder):
125
  "title": title,
126
  "context": context,
127
  "question": question,
128
- "id": id_,
129
  "answers": {
130
  "answer_start": answer_starts,
131
  "text": answers,
132
  },
133
- }
 
63
  # datasets.features.FeatureConnectors
64
  features=datasets.Features(
65
  {
66
+ "gem_id": datasets.Value("string"),
67
  "title": datasets.Value("string"),
68
  "context": datasets.Value("string"),
69
  "question": datasets.Value("string"),
 
99
  downloaded_files = dl_manager.download_and_extract(urls_to_download)
100
 
101
  return [
102
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"], "split": "train"}),
103
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"], "split": "validation"}),
104
  ]
105
 
106
+ def _generate_examples(self, filepath, split):
107
  """Yields examples."""
108
  # TODO(squad_v2): Yields (key, example) tuples from the dataset
109
  with open(filepath, encoding="utf-8") as f:
 
125
  "title": title,
126
  "context": context,
127
  "question": question,
128
+ "gem_id": f"gem-{squad_v2}-{split}-{id_}",
129
  "answers": {
130
  "answer_start": answer_starts,
131
  "text": answers,
132
  },
133
+ }