Convert dataset to Parquet

#2
README.md CHANGED
@@ -24,6 +24,7 @@ task_ids:
24
  paperswithcode_id: quac
25
  pretty_name: Question Answering in Context
26
  dataset_info:
 
27
  features:
28
  - name: dialogue_id
29
  dtype: string
@@ -65,16 +66,22 @@ dataset_info:
65
  sequence: string
66
  - name: answer_starts
67
  sequence: int32
68
- config_name: plain_text
69
  splits:
70
  - name: train
71
- num_bytes: 58174754
72
  num_examples: 11567
73
  - name: validation
74
- num_bytes: 7375938
75
  num_examples: 1000
76
- download_size: 77043986
77
- dataset_size: 65550692
 
 
 
 
 
 
 
78
  ---
79
 
80
  # Dataset Card for Question Answering in Context
 
24
  paperswithcode_id: quac
25
  pretty_name: Question Answering in Context
26
  dataset_info:
27
+ config_name: plain_text
28
  features:
29
  - name: dialogue_id
30
  dtype: string
 
66
  sequence: string
67
  - name: answer_starts
68
  sequence: int32
 
69
  splits:
70
  - name: train
71
+ num_bytes: 58174602
72
  num_examples: 11567
73
  - name: validation
74
+ num_bytes: 7375862
75
  num_examples: 1000
76
+ download_size: 34925990
77
+ dataset_size: 65550464
78
+ configs:
79
+ - config_name: plain_text
80
+ data_files:
81
+ - split: train
82
+ path: plain_text/train-*
83
+ - split: validation
84
+ path: plain_text/validation-*
85
  ---
86
 
