Datasets:

Languages: English
Multilinguality: monolingual
Size Categories: 1K<n<10K
Language Creators: crowdsourced
Annotations Creators: crowdsourced
Source Datasets: original
Licenses: cc-by-4.0
system commited on
Commit
3adf1ad
0 Parent(s):

Update files from the datasets library (from 1.2.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.2.0

.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
README.md ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - crowdsourced
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - cc-by-4-0
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 1K<n<10K
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - sequence-modeling
18
+ task_ids:
19
+ - dialogue-modeling
20
+ ---
21
+
22
+ # Dataset Card Creation Guide
23
+
24
+ ## Table of Contents
25
+ - [Dataset Description](#dataset-description)
26
+ - [Dataset Summary](#dataset-summary)
27
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
28
+ - [Languages](#languages)
29
+ - [Dataset Structure](#dataset-structure)
30
+ - [Data Instances](#data-instances)
31
+ - [Data Fields](#data-instances)
32
+ - [Data Splits](#data-instances)
33
+ - [Dataset Creation](#dataset-creation)
34
+ - [Curation Rationale](#curation-rationale)
35
+ - [Source Data](#source-data)
36
+ - [Annotations](#annotations)
37
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
38
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
39
+ - [Social Impact of Dataset](#social-impact-of-dataset)
40
+ - [Discussion of Biases](#discussion-of-biases)
41
+ - [Other Known Limitations](#other-known-limitations)
42
+ - [Additional Information](#additional-information)
43
+ - [Dataset Curators](#dataset-curators)
44
+ - [Licensing Information](#licensing-information)
45
+ - [Citation Information](#citation-information)
46
+
47
+ ## Dataset Description
48
+
49
+ - **Homepage:** [Taskmaster-1](https://research.google/tools/datasets/taskmaster-1/)
50
+ - **Repository:** [GitHub](https://github.com/google-research-datasets/Taskmaster/tree/master/TM-1-2019)
51
+ - **Paper:** [Taskmaster-1: Toward a Realistic and Diverse Dialog Dataset](https://arxiv.org/abs/1909.05358)
52
+ - **Leaderboard:** N/A
53
+ - **Point of Contact:** [Taskmaster Googlegroup](taskmaster-datasets@googlegroups.com)
54
+
55
+ ### Dataset Summary
56
+
57
+ Taskmaster-1 is a goal-oriented conversational dataset. It includes 13,215 task-based
58
+ dialogs comprising six domains. Two procedures were used to create this collection,
59
+ each with unique advantages. The first involves a two-person, spoken "Wizard of Oz" (WOz) approach
60
+ in which trained agents and crowdsourced workers interact to complete the task while the second is
61
+ "self-dialog" in which crowdsourced workers write the entire dialog themselves.
62
+
63
+ ### Supported Tasks and Leaderboards
64
+
65
+ [More Information Needed]
66
+
67
+ ### Languages
68
+
69
+ The dataset is in English language.
70
+
71
+ ## Dataset Structure
72
+
73
+ ### Data Instances
74
+
75
+ A typical example looks like this
76
+
77
+ ```
78
+ {
79
+ "conversation_id":"dlg-336c8165-068e-4b4b-803d-18ef0676f668",
80
+ "instruction_id":"restaurant-table-2",
81
+ "utterances":[
82
+ {
83
+ "index":0,
84
+ "segments":[
85
+
86
+ ],
87
+ "speaker":"USER",
88
+ "text":"Hi, I'm looking for a place that sells spicy wet hotdogs, can you think of any?"
89
+ },
90
+ {
91
+ "index":1,
92
+ "segments":[
93
+ {
94
+ "annotations":[
95
+ {
96
+ "name":"restaurant_reservation.name.restaurant.reject"
97
+ }
98
+ ],
99
+ "end_index":37,
100
+ "start_index":16,
101
+ "text":"Spicy Wet Hotdogs LLC"
102
+ }
103
+ ],
104
+ "speaker":"ASSISTANT",
105
+ "text":"You might enjoy Spicy Wet Hotdogs LLC."
106
+ },
107
+ {
108
+ "index":2,
109
+ "segments":[
110
+
111
+ ],
112
+ "speaker":"USER",
113
+ "text":"That sounds really good, can you make me a reservation?"
114
+ },
115
+ {
116
+ "index":3,
117
+ "segments":[
118
+
119
+ ],
120
+ "speaker":"ASSISTANT",
121
+ "text":"Certainly, when would you like a reservation?"
122
+ },
123
+ {
124
+ "index":4,
125
+ "segments":[
126
+ {
127
+ "annotations":[
128
+ {
129
+ "name":"restaurant_reservation.num.guests"
130
+ },
131
+ {
132
+ "name":"restaurant_reservation.num.guests"
133
+ }
134
+ ],
135
+ "end_index":20,
136
+ "start_index":18,
137
+ "text":"50"
138
+ }
139
+ ],
140
+ "speaker":"USER",
141
+ "text":"I have a party of 50 who want a really sloppy dog on Saturday at noon."
142
+ }
143
+ ]
144
+ }
145
+ ```
146
+
147
+ ### Data Fields
148
+
149
+ Each conversation in the data file has the following structure:
150
+
151
+ - `conversation_id`: A universally unique identifier with the prefix 'dlg-'. The ID has no meaning.
152
+ - `utterances`: A list of utterances that make up the conversation.
153
+ - `instruction_id`: A reference to the file(s) containing the user (and, if applicable, agent) instructions for this conversation.
154
+
155
+ Each utterance has the following fields:
156
+
157
+ - `index`: A 0-based index indicating the order of the utterances in the conversation.
158
+ - `speaker`: Either USER or ASSISTANT, indicating which role generated this utterance.
159
+ - `text`: The raw text of the utterance. In case of self dialogs (one_person_dialogs), this is written by the crowdsourced worker. In case of the WOz dialogs, 'ASSISTANT' turns are written and 'USER' turns are transcribed from the spoken recordings of crowdsourced workers.
160
+ - `segments`: A list of various text spans with semantic annotations.
161
+
162
+ Each segment has the following fields:
163
+
164
+ - `start_index`: The position of the start of the annotation in the utterance text.
165
+ - `end_index`: The position of the end of the annotation in the utterance text.
166
+ - `text`: The raw text that has been annotated.
167
+ - `annotations`: A list of annotation details for this segment.
168
+
169
+ Each annotation has a single field:
170
+
171
+ - `name`: The annotation name.
172
+
173
+
174
+
175
+ ### Data Splits
176
+
177
+ - one_person_dialogs
178
+
179
+ The data in `one_person_dialogs` config is split into `train`, `dev` and `test` splits.
180
+
181
+ | | Tain | Valid | Test |
182
+ | ----- | ------ | ----- | ----- |
183
+ | N. Instances | 6168 | 770 | 770 |
184
+
185
+ - woz_dialogs
186
+
187
+ The data in `woz_dialogs` config has no default splits.
188
+
189
+ | | Tain |
190
+ | ----- | ------ |
191
+ | N. Instances | 5507 |
192
+
193
+
194
+ ## Dataset Creation
195
+
196
+ ### Curation Rationale
197
+
198
+ [More Information Needed]
199
+
200
+ ### Source Data
201
+
202
+ [More Information Needed]
203
+
204
+ #### Initial Data Collection and Normalization
205
+
206
+ [More Information Needed]
207
+
208
+ #### Who are the source language producers?
209
+
210
+ [More Information Needed]
211
+
212
+ ### Annotations
213
+
214
+ [More Information Needed]
215
+
216
+ #### Annotation process
217
+
218
+ [More Information Needed]
219
+
220
+ #### Who are the annotators?
221
+
222
+ [More Information Needed]
223
+
224
+ ### Personal and Sensitive Information
225
+
226
+ [More Information Needed]
227
+
228
+ ## Considerations for Using the Data
229
+
230
+ ### Social Impact of Dataset
231
+
232
+ [More Information Needed]
233
+
234
+ ### Discussion of Biases
235
+
236
+ [More Information Needed]
237
+
238
+ ### Other Known Limitations
239
+
240
+ [More Information Needed]
241
+
242
+ ## Additional Information
243
+
244
+ ### Dataset Curators
245
+
246
+ [More Information Needed]
247
+
248
+ ### Licensing Information
249
+
250
+ The dataset is licensed under `Creative Commons Attribution 4.0 License`
251
+
252
+ ### Citation Information
253
+
254
+ [More Information Needed]
255
+ ```
256
+ @inproceedings{48484,
257
+ title = {Taskmaster-1: Toward a Realistic and Diverse Dialog Dataset},
258
+ author = {Bill Byrne and Karthik Krishnamoorthi and Chinnadhurai Sankar and Arvind Neelakantan and Daniel Duckworth and Semih Yavuz and Ben Goodrich and Amit Dubey and Kyu-Young Kim and Andy Cedilnik},
259
+ year = {2019}
260
+ }
261
+ ```
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"one_person_dialogs": {"description": "Taskmaster-1:Toward a Realistic and Diverse Dialog Dataset) is an evaluation set for commonsense question-answering in the sentence completion style of SWAG. As opposed to other automatically generated NLI datasets, CODAH is adversarially constructed by humans who can view feedback from a pre-trained model and use this information to design challenging commonsense questions. Our experimental results show that CODAH questions present a complementary extension to the SWAG dataset, testing additional modes of common sense.\n", "citation": "@inproceedings{48484,\ntitle\t= {Taskmaster-1: Toward a Realistic and Diverse Dialog Dataset},\nauthor\t= {Bill Byrne and Karthik Krishnamoorthi and Chinnadhurai Sankar and Arvind Neelakantan and Daniel Duckworth and Semih Yavuz and Ben Goodrich and Amit Dubey and Kyu-Young Kim and Andy Cedilnik},\nyear\t= {2019}\n}\n", "homepage": "https://github.com/google-research-datasets/Taskmaster", "license": "", "features": {"conversation_id": {"dtype": "string", "id": null, "_type": "Value"}, "instruction_id": {"dtype": "string", "id": null, "_type": "Value"}, "utterances": [{"index": {"dtype": "int32", "id": null, "_type": "Value"}, "speaker": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "segments": [{"start_index": {"dtype": "int32", "id": null, "_type": "Value"}, "end_index": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "annotations": [{"name": {"dtype": "string", "id": null, "_type": "Value"}}]}]}]}, "post_processed": null, "supervised_keys": null, "builder_name": "taskmaster1", "config_name": "one_person_dialogs", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 18037058, "num_examples": 6168, "dataset_name": "taskmaster1"}, "validation": {"name": "validation", "num_bytes": 2239656, "num_examples": 770, "dataset_name": "taskmaster1"}, "test": {"name": "test", "num_bytes": 2224163, "num_examples": 770, "dataset_name": "taskmaster1"}}, "download_checksums": {"https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/self-dialogs.json": {"num_bytes": 65748638, "checksum": "1e590ed0ccee279e40c2fb9e083d3b9417477c6bfe35ce5b2277167698dd858d"}, "https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/woz-dialogs.json": {"num_bytes": 37204053, "checksum": "cd3bc4e968487315d412c044d30af2bf0a4b33c3ef8b74c589f1e1fa832bf72f"}, "https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/train-dev-test/train.csv": {"num_bytes": 259056, "checksum": "88e48f53524ed123dfc57733ccc23f80e176d1e057d7ea46a62a01ddce02626e"}, "https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/train-dev-test/dev.csv": {"num_bytes": 32340, "checksum": "d83a6f413f45e01b376d611aadf07fd0fc49f6cedffb4ffff7e7b1f8393c13bf"}, "https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/train-dev-test/test.csv": {"num_bytes": 32340, "checksum": "1938698dc98b71c5256c05da092dff0d4f9eff224ec413b3c3eed57bc0bca928"}}, "download_size": 103276427, "post_processing_size": null, "dataset_size": 22500877, "size_in_bytes": 125777304}, "woz_dialogs": {"description": "Taskmaster-1:Toward a Realistic and Diverse Dialog Dataset) is an evaluation set for commonsense question-answering in the sentence completion style of SWAG. As opposed to other automatically generated NLI datasets, CODAH is adversarially constructed by humans who can view feedback from a pre-trained model and use this information to design challenging commonsense questions. Our experimental results show that CODAH questions present a complementary extension to the SWAG dataset, testing additional modes of common sense.\n", "citation": "@inproceedings{48484,\ntitle\t= {Taskmaster-1: Toward a Realistic and Diverse Dialog Dataset},\nauthor\t= {Bill Byrne and Karthik Krishnamoorthi and Chinnadhurai Sankar and Arvind Neelakantan and Daniel Duckworth and Semih Yavuz and Ben Goodrich and Amit Dubey and Kyu-Young Kim and Andy Cedilnik},\nyear\t= {2019}\n}\n", "homepage": "https://github.com/google-research-datasets/Taskmaster", "license": "", "features": {"conversation_id": {"dtype": "string", "id": null, "_type": "Value"}, "instruction_id": {"dtype": "string", "id": null, "_type": "Value"}, "utterances": [{"index": {"dtype": "int32", "id": null, "_type": "Value"}, "speaker": {"dtype": "string", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "segments": [{"start_index": {"dtype": "int32", "id": null, "_type": "Value"}, "end_index": {"dtype": "int32", "id": null, "_type": "Value"}, "text": {"dtype": "string", "id": null, "_type": "Value"}, "annotations": [{"name": {"dtype": "string", "id": null, "_type": "Value"}}]}]}]}, "post_processed": null, "supervised_keys": null, "builder_name": "taskmaster1", "config_name": "woz_dialogs", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 13028593, "num_examples": 5507, "dataset_name": "taskmaster1"}}, "download_checksums": {"https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/self-dialogs.json": {"num_bytes": 65748638, "checksum": "1e590ed0ccee279e40c2fb9e083d3b9417477c6bfe35ce5b2277167698dd858d"}, "https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/woz-dialogs.json": {"num_bytes": 37204053, "checksum": "cd3bc4e968487315d412c044d30af2bf0a4b33c3ef8b74c589f1e1fa832bf72f"}, "https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/train-dev-test/train.csv": {"num_bytes": 259056, "checksum": "88e48f53524ed123dfc57733ccc23f80e176d1e057d7ea46a62a01ddce02626e"}, "https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/train-dev-test/dev.csv": {"num_bytes": 32340, "checksum": "d83a6f413f45e01b376d611aadf07fd0fc49f6cedffb4ffff7e7b1f8393c13bf"}, "https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/train-dev-test/test.csv": {"num_bytes": 32340, "checksum": "1938698dc98b71c5256c05da092dff0d4f9eff224ec413b3c3eed57bc0bca928"}}, "download_size": 103276427, "post_processing_size": null, "dataset_size": 13028593, "size_in_bytes": 116305020}}
dummy/one_person_dialogs/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:616e157a7912b67b9ec922e865f9c015c103cd439ddbb57249d6bda9f2677e30
3
+ size 5620
dummy/woz_dialogs/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2f608b60c542beec744ab41452e862f6d5aad73c7abb1dee14e717bef8edaa1
3
+ size 5669
taskmaster1.py ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """Taskmaster-1:Toward a Realistic and Diverse Dialog Dataset"""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import json
20
+
21
+ import datasets
22
+
23
+
24
+ _CITATION = """\
25
+ @inproceedings{48484,
26
+ title = {Taskmaster-1: Toward a Realistic and Diverse Dialog Dataset},
27
+ author = {Bill Byrne and Karthik Krishnamoorthi and Chinnadhurai Sankar and Arvind Neelakantan and Daniel Duckworth and Semih Yavuz and Ben Goodrich and Amit Dubey and Kyu-Young Kim and Andy Cedilnik},
28
+ year = {2019}
29
+ }
30
+ """
31
+
32
+ _DESCRIPTION = """\
33
+ Taskmaster-1 is a goal-oriented conversational dataset. It includes 13,215 task-based \
34
+ dialogs comprising six domains. Two procedures were used to create this collection, \
35
+ each with unique advantages. The first involves a two-person, spoken "Wizard of Oz" (WOz) approach \
36
+ in which trained agents and crowdsourced workers interact to complete the task while the second is \
37
+ "self-dialog" in which crowdsourced workers write the entire dialog themselves.
38
+ """
39
+
40
+ _HOMEPAGE = "https://github.com/google-research-datasets/Taskmaster"
41
+
42
+ _BASE_URL = "https://raw.githubusercontent.com/google-research-datasets/Taskmaster/master/TM-1-2019/"
43
+ _DIALOGS_URLS = {
44
+ "one_person_dialogs": _BASE_URL + "self-dialogs.json",
45
+ "woz_dialogs": _BASE_URL + "woz-dialogs.json",
46
+ }
47
+ _SPLIT_IDS_URLS = {
48
+ "train": _BASE_URL + "train-dev-test/train.csv",
49
+ "dev": _BASE_URL + "train-dev-test/dev.csv",
50
+ "test": _BASE_URL + "train-dev-test/test.csv",
51
+ }
52
+
53
+
54
+ class Taskmaster1(datasets.GeneratorBasedBuilder):
55
+ """Taskmaster-1:Toward a Realistic and Diverse Dialog Dataset"""
56
+
57
+ VERSION = datasets.Version("1.0.0")
58
+ BUILDER_CONFIGS = [
59
+ datasets.BuilderConfig(
60
+ name="one_person_dialogs", version=datasets.Version("1.0.0"), description="Taskmaster-1 one-person dialogs"
61
+ ),
62
+ datasets.BuilderConfig(
63
+ name="woz_dialogs", version=datasets.Version("1.0.0"), description="Taskmaster-1 WOz style dialogs"
64
+ ),
65
+ ]
66
+
67
+ def _info(self):
68
+ features = {
69
+ "conversation_id": datasets.Value("string"),
70
+ "instruction_id": datasets.Value("string"),
71
+ "utterances": [
72
+ {
73
+ "index": datasets.Value("int32"),
74
+ "speaker": datasets.Value("string"),
75
+ "text": datasets.Value("string"),
76
+ "segments": [
77
+ {
78
+ "start_index": datasets.Value("int32"),
79
+ "end_index": datasets.Value("int32"),
80
+ "text": datasets.Value("string"),
81
+ "annotations": [{"name": datasets.Value("string")}],
82
+ }
83
+ ],
84
+ }
85
+ ],
86
+ }
87
+ return datasets.DatasetInfo(
88
+ description=_DESCRIPTION,
89
+ features=datasets.Features(features),
90
+ supervised_keys=None,
91
+ homepage=_HOMEPAGE,
92
+ citation=_CITATION,
93
+ )
94
+
95
+ def _split_generators(self, dl_manager):
96
+ dialog_files = dl_manager.download(_DIALOGS_URLS)
97
+ split_id_files = dl_manager.download(_SPLIT_IDS_URLS)
98
+
99
+ if self.config.name == "woz_dialogs":
100
+ return [
101
+ datasets.SplitGenerator(
102
+ name=datasets.Split.TRAIN,
103
+ gen_kwargs={"filepath": dialog_files["woz_dialogs"], "split_ids_filepath": None},
104
+ )
105
+ ]
106
+
107
+ dialogs_file = dialog_files["one_person_dialogs"]
108
+ return [
109
+ datasets.SplitGenerator(
110
+ name=datasets.Split.TRAIN,
111
+ gen_kwargs={"filepath": dialogs_file, "split_ids_filepath": split_id_files["train"]},
112
+ ),
113
+ datasets.SplitGenerator(
114
+ name=datasets.Split.VALIDATION,
115
+ gen_kwargs={"filepath": dialogs_file, "split_ids_filepath": split_id_files["dev"]},
116
+ ),
117
+ datasets.SplitGenerator(
118
+ name=datasets.Split.TEST,
119
+ gen_kwargs={"filepath": dialogs_file, "split_ids_filepath": split_id_files["test"]},
120
+ ),
121
+ ]
122
+
123
+ def _generate_examples(self, filepath, split_ids_filepath):
124
+ if self.config.name == "one_person_dialogs":
125
+ with open(split_ids_filepath, encoding="utf-8") as f:
126
+ ids = f.read().replace(",", "").split("\n")[:-1]
127
+
128
+ with open(filepath, encoding="utf-8") as f:
129
+ dialogs = json.load(f)
130
+
131
+ if self.config.name == "one_person_dialogs":
132
+ dialogs = [dialog for dialog in dialogs if dialog["conversation_id"] in ids]
133
+
134
+ for dialog in dialogs:
135
+ utterances = dialog["utterances"]
136
+ for utterance in utterances:
137
+ if "segments" not in utterance:
138
+ utterance["segments"] = []
139
+ yield dialog["conversation_id"], dialog