Datasets:

Modalities:
Text
Formats:
parquet
Languages:
English
ArXiv:
Libraries:
Datasets
pandas
License:
albertvillanova HF staff commited on
Commit
a34ba20
1 Parent(s): 3dfa861

Convert dataset to Parquet (#2)

Browse files

- Convert dataset to Parquet (d972dc610532837ba9cfd665578f869862a082ed)
- Delete loading script (35e062508bef47c0842c2828d968eca25d6a7a3b)
- Delete legacy dataset_infos.json (ee3ee04ae885d5b1e821b3239e98fd282924290f)

README.md CHANGED
@@ -1,15 +1,14 @@
1
  ---
2
  annotations_creators:
3
  - crowdsourced
4
- language:
5
- - en
6
  language_creators:
7
  - found
 
 
8
  license:
9
  - cc-by-4.0
10
  multilinguality:
11
  - monolingual
12
- pretty_name: Question Answering via Sentence Composition (QASC)
13
  size_categories:
14
  - 1K<n<10K
15
  source_datasets:
@@ -21,6 +20,7 @@ task_ids:
21
  - extractive-qa
22
  - multiple-choice-qa
23
  paperswithcode_id: qasc
 
24
  dataset_info:
25
  features:
26
  - name: id
@@ -44,17 +44,26 @@ dataset_info:
44
  - name: formatted_question
45
  dtype: string
46
  splits:
47
- - name: test
48
- num_bytes: 393683
49
- num_examples: 920
50
  - name: train
51
- num_bytes: 4919377
52
  num_examples: 8134
 
 
 
53
  - name: validation
54
- num_bytes: 562352
55
  num_examples: 926
56
- download_size: 1616514
57
- dataset_size: 5875412
 
 
 
 
 
 
 
 
 
58
  ---
59
 
60
  # Dataset Card for "qasc"
 
1
  ---
2
  annotations_creators:
3
  - crowdsourced
 
 
4
  language_creators:
5
  - found
6
+ language:
7
+ - en
8
  license:
9
  - cc-by-4.0
10
  multilinguality:
11
  - monolingual
 
12
  size_categories:
13
  - 1K<n<10K
14
  source_datasets:
 
20
  - extractive-qa
21
  - multiple-choice-qa
22
  paperswithcode_id: qasc
23
+ pretty_name: Question Answering via Sentence Composition (QASC)
24
  dataset_info:
25
  features:
26
  - name: id
 
44
  - name: formatted_question
45
  dtype: string
46
  splits:
 
 
 
47
  - name: train
48
+ num_bytes: 4891878
49
  num_examples: 8134
50
+ - name: test
51
+ num_bytes: 390534
52
+ num_examples: 920
53
  - name: validation
54
+ num_bytes: 559180
55
  num_examples: 926
56
+ download_size: 2349698
57
+ dataset_size: 5841592
58
+ configs:
59
+ - config_name: default
60
+ data_files:
61
+ - split: train
62
+ path: data/train-*
63
+ - split: test
64
+ path: data/test-*
65
+ - split: validation
66
+ path: data/validation-*
67
  ---
68
 
69
  # Dataset Card for "qasc"
data/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:495cfbd17abc1720b54785cdce68825104aaf60d7b8bdb2acac62157a31eb517
3
+ size 158241
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b9a297b5ab55f1605c7682ffbb7042c26d7ecb9ff1e1aa5a820d4e791c8302d1
3
+ size 1967904
data/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d1ae34ae13c5fce2c55305372c203c6cdb789728d0d7e5ea2956d55bc33f40ae
3
+ size 223553
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"default": {"description": "\nQASC is a question-answering dataset with a focus on sentence composition. It consists of 9,980 8-way multiple-choice \nquestions about grade school science (8,134 train, 926 dev, 920 test), and comes with a corpus of 17M sentences.\n", "citation": "@article{allenai:qasc,\n author = {Tushar Khot and Peter Clark and Michal Guerquin and Peter Jansen and Ashish Sabharwal},\n title = {QASC: A Dataset for Question Answering via Sentence Composition},\n journal = {arXiv:1910.11473v2},\n year = {2020},\n}\n", "homepage": "https://allenai.org/data/qasc", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "choices": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "answerKey": {"dtype": "string", "id": null, "_type": "Value"}, "fact1": {"dtype": "string", "id": null, "_type": "Value"}, "fact2": {"dtype": "string", "id": null, "_type": "Value"}, "combinedfact": {"dtype": "string", "id": null, "_type": "Value"}, "formatted_question": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "qasc", "config_name": "default", "version": {"version_str": "0.1.0", "description": null, "datasets_version_to_prepare": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 393683, "num_examples": 920, "dataset_name": "qasc"}, "train": {"name": "train", "num_bytes": 4919377, "num_examples": 8134, "dataset_name": "qasc"}, "validation": {"name": "validation", "num_bytes": 562352, "num_examples": 926, "dataset_name": "qasc"}}, "download_checksums": {"http://data.allenai.org/downloads/qasc/qasc_dataset.tar.gz": {"num_bytes": 1616514, "checksum": "a7b3f2244f768974c609fd621346c931a72715609f171cb5544fc1da2a2ad55c"}}, "download_size": 1616514, "dataset_size": 5875412, "size_in_bytes": 7491926}}
 
 
qasc.py DELETED
@@ -1,123 +0,0 @@
1
- """TODO(qasc): Add a description here."""
2
-
3
-
4
- import json
5
-
6
- import datasets
7
-
8
-
9
- # TODO(qasc): BibTeX citation
10
- _CITATION = """\
11
- @article{allenai:qasc,
12
- author = {Tushar Khot and Peter Clark and Michal Guerquin and Peter Jansen and Ashish Sabharwal},
13
- title = {QASC: A Dataset for Question Answering via Sentence Composition},
14
- journal = {arXiv:1910.11473v2},
15
- year = {2020},
16
- }
17
- """
18
-
19
- # TODO(qasc):
20
- _DESCRIPTION = """
21
- QASC is a question-answering dataset with a focus on sentence composition. It consists of 9,980 8-way multiple-choice
22
- questions about grade school science (8,134 train, 926 dev, 920 test), and comes with a corpus of 17M sentences.
23
- """
24
- _URl = "http://data.allenai.org/downloads/qasc/qasc_dataset.tar.gz"
25
-
26
-
27
- class Qasc(datasets.GeneratorBasedBuilder):
28
- """TODO(qasc): Short description of my dataset."""
29
-
30
- # TODO(qasc): Set up version.
31
- VERSION = datasets.Version("0.1.0")
32
-
33
- def _info(self):
34
- # TODO(qasc): Specifies the datasets.DatasetInfo object
35
- return datasets.DatasetInfo(
36
- # This is the description that will appear on the datasets page.
37
- description=_DESCRIPTION,
38
- # datasets.features.FeatureConnectors
39
- features=datasets.Features(
40
- {
41
- "id": datasets.Value("string"),
42
- "question": datasets.Value("string"),
43
- "choices": datasets.features.Sequence(
44
- {"text": datasets.Value("string"), "label": datasets.Value("string")}
45
- ),
46
- "answerKey": datasets.Value("string"),
47
- "fact1": datasets.Value("string"),
48
- "fact2": datasets.Value("string"),
49
- "combinedfact": datasets.Value("string"),
50
- "formatted_question": datasets.Value("string"),
51
- # These are the features of your dataset like images, labels ...
52
- }
53
- ),
54
- # If there's a common (input, target) tuple from the features,
55
- # specify them here. They'll be used if as_supervised=True in
56
- # builder.as_dataset.
57
- supervised_keys=None,
58
- # Homepage of the dataset for documentation
59
- homepage="https://allenai.org/data/qasc",
60
- citation=_CITATION,
61
- )
62
-
63
- def _split_generators(self, dl_manager):
64
- """Returns SplitGenerators."""
65
- # TODO(qasc): Downloads the data and defines the splits
66
- # dl_manager is a datasets.download.DownloadManager that can be used to
67
- # download and extract URLs
68
- archive = dl_manager.download(_URl)
69
- return [
70
- datasets.SplitGenerator(
71
- name=datasets.Split.TRAIN,
72
- # These kwargs will be passed to _generate_examples
73
- gen_kwargs={
74
- "filepath": "/".join(["QASC_Dataset", "train.jsonl"]),
75
- "files": dl_manager.iter_archive(archive),
76
- },
77
- ),
78
- datasets.SplitGenerator(
79
- name=datasets.Split.TEST,
80
- # These kwargs will be passed to _generate_examples
81
- gen_kwargs={
82
- "filepath": "/".join(["QASC_Dataset", "test.jsonl"]),
83
- "files": dl_manager.iter_archive(archive),
84
- },
85
- ),
86
- datasets.SplitGenerator(
87
- name=datasets.Split.VALIDATION,
88
- # These kwargs will be passed to _generate_examples
89
- gen_kwargs={
90
- "filepath": "/".join(["QASC_Dataset", "dev.jsonl"]),
91
- "files": dl_manager.iter_archive(archive),
92
- },
93
- ),
94
- ]
95
-
96
- def _generate_examples(self, filepath, files):
97
- """Yields examples."""
98
- # TODO(qasc): Yields (key, example) tuples from the dataset
99
- for path, f in files:
100
- if path == filepath:
101
- for row in f:
102
- data = json.loads(row.decode("utf-8"))
103
- answerkey = data.get("answerKey", "")
104
- id_ = data["id"]
105
- question = data["question"]["stem"]
106
- choices = data["question"]["choices"]
107
- text_choices = [choice["text"] for choice in choices]
108
- label_choices = [choice["label"] for choice in choices]
109
- fact1 = data.get("fact1", "")
110
- fact2 = data.get("fact2", "")
111
- combined_fact = data.get("combinedfact", "")
112
- formatted_question = data.get("formatted_question", "")
113
- yield id_, {
114
- "id": id_,
115
- "answerKey": answerkey,
116
- "question": question,
117
- "choices": {"text": text_choices, "label": label_choices},
118
- "fact1": fact1,
119
- "fact2": fact2,
120
- "combinedfact": combined_fact,
121
- "formatted_question": formatted_question,
122
- }
123
- break