Commit
•
dbdbe7b
1
Parent(s):
b73b58e
Convert dataset to Parquet (#5)
Browse files- Convert dataset to Parquet (539cd219badd057e409b4aa4f0d8a4ae219a68c4)
- Add air_dialogue_kb data files (f85fe8a6cf6a2c64758bae0ef4cfa215053b225b)
- Delete loading script (47aca202079e90bcc1bfd610dcd70bb810d7d3c2)
- README.md +16 -2
- air_dialogue.py +0 -285
- air_dialogue_data/train-00000-of-00001.parquet +3 -0
- air_dialogue_data/validation-00000-of-00001.parquet +3 -0
- air_dialogue_kb/train-00000-of-00002.parquet +3 -0
- air_dialogue_kb/train-00001-of-00002.parquet +3 -0
- air_dialogue_kb/validation-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -87,7 +87,7 @@ dataset_info:
|
|
87 |
- name: validation
|
88 |
num_bytes: 44441818
|
89 |
num_examples: 40363
|
90 |
-
download_size:
|
91 |
dataset_size: 398160183
|
92 |
- config_name: air_dialogue_kb
|
93 |
features:
|
@@ -128,8 +128,22 @@ dataset_info:
|
|
128 |
- name: validation
|
129 |
num_bytes: 98269609
|
130 |
num_examples: 40363
|
131 |
-
download_size:
|
132 |
dataset_size: 880860579
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
---
|
134 |
|
135 |
# Dataset Card for air_dialogue
|
|
|
87 |
- name: validation
|
88 |
num_bytes: 44441818
|
89 |
num_examples: 40363
|
90 |
+
download_size: 141766743
|
91 |
dataset_size: 398160183
|
92 |
- config_name: air_dialogue_kb
|
93 |
features:
|
|
|
128 |
- name: validation
|
129 |
num_bytes: 98269609
|
130 |
num_examples: 40363
|
131 |
+
download_size: 57883938
|
132 |
dataset_size: 880860579
|
133 |
+
configs:
|
134 |
+
- config_name: air_dialogue_data
|
135 |
+
data_files:
|
136 |
+
- split: train
|
137 |
+
path: air_dialogue_data/train-*
|
138 |
+
- split: validation
|
139 |
+
path: air_dialogue_data/validation-*
|
140 |
+
default: true
|
141 |
+
- config_name: air_dialogue_kb
|
142 |
+
data_files:
|
143 |
+
- split: train
|
144 |
+
path: air_dialogue_kb/train-*
|
145 |
+
- split: validation
|
146 |
+
path: air_dialogue_kb/validation-*
|
147 |
---
|
148 |
|
149 |
# Dataset Card for air_dialogue
|
air_dialogue.py
DELETED
@@ -1,285 +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 |
-
"""AirDialogue: A large dataset for goal oriented conversations."""
|
16 |
-
|
17 |
-
|
18 |
-
import json
|
19 |
-
|
20 |
-
import datasets
|
21 |
-
|
22 |
-
|
23 |
-
# TODO: Add BibTeX citation
|
24 |
-
# Find for instance the citation on arxiv or on the dataset repo/website
|
25 |
-
_CITATION = """\
|
26 |
-
@inproceedings{wei-etal-2018-airdialogue,
|
27 |
-
title = "{A}ir{D}ialogue: An Environment for Goal-Oriented Dialogue Research",
|
28 |
-
author = "Wei, Wei and
|
29 |
-
Le, Quoc and
|
30 |
-
Dai, Andrew and
|
31 |
-
Li, Jia",
|
32 |
-
booktitle = "Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing",
|
33 |
-
month = oct # "-" # nov,
|
34 |
-
year = "2018",
|
35 |
-
address = "Brussels, Belgium",
|
36 |
-
publisher = "Association for Computational Linguistics",
|
37 |
-
url = "https://www.aclweb.org/anthology/D18-1419",
|
38 |
-
doi = "10.18653/v1/D18-1419",
|
39 |
-
pages = "3844--3854",
|
40 |
-
abstract = "Recent progress in dialogue generation has inspired a number of studies on dialogue systems that are capable of accomplishing tasks through natural language interactions. A promising direction among these studies is the use of reinforcement learning techniques, such as self-play, for training dialogue agents. However, current datasets are limited in size, and the environment for training agents and evaluating progress is relatively unsophisticated. We present AirDialogue, a large dataset that contains 301,427 goal-oriented conversations. To collect this dataset, we create a context-generator which provides travel and flight restrictions. We then ask human annotators to play the role of a customer or an agent and interact with the goal of successfully booking a trip given the restrictions. Key to our environment is the ease of evaluating the success of the dialogue, which is achieved by using ground-truth states (e.g., the flight being booked) generated by the restrictions. Any dialogue agent that does not generate the correct states is considered to fail. Our experimental results indicate that state-of-the-art dialogue models can only achieve a score of 0.17 while humans can reach a score of 0.91, which suggests significant opportunities for future improvement.",
|
41 |
-
}
|
42 |
-
"""
|
43 |
-
|
44 |
-
# TODO: Add description of the dataset here
|
45 |
-
# You can copy an official description
|
46 |
-
_DESCRIPTION = """\
|
47 |
-
AirDialogue, is a large dataset that contains 402,038 goal-oriented conversations. To collect this dataset, we create a contextgenerator which provides travel and flight restrictions. Then the human annotators are asked to play the role of a customer or an agent and interact with the goal of successfully booking a trip given the restrictions.
|
48 |
-
"""
|
49 |
-
|
50 |
-
# TODO: Add a link to an official homepage for the dataset here
|
51 |
-
_HOMEPAGE = "https://worksheets.codalab.org/worksheets/0xa79833f4b3c24f4188cee7131b120a59"
|
52 |
-
|
53 |
-
# TODO: Add the licence for the dataset here if you can find it
|
54 |
-
_LICENSE = "cc-by-nc-4.0"
|
55 |
-
|
56 |
-
# TODO: Add link to the official dataset URLs here
|
57 |
-
# The HuggingFace dataset library don't host the datasets but only point to the original files
|
58 |
-
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
59 |
-
_URL = "https://storage.googleapis.com/airdialogue/airdialogue_data.tar.gz"
|
60 |
-
|
61 |
-
|
62 |
-
# TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
|
63 |
-
class AirDialogue(datasets.GeneratorBasedBuilder):
|
64 |
-
"""TODO: Short description of my dataset."""
|
65 |
-
|
66 |
-
VERSION = datasets.Version("1.3.0")
|
67 |
-
|
68 |
-
# This is an example of a dataset with multiple configurations.
|
69 |
-
# If you don't want/need to define several sub-sets in your dataset,
|
70 |
-
# just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
|
71 |
-
|
72 |
-
# If you need to make complex sub-parts in the datasets with configurable options
|
73 |
-
# You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
|
74 |
-
# BUILDER_CONFIG_CLASS = MyBuilderConfig
|
75 |
-
|
76 |
-
# You will be able to load one or the other configurations in the following list with
|
77 |
-
# data = datasets.load_dataset('my_dataset', 'first_domain')
|
78 |
-
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
79 |
-
BUILDER_CONFIGS = [
|
80 |
-
datasets.BuilderConfig(
|
81 |
-
name="air_dialogue_data", version=VERSION, description="This part of my dataset covers the dialog files"
|
82 |
-
),
|
83 |
-
datasets.BuilderConfig(
|
84 |
-
name="air_dialogue_kb", version=VERSION, description="This part of my dataset covers the knowledge base"
|
85 |
-
),
|
86 |
-
]
|
87 |
-
|
88 |
-
DEFAULT_CONFIG_NAME = (
|
89 |
-
"air_dialogue_data" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
90 |
-
)
|
91 |
-
|
92 |
-
def _info(self):
|
93 |
-
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
94 |
-
if (
|
95 |
-
self.config.name == "air_dialogue_data"
|
96 |
-
): # This is the name of the configuration selected in BUILDER_CONFIGS above
|
97 |
-
features = datasets.Features(
|
98 |
-
{
|
99 |
-
"action": {
|
100 |
-
"status": datasets.Value("string"),
|
101 |
-
"name": datasets.Value("string"),
|
102 |
-
"flight": datasets.features.Sequence(datasets.Value("int32")),
|
103 |
-
},
|
104 |
-
"intent": {
|
105 |
-
"return_month": datasets.Value("string"),
|
106 |
-
"return_day": datasets.Value("string"),
|
107 |
-
"max_price": datasets.Value("int32"),
|
108 |
-
"departure_airport": datasets.Value("string"),
|
109 |
-
"max_connections": datasets.Value("int32"),
|
110 |
-
"departure_day": datasets.Value("string"),
|
111 |
-
"goal": datasets.Value("string"),
|
112 |
-
"departure_month": datasets.Value("string"),
|
113 |
-
"name": datasets.Value("string"),
|
114 |
-
"return_airport": datasets.Value("string"),
|
115 |
-
},
|
116 |
-
"timestamps": datasets.features.Sequence(datasets.Value("int64")),
|
117 |
-
"dialogue": datasets.features.Sequence(datasets.Value("string")),
|
118 |
-
"expected_action": {
|
119 |
-
"status": datasets.Value("string"),
|
120 |
-
"name": datasets.Value("string"),
|
121 |
-
"flight": datasets.features.Sequence(datasets.Value("int32")),
|
122 |
-
},
|
123 |
-
"search_info": [
|
124 |
-
{
|
125 |
-
"button_name": datasets.Value("string"),
|
126 |
-
"field_name": datasets.Value("string"),
|
127 |
-
"field_value": datasets.Value("string"),
|
128 |
-
"timestmamp": datasets.Value("int64"),
|
129 |
-
},
|
130 |
-
],
|
131 |
-
"correct_sample": datasets.Value("bool_"),
|
132 |
-
}
|
133 |
-
)
|
134 |
-
else:
|
135 |
-
features = datasets.Features(
|
136 |
-
{
|
137 |
-
"kb": [
|
138 |
-
{
|
139 |
-
"airline": datasets.Value("string"),
|
140 |
-
"class": datasets.Value("string"),
|
141 |
-
"departure_airport": datasets.Value("string"),
|
142 |
-
"departure_day": datasets.Value("string"),
|
143 |
-
"departure_month": datasets.Value("string"),
|
144 |
-
"departure_time_num": datasets.Value("int32"),
|
145 |
-
"flight_number": datasets.Value("int32"),
|
146 |
-
"num_connections": datasets.Value("int32"),
|
147 |
-
"price": datasets.Value("int32"),
|
148 |
-
"return_airport": datasets.Value("string"),
|
149 |
-
"return_day": datasets.Value("string"),
|
150 |
-
"return_month": datasets.Value("string"),
|
151 |
-
"return_time_num": datasets.Value("int32"),
|
152 |
-
},
|
153 |
-
],
|
154 |
-
"reservation": datasets.Value("int32"),
|
155 |
-
}
|
156 |
-
)
|
157 |
-
|
158 |
-
return datasets.DatasetInfo(
|
159 |
-
# This is the description that will appear on the datasets page.
|
160 |
-
description=_DESCRIPTION,
|
161 |
-
# This defines the different columns of the dataset and their types
|
162 |
-
features=features, # Here we define them above because they are different between the two configurations
|
163 |
-
# If there's a common (input, target) tuple from the features,
|
164 |
-
# specify them here. They'll be used if as_supervised=True in
|
165 |
-
# builder.as_dataset.
|
166 |
-
supervised_keys=None,
|
167 |
-
# Homepage of the dataset for documentation
|
168 |
-
homepage=_HOMEPAGE,
|
169 |
-
# License for the dataset if available
|
170 |
-
license=_LICENSE,
|
171 |
-
# Citation for the dataset
|
172 |
-
citation=_CITATION,
|
173 |
-
)
|
174 |
-
|
175 |
-
def _split_generators(self, dl_manager):
|
176 |
-
"""Returns SplitGenerators."""
|
177 |
-
# TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
|
178 |
-
# If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
|
179 |
-
|
180 |
-
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLs
|
181 |
-
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
182 |
-
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
183 |
-
archive = dl_manager.download(_URL)
|
184 |
-
if self.config.name == "air_dialogue_data":
|
185 |
-
train = "airdialogue_data_1.3/airdialogue/train_data.json"
|
186 |
-
dev = "airdialogue_data_1.3/airdialogue/dev_data.json"
|
187 |
-
else:
|
188 |
-
train = "airdialogue_data_1.3/airdialogue/train_kb.json"
|
189 |
-
dev = "airdialogue_data_1.3/airdialogue/dev_kb.json"
|
190 |
-
|
191 |
-
return [
|
192 |
-
datasets.SplitGenerator(
|
193 |
-
name=datasets.Split.TRAIN,
|
194 |
-
# These kwargs will be passed to _generate_examples
|
195 |
-
gen_kwargs={
|
196 |
-
"filepath": train,
|
197 |
-
"files": dl_manager.iter_archive(archive),
|
198 |
-
},
|
199 |
-
),
|
200 |
-
datasets.SplitGenerator(
|
201 |
-
name=datasets.Split.VALIDATION,
|
202 |
-
# These kwargs will be passed to _generate_examples
|
203 |
-
gen_kwargs={
|
204 |
-
"filepath": dev,
|
205 |
-
"files": dl_manager.iter_archive(archive),
|
206 |
-
},
|
207 |
-
),
|
208 |
-
]
|
209 |
-
|
210 |
-
def _generate_examples(self, filepath, files):
|
211 |
-
"""Yields examples."""
|
212 |
-
# TODO: This method will receive as arguments the `gen_kwargs` defined in the previous `_split_generators` method.
|
213 |
-
# It is in charge of opening the given file and yielding (key, example) tuples from the dataset
|
214 |
-
# The key is not important, it's more here for legacy reason (legacy from tfds)
|
215 |
-
|
216 |
-
for path, f in files:
|
217 |
-
if path == filepath:
|
218 |
-
for id_, row in enumerate(f):
|
219 |
-
row = row.decode("utf-8")
|
220 |
-
data = json.loads(row)
|
221 |
-
if self.config.name == "air_dialogue_data":
|
222 |
-
|
223 |
-
intent = {
|
224 |
-
"return_month": data["intent"]["return_month"],
|
225 |
-
"return_day": data["intent"]["return_day"],
|
226 |
-
"max_price": data["intent"]["max_price"],
|
227 |
-
"departure_airport": data["intent"]["departure_airport"],
|
228 |
-
"max_connections": data["intent"].get("max_connections", -1),
|
229 |
-
"departure_day": data["intent"]["departure_day"],
|
230 |
-
"goal": data["intent"]["goal"],
|
231 |
-
"departure_month": data["intent"]["departure_month"],
|
232 |
-
"name": data["intent"]["name"],
|
233 |
-
"return_airport": data["intent"]["return_airport"],
|
234 |
-
}
|
235 |
-
|
236 |
-
search_info = (
|
237 |
-
[]
|
238 |
-
if "search_info" not in data
|
239 |
-
else [
|
240 |
-
{
|
241 |
-
"button_name": search_info.get("button_name", ""),
|
242 |
-
"field_name": search_info.get("field_name", ""),
|
243 |
-
"field_value": search_info.get("field_value", ""),
|
244 |
-
"timestmamp": search_info["timestmamp"],
|
245 |
-
}
|
246 |
-
for search_info in data["search_info"]
|
247 |
-
]
|
248 |
-
)
|
249 |
-
|
250 |
-
yield id_, {
|
251 |
-
"action": {key: data["action"][key] for key in data["action"]},
|
252 |
-
"intent": intent,
|
253 |
-
"timestamps": data["timestamps"],
|
254 |
-
"dialogue": data["dialogue"],
|
255 |
-
"expected_action": {key: data["expected_action"][key] for key in data["expected_action"]},
|
256 |
-
"search_info": search_info,
|
257 |
-
"correct_sample": data["correct_sample"],
|
258 |
-
}
|
259 |
-
|
260 |
-
else:
|
261 |
-
|
262 |
-
kb = [
|
263 |
-
{
|
264 |
-
"airline": kb["airline"],
|
265 |
-
"class": kb["class"],
|
266 |
-
"departure_airport": kb["departure_airport"],
|
267 |
-
"departure_day": kb["departure_day"],
|
268 |
-
"departure_month": kb["departure_month"],
|
269 |
-
"departure_time_num": kb["departure_time_num"],
|
270 |
-
"flight_number": kb["flight_number"],
|
271 |
-
"num_connections": kb["num_connections"],
|
272 |
-
"price": kb["price"],
|
273 |
-
"return_airport": kb["return_airport"],
|
274 |
-
"return_day": kb["return_day"],
|
275 |
-
"return_month": kb["return_month"],
|
276 |
-
"return_time_num": kb["return_time_num"],
|
277 |
-
}
|
278 |
-
for kb in data["kb"]
|
279 |
-
]
|
280 |
-
|
281 |
-
yield id_, {
|
282 |
-
"kb": kb,
|
283 |
-
"reservation": data["reservation"],
|
284 |
-
}
|
285 |
-
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
air_dialogue_data/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3c74c2e1cbf8a7dc23d5eda72de5b5d08973ac987fae5e6b56ca025f90a9f380
|
3 |
+
size 125923111
|
air_dialogue_data/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:037e52ef9ed9d505356831ca81bdfba2e80b52fda42cef44336336422b792836
|
3 |
+
size 15843632
|
air_dialogue_kb/train-00000-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9b376762d6f86a11ae09fc23cdfefe1c06896523bed9ea2442c91d77dcee018a
|
3 |
+
size 25702741
|
air_dialogue_kb/train-00001-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e3cbae4513250578ac8bad84d3238b354c8a262d0d2cfd03f51cb3805aff721
|
3 |
+
size 25719855
|
air_dialogue_kb/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3288acb9d91034831f6ad960fa874eda893f0f7f1e2b3cb0237702177edf5a2d
|
3 |
+
size 6461342
|