87
  # Dataset Card for Question Answering in Context
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"plain_text": {"description": "Question Answering in Context is a dataset for modeling, understanding,\nand participating in information seeking dialog. Data instances consist\nof an interactive dialog between two crowd workers: (1) a student who\nposes a sequence of freeform questions to learn as much as possible\nabout a hidden Wikipedia text, and (2) a teacher who answers the questions\nby providing short excerpts (spans) from the text. QuAC introduces\nchallenges not found in existing machine comprehension datasets: its\nquestions are often more open-ended, unanswerable, or only meaningful\nwithin the dialog context.\n", "citation": "@inproceedings{choi-etal-2018-quac,\ntitle = \"QUAC: Question answering in context\",\nabstract = \"We present QuAC, a dataset for Question Answering in Context that contains 14K information-seeking QA dialogs (100K questions in total). The dialogs involve two crowd workers: (1) a student who poses a sequence of freeform questions to learn as much as possible about a hidden Wikipedia text, and (2) a teacher who answers the questions by providing short excerpts from the text. QuAC introduces challenges not found in existing machine comprehension datasets: its questions are often more open-ended, unanswerable, or only meaningful within the dialog context, as we show in a detailed qualitative evaluation. We also report results for a number of reference models, including a recently state-of-the-art reading comprehension architecture extended to model dialog context. Our best model underperforms humans by 20 F1, suggesting that there is significant room for future work on this data. Dataset, baseline, and leaderboard available at http://quac.ai.\",\nauthor = \"Eunsol Choi and He He and Mohit Iyyer and Mark Yatskar and Yih, {Wen Tau} and Yejin Choi and Percy Liang and Luke Zettlemoyer\",\nyear = \"2018\",\nlanguage = \"English (US)\",\nseries = \"Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, EMNLP 2018\",\npublisher = \"Association for Computational Linguistics\",\npages = \"2174--2184\",\neditor = \"Ellen Riloff and David Chiang and Julia Hockenmaier and Jun'ichi Tsujii\",\nbooktitle = \"Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, EMNLP 2018\",\nnote = \"2018 Conference on Empirical Methods in Natural Language Processing, EMNLP 2018 ; Conference date: 31-10-2018 Through 04-11-2018\",\n}\n", "homepage": "https://quac.ai/", "license": "MIT", "features": {"dialogue_id": {"dtype": "string", "id": null, "_type": "Value"}, "wikipedia_page_title": {"dtype": "string", "id": null, "_type": "Value"}, "background": {"dtype": "string", "id": null, "_type": "Value"}, "section_title": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "turn_ids": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "questions": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "followups": {"feature": {"num_classes": 3, "names": ["y", "n", "m"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}, "yesnos": {"feature": {"num_classes": 3, "names": ["y", "n", "x"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}, "answers": {"feature": {"texts": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "answer_starts": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "length": -1, "id": null, "_type": "Sequence"}, "orig_answers": {"texts": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "answer_starts": {"feature": {"dtype": "int32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}}, "post_processed": null, "supervised_keys": null, "builder_name": "quac", "config_name": "plain_text", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 58174754, "num_examples": 11567, "dataset_name": "quac"}, "validation": {"name": "validation", "num_bytes": 7375938, "num_examples": 1000, "dataset_name": "quac"}}, "download_checksums": {"https://s3.amazonaws.com/my89public/quac/train_v0.2.json": {"num_bytes": 68114819, "checksum": "ff5cca5a2e4b4d1cb5b5ced68b9fce88394ef6d93117426d6d4baafbcc05c56a"}, "https://s3.amazonaws.com/my89public/quac/val_v0.2.json": {"num_bytes": 8929167, "checksum": "09e622916280ba04c9352acb1bc5bbe80f11a2598f6f34e934c51d9e6570f378"}}, "download_size": 77043986, "post_processing_size": null, "dataset_size": 65550692, "size_in_bytes": 142594678}}
 
 
plain_text/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:067c94373d1a622339a73f16032d8060bb5dd989cd8ce2b3647363a8bc1d5b5f
3
+ size 31324530
plain_text/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9701bfc0cbb60cd9b90e2419effc59f5b8cd5057b987f861ec7b0c25c90c6b7a
3
+ size 3601460
quac.py DELETED
@@ -1,171 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- """QUAC (Question Answering in Context)."""
16
-
17
-
18
- import json
19
-
20
- import datasets
21
-
22
-
23
- _CITATION = """\
24
- @inproceedings{choi-etal-2018-quac,
25
- title = "QUAC: Question answering in context",
26
- abstract = "We present QuAC, a dataset for Question Answering in Context that contains 14K information-seeking QA dialogs (100K questions in total). The dialogs involve two crowd workers: (1) a student who poses a sequence of freeform questions to learn as much as possible about a hidden Wikipedia text, and (2) a teacher who answers the questions by providing short excerpts from the text. QuAC introduces challenges not found in existing machine comprehension datasets: its questions are often more open-ended, unanswerable, or only meaningful within the dialog context, as we show in a detailed qualitative evaluation. We also report results for a number of reference models, including a recently state-of-the-art reading comprehension architecture extended to model dialog context. Our best model underperforms humans by 20 F1, suggesting that there is significant room for future work on this data. Dataset, baseline, and leaderboard available at http://quac.ai.",
27
- author = "Eunsol Choi and He He and Mohit Iyyer and Mark Yatskar and Yih, {Wen Tau} and Yejin Choi and Percy Liang and Luke Zettlemoyer",
28
- year = "2018",
29
- language = "English (US)",
30
- series = "Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, EMNLP 2018",
31
- publisher = "Association for Computational Linguistics",
32
- pages = "2174--2184",
33
- editor = "Ellen Riloff and David Chiang and Julia Hockenmaier and Jun'ichi Tsujii",
34
- booktitle = "Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, EMNLP 2018",
35
- note = "2018 Conference on Empirical Methods in Natural Language Processing, EMNLP 2018 ; Conference date: 31-10-2018 Through 04-11-2018",
36
- }
37
- """
38
-
39
- _DESCRIPTION = """\
40
- Question Answering in Context is a dataset for modeling, understanding,
41
- and participating in information seeking dialog. Data instances consist
42
- of an interactive dialog between two crowd workers: (1) a student who
43
- poses a sequence of freeform questions to learn as much as possible
44
- about a hidden Wikipedia text, and (2) a teacher who answers the questions
45
- by providing short excerpts (spans) from the text. QuAC introduces
46
- challenges not found in existing machine comprehension datasets: its
47
- questions are often more open-ended, unanswerable, or only meaningful
48
- within the dialog context.
49
- """
50
-
51
- _HOMEPAGE = "https://quac.ai/"
52
-
53
- _LICENSE = "MIT"
54
-
55
- _URLs = {
56
- "train": "https://s3.amazonaws.com/my89public/quac/train_v0.2.json",
57
- "validation": "https://s3.amazonaws.com/my89public/quac/val_v0.2.json",
58
- }
59
-
60
-
61
- class Quac(datasets.GeneratorBasedBuilder):
62
- """QuAC (Question Answering in Context)."""
63
-
64
- VERSION = datasets.Version("1.1.0")
65
-
66
- BUILDER_CONFIGS = [
67
- datasets.BuilderConfig(
68
- name="plain_text",
69
- description="Plain text",
70
- version=VERSION,
71
- ),
72
- ]
73
-
74
- def _info(self):
75
- return datasets.DatasetInfo(
76
- description=_DESCRIPTION,
77
- features=datasets.Features(
78
- {
79
- "dialogue_id": datasets.Value("string"),
80
- "wikipedia_page_title": datasets.Value("string"),
81
- "background": datasets.Value("string"),
82
- "section_title": datasets.Value("string"),
83
- "context": datasets.Value("string"),
84
- "turn_ids": datasets.Sequence(datasets.Value("string")),
85
- "questions": datasets.Sequence(datasets.Value("string")),
86
- "followups": datasets.Sequence(datasets.ClassLabel(names=["y", "n", "m"])),
87
- "yesnos": datasets.Sequence(datasets.ClassLabel(names=["y", "n", "x"])),
88
- "answers": datasets.Sequence(
89
- {
90
- "texts": datasets.Sequence(datasets.Value("string")),
91
- "answer_starts": datasets.Sequence(datasets.Value("int32")),
92
- }
93
- ),
94
- "orig_answers": {
95
- "texts": datasets.Sequence(datasets.Value("string")),
96
- "answer_starts": datasets.Sequence(datasets.Value("int32")),
97
- },
98
- }
99
- ),
100
- supervised_keys=None,
101
- homepage=_HOMEPAGE,
102
- license=_LICENSE,
103
- citation=_CITATION,
104
- )
105
-
106
- def _split_generators(self, dl_manager):
107
- """Returns SplitGenerators."""
108
- data_dir = dl_manager.download_and_extract(_URLs)
109
- return [
110
- datasets.SplitGenerator(
111
- name=datasets.Split.TRAIN,
112
- gen_kwargs={
113
- "filepath": data_dir["train"],
114
- },
115
- ),
116
- datasets.SplitGenerator(
117
- name=datasets.Split.VALIDATION,
118
- gen_kwargs={
119
- "filepath": data_dir["validation"],
120
- },
121
- ),
122
- ]
123
-
124
- def _generate_examples(self, filepath):
125
- """Yields examples."""
126
- with open(filepath, encoding="utf-8") as f:
127
- squad = json.load(f)
128
- for section in squad["data"]:
129
- wiki_page_title = section.get("title", "").strip()
130
- background = section.get("background", "").strip()
131
- section_title = section.get("section_title", "").strip()
132
-
133
- for dialogue in section["paragraphs"]:
134
- context = dialogue["context"].strip()
135
- dialogue_id = dialogue["id"]
136
-
137
- followups = []
138
- yesnos = []
139
- questions = []
140
- turn_ids = []
141
- answers = []
142
- orig_answers = {"texts": [], "answer_starts": []}
143
-
144
- for turn in dialogue["qas"]:
145
- followups.append(turn["followup"])
146
- yesnos.append(turn["yesno"])
147
- questions.append(turn["question"])
148
- turn_ids.append(turn["id"])
149
-
150
- ans_ = {
151
- "texts": [t["text"].strip() for t in turn["answers"]],
152
- "answer_starts": [t["answer_start"] for t in turn["answers"]],
153
- }
154
- answers.append(ans_)
155
-
156
- orig_answers["texts"].append(turn["orig_answer"]["text"])
157
- orig_answers["answer_starts"].append(turn["orig_answer"]["answer_start"])
158
-
159
- yield dialogue_id, {
160
- "dialogue_id": dialogue_id,
161
- "wikipedia_page_title": wiki_page_title,
162
- "background": background,
163
- "section_title": section_title,
164
- "context": context,
165
- "turn_ids": turn_ids,
166
- "questions": questions,
167
- "followups": followups,
168
- "yesnos": yesnos,
169
- "answers": answers,
170
- "orig_answers": orig_answers,
171
- }