Datasets:
Commit
·
0a5561a
0
Parent(s):
Update files from the datasets library (from 1.6.1)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.6.1
- .gitattributes +27 -0
- README.md +263 -0
- dataset_infos.json +1 -0
- dummy/1.1.0/dummy_data.zip +3 -0
- nlu_evaluation_data.py +211 -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,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
extended:
|
5 |
+
- original
|
6 |
+
language_creators:
|
7 |
+
- expert-generated
|
8 |
+
languages:
|
9 |
+
- en
|
10 |
+
licenses:
|
11 |
+
- cc-by-4-0
|
12 |
+
multilinguality:
|
13 |
+
- monolingual
|
14 |
+
size_categories:
|
15 |
+
- 10K<n<100K
|
16 |
+
source_datasets:
|
17 |
+
- original
|
18 |
+
task_categories:
|
19 |
+
- text-classification
|
20 |
+
task_ids:
|
21 |
+
- intent-classification
|
22 |
+
- multi-class-classification
|
23 |
+
---
|
24 |
+
|
25 |
+
# Dataset Card for NLU Evaluation Data
|
26 |
+
|
27 |
+
## Table of Contents
|
28 |
+
- [Dataset Card for NLU Evaluation Data](#dataset-card-for-dataset-name)
|
29 |
+
- [Table of Contents](#table-of-contents)
|
30 |
+
- [Dataset Description](#dataset-description)
|
31 |
+
- [Dataset Summary](#dataset-summary)
|
32 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
33 |
+
- [Languages](#languages)
|
34 |
+
- [Dataset Structure](#dataset-structure)
|
35 |
+
- [Data Instances](#data-instances)
|
36 |
+
- [Data Fields](#data-fields)
|
37 |
+
- [Data Splits](#data-splits)
|
38 |
+
- [Dataset Creation](#dataset-creation)
|
39 |
+
- [Curation Rationale](#curation-rationale)
|
40 |
+
- [Source Data](#source-data)
|
41 |
+
- [Initial Data Collection and Normalization](#initial-data-collection-and-normalization)
|
42 |
+
- [Who are the source language producers?](#who-are-the-source-language-producers)
|
43 |
+
- [Annotations](#annotations)
|
44 |
+
- [Annotation process](#annotation-process)
|
45 |
+
- [Who are the annotators?](#who-are-the-annotators)
|
46 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
47 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
48 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
49 |
+
- [Discussion of Biases](#discussion-of-biases)
|
50 |
+
- [Other Known Limitations](#other-known-limitations)
|
51 |
+
- [Additional Information](#additional-information)
|
52 |
+
- [Dataset Curators](#dataset-curators)
|
53 |
+
- [Licensing Information](#licensing-information)
|
54 |
+
- [Citation Information](#citation-information)
|
55 |
+
- [Contributions](#contributions)
|
56 |
+
|
57 |
+
## Dataset Description
|
58 |
+
|
59 |
+
- **Homepage:** [Github](https://github.com/xliuhw/NLU-Evaluation-Data)
|
60 |
+
- **Repository:** [Github](https://github.com/xliuhw/NLU-Evaluation-Data)
|
61 |
+
- **Paper:** [ArXiv](https://arxiv.org/abs/1903.05566)
|
62 |
+
- **Leaderboard:**
|
63 |
+
- **Point of Contact:** [[email protected]](mailto:[email protected])
|
64 |
+
|
65 |
+
### Dataset Summary
|
66 |
+
|
67 |
+
Dataset with short utterances from conversational domain annotated with their corresponding intents and scenarios.
|
68 |
+
|
69 |
+
It has 25 715 non-zero examples (original dataset has 25716 examples) belonging to 18 scenarios and 68 intents.
|
70 |
+
Originally, the dataset was crowd-sourced and annotated with both intents and named entities
|
71 |
+
in order to evaluate commercial NLU systems such as RASA, IBM's Watson, Microsoft's LUIS and Google's Dialogflow.
|
72 |
+
**This version of the dataset only includes intent annotations!**
|
73 |
+
|
74 |
+
In contrast to paper claims, released data contains 68 unique intents. This is due to the fact, that NLU systems were
|
75 |
+
evaluated on more curated part of this dataset which only included 64 most important intents. Read more in [github issue](https://github.com/xliuhw/NLU-Evaluation-Data/issues/5).
|
76 |
+
|
77 |
+
### Supported Tasks and Leaderboards
|
78 |
+
|
79 |
+
Intent classification, intent detection
|
80 |
+
|
81 |
+
### Languages
|
82 |
+
|
83 |
+
English
|
84 |
+
|
85 |
+
## Dataset Structure
|
86 |
+
|
87 |
+
### Data Instances
|
88 |
+
|
89 |
+
An example of 'train' looks as follows:
|
90 |
+
```
|
91 |
+
{
|
92 |
+
'label': 2, # integer label corresponding to "alarm_set" intent
|
93 |
+
'scenario': 'alarm',
|
94 |
+
'text': 'wake me up at five am this week'
|
95 |
+
}
|
96 |
+
```
|
97 |
+
|
98 |
+
### Data Fields
|
99 |
+
|
100 |
+
- `text`: a string feature.
|
101 |
+
- `label`: one of classification labels (0-67) corresponding to unique intents.
|
102 |
+
- `scenario`: a string with one of unique scenarios (18).
|
103 |
+
|
104 |
+
Intent names are mapped to `label` in the following way:
|
105 |
+
|
106 |
+
| label | intent |
|
107 |
+
|--------:|:-------------------------|
|
108 |
+
| 0 | alarm_query |
|
109 |
+
| 1 | alarm_remove |
|
110 |
+
| 2 | alarm_set |
|
111 |
+
| 3 | audio_volume_down |
|
112 |
+
| 4 | audio_volume_mute |
|
113 |
+
| 5 | audio_volume_other |
|
114 |
+
| 6 | audio_volume_up |
|
115 |
+
| 7 | calendar_query |
|
116 |
+
| 8 | calendar_remove |
|
117 |
+
| 9 | calendar_set |
|
118 |
+
| 10 | cooking_query |
|
119 |
+
| 11 | cooking_recipe |
|
120 |
+
| 12 | datetime_convert |
|
121 |
+
| 13 | datetime_query |
|
122 |
+
| 14 | email_addcontact |
|
123 |
+
| 15 | email_query |
|
124 |
+
| 16 | email_querycontact |
|
125 |
+
| 17 | email_sendemail |
|
126 |
+
| 18 | general_affirm |
|
127 |
+
| 19 | general_commandstop |
|
128 |
+
| 20 | general_confirm |
|
129 |
+
| 21 | general_dontcare |
|
130 |
+
| 22 | general_explain |
|
131 |
+
| 23 | general_greet |
|
132 |
+
| 24 | general_joke |
|
133 |
+
| 25 | general_negate |
|
134 |
+
| 26 | general_praise |
|
135 |
+
| 27 | general_quirky |
|
136 |
+
| 28 | general_repeat |
|
137 |
+
| 29 | iot_cleaning |
|
138 |
+
| 30 | iot_coffee |
|
139 |
+
| 31 | iot_hue_lightchange |
|
140 |
+
| 32 | iot_hue_lightdim |
|
141 |
+
| 33 | iot_hue_lightoff |
|
142 |
+
| 34 | iot_hue_lighton |
|
143 |
+
| 35 | iot_hue_lightup |
|
144 |
+
| 36 | iot_wemo_off |
|
145 |
+
| 37 | iot_wemo_on |
|
146 |
+
| 38 | lists_createoradd |
|
147 |
+
| 39 | lists_query |
|
148 |
+
| 40 | lists_remove |
|
149 |
+
| 41 | music_dislikeness |
|
150 |
+
| 42 | music_likeness |
|
151 |
+
| 43 | music_query |
|
152 |
+
| 44 | music_settings |
|
153 |
+
| 45 | news_query |
|
154 |
+
| 46 | play_audiobook |
|
155 |
+
| 47 | play_game |
|
156 |
+
| 48 | play_music |
|
157 |
+
| 49 | play_podcasts |
|
158 |
+
| 50 | play_radio |
|
159 |
+
| 51 | qa_currency |
|
160 |
+
| 52 | qa_definition |
|
161 |
+
| 53 | qa_factoid |
|
162 |
+
| 54 | qa_maths |
|
163 |
+
| 55 | qa_stock |
|
164 |
+
| 56 | recommendation_events |
|
165 |
+
| 57 | recommendation_locations |
|
166 |
+
| 58 | recommendation_movies |
|
167 |
+
| 59 | social_post |
|
168 |
+
| 60 | social_query |
|
169 |
+
| 61 | takeaway_order |
|
170 |
+
| 62 | takeaway_query |
|
171 |
+
| 63 | transport_query |
|
172 |
+
| 64 | transport_taxi |
|
173 |
+
| 65 | transport_ticket |
|
174 |
+
| 66 | transport_traffic |
|
175 |
+
| 67 | weather_query |
|
176 |
+
|
177 |
+
### Data Splits
|
178 |
+
|
179 |
+
| Dataset statistics | Train |
|
180 |
+
| --- | --- |
|
181 |
+
| Number of examples | 25 715 |
|
182 |
+
| Average character length | 34.32 |
|
183 |
+
| Number of intents | 68 |
|
184 |
+
| Number of scenarios | 18 |
|
185 |
+
|
186 |
+
## Dataset Creation
|
187 |
+
|
188 |
+
### Curation Rationale
|
189 |
+
|
190 |
+
The dataset was prepared for a wide coverage evaluation and comparison of some of the most popular NLU services.
|
191 |
+
At that time, previous benchmarks were done with few intents and spawning limited number of domains. Here, the dataset
|
192 |
+
is much larger and contains 68 intents from 18 scenarios, which is much larger that any previous evaluation. For more discussion see the paper.
|
193 |
+
|
194 |
+
### Source Data
|
195 |
+
|
196 |
+
#### Initial Data Collection and Normalization
|
197 |
+
|
198 |
+
[More Information Needed]
|
199 |
+
|
200 |
+
#### Who are the source language producers?
|
201 |
+
|
202 |
+
[More Information Needed]
|
203 |
+
|
204 |
+
### Annotations
|
205 |
+
|
206 |
+
#### Annotation process
|
207 |
+
|
208 |
+
> To build the NLU component we collected real user data via Amazon Mechanical Turk (AMT). We designed tasks where the Turker’s goal was to answer questions about how people would interact with the home robot, in a wide range of scenarios designed in advance, namely: alarm, audio, audiobook, calendar, cooking, datetime, email, game, general, IoT, lists, music, news, podcasts, general Q&A, radio, recommendations, social, food takeaway, transport, and weather.
|
209 |
+
The questions put to Turkers were designed to capture the different requests within each given scenario.
|
210 |
+
In the ‘calendar’ scenario, for example, these pre-designed intents were included: ‘set event’, ‘delete event’ and ‘query event’.
|
211 |
+
An example question for intent ‘set event’ is: “How would you ask your PDA to schedule a meeting with someone?” for which a user’s answer example was “Schedule a chat with Adam on Thursday afternoon”.
|
212 |
+
The Turkers would then type in their answers to these questions and select possible entities from the pre-designed suggested entities list for each of their answers.The Turkers didn’t always follow the instructions fully, e.g. for the specified ‘delete event’ Intent, an answer was: “PDA what is my next event?”; which clearly belongs to ‘query event’ Intent.
|
213 |
+
We have manually corrected all such errors either during post-processing or the subsequent annotations.
|
214 |
+
|
215 |
+
#### Who are the annotators?
|
216 |
+
|
217 |
+
[More Information Needed]
|
218 |
+
|
219 |
+
### Personal and Sensitive Information
|
220 |
+
|
221 |
+
[More Information Needed]
|
222 |
+
|
223 |
+
## Considerations for Using the Data
|
224 |
+
|
225 |
+
### Social Impact of Dataset
|
226 |
+
|
227 |
+
The purpose of this dataset it to help develop better intent detection systems.
|
228 |
+
|
229 |
+
### Discussion of Biases
|
230 |
+
|
231 |
+
[More Information Needed]
|
232 |
+
|
233 |
+
### Other Known Limitations
|
234 |
+
|
235 |
+
[More Information Needed]
|
236 |
+
|
237 |
+
## Additional Information
|
238 |
+
|
239 |
+
### Dataset Curators
|
240 |
+
|
241 |
+
[More Information Needed]
|
242 |
+
|
243 |
+
### Licensing Information
|
244 |
+
|
245 |
+
Creative Commons Attribution 4.0 International License (CC BY 4.0)
|
246 |
+
|
247 |
+
### Citation Information
|
248 |
+
```
|
249 |
+
@InProceedings{XLiu.etal:IWSDS2019,
|
250 |
+
author = {Xingkun Liu, Arash Eshghi, Pawel Swietojanski and Verena Rieser},
|
251 |
+
title = {Benchmarking Natural Language Understanding Services for building Conversational Agents},
|
252 |
+
booktitle = {Proceedings of the Tenth International Workshop on Spoken Dialogue Systems Technology (IWSDS)},
|
253 |
+
month = {April},
|
254 |
+
year = {2019},
|
255 |
+
address = {Ortigia, Siracusa (SR), Italy},
|
256 |
+
publisher = {Springer},
|
257 |
+
pages = {xxx--xxx},
|
258 |
+
url = {http://www.xx.xx/xx/}
|
259 |
+
}
|
260 |
+
```
|
261 |
+
### Contributions
|
262 |
+
|
263 |
+
Thanks to [@dkajtoch](https://github.com/dkajtoch) for adding this dataset.
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "Raw part of NLU Evaluation Data. It contains 25 715 non-empty examples (original dataset has 25716 examples) from 68 unique intents belonging to 18 scenarios.\n", "citation": "@InProceedings{XLiu.etal:IWSDS2019,\n author = {Xingkun Liu, Arash Eshghi, Pawel Swietojanski and Verena Rieser},\n title = {Benchmarking Natural Language Understanding Services for building Conversational Agents},\n booktitle = {Proceedings of the Tenth International Workshop on Spoken Dialogue Systems Technology (IWSDS)},\n month = {April},\n year = {2019},\n address = {Ortigia, Siracusa (SR), Italy},\n publisher = {Springer},\n pages = {xxx--xxx},\n url = {http://www.xx.xx/xx/}\n}\n", "homepage": "https://github.com/xliuhw/NLU-Evaluation-Data", "license": "Creative Commons Attribution 4.0 International License (CC BY 4.0)", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "scenario": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 68, "names": ["alarm_query", "alarm_remove", "alarm_set", "audio_volume_down", "audio_volume_mute", "audio_volume_other", "audio_volume_up", "calendar_query", "calendar_remove", "calendar_set", "cooking_query", "cooking_recipe", "datetime_convert", "datetime_query", "email_addcontact", "email_query", "email_querycontact", "email_sendemail", "general_affirm", "general_commandstop", "general_confirm", "general_dontcare", "general_explain", "general_greet", "general_joke", "general_negate", "general_praise", "general_quirky", "general_repeat", "iot_cleaning", "iot_coffee", "iot_hue_lightchange", "iot_hue_lightdim", "iot_hue_lightoff", "iot_hue_lighton", "iot_hue_lightup", "iot_wemo_off", "iot_wemo_on", "lists_createoradd", "lists_query", "lists_remove", "music_dislikeness", "music_likeness", "music_query", "music_settings", "news_query", "play_audiobook", "play_game", "play_music", "play_podcasts", "play_radio", "qa_currency", "qa_definition", "qa_factoid", "qa_maths", "qa_stock", "recommendation_events", "recommendation_locations", "recommendation_movies", "social_post", "social_query", "takeaway_order", "takeaway_query", "transport_query", "transport_taxi", "transport_ticket", "transport_traffic", "weather_query"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": {"features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "scenario": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 68, "names": ["alarm_query", "alarm_remove", "alarm_set", "audio_volume_down", "audio_volume_mute", "audio_volume_other", "audio_volume_up", "calendar_query", "calendar_remove", "calendar_set", "cooking_query", "cooking_recipe", "datetime_convert", "datetime_query", "email_addcontact", "email_query", "email_querycontact", "email_sendemail", "general_affirm", "general_commandstop", "general_confirm", "general_dontcare", "general_explain", "general_greet", "general_joke", "general_negate", "general_praise", "general_quirky", "general_repeat", "iot_cleaning", "iot_coffee", "iot_hue_lightchange", "iot_hue_lightdim", "iot_hue_lightoff", "iot_hue_lighton", "iot_hue_lightup", "iot_wemo_off", "iot_wemo_on", "lists_createoradd", "lists_query", "lists_remove", "music_dislikeness", "music_likeness", "music_query", "music_settings", "news_query", "play_audiobook", "play_game", "play_music", "play_podcasts", "play_radio", "qa_currency", "qa_definition", "qa_factoid", "qa_maths", "qa_stock", "recommendation_events", "recommendation_locations", "recommendation_movies", "social_post", "social_query", "takeaway_order", "takeaway_query", "transport_query", "transport_taxi", "transport_ticket", "transport_traffic", "weather_query"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "resources_checksums": {"train": {}}}, "supervised_keys": null, "builder_name": "nlu_evaluation_data", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1447941, "num_examples": 25715, "dataset_name": "nlu_evaluation_data"}}, "download_checksums": {"https://raw.githubusercontent.com/xliuhw/NLU-Evaluation-Data/master/AnnotatedData/NLU-Data-Home-Domain-Annotated-All.csv": {"num_bytes": 5867439, "checksum": "5f6dbf6d38fc111217924945ac59c554e0b926d5aa836ecdd0d089d2ca48e1d9"}}, "download_size": 5867439, "post_processing_size": 0, "dataset_size": 1447941, "size_in_bytes": 7315380}}
|
dummy/1.1.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7595234c33924ea7a7b82eddc561e943b2a279b7636af4e0bdbd98b387329e66
|
3 |
+
size 618
|
nlu_evaluation_data.py
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""NLU Evaluation Data."""
|
16 |
+
|
17 |
+
from __future__ import absolute_import, division, print_function
|
18 |
+
|
19 |
+
import csv
|
20 |
+
import re
|
21 |
+
|
22 |
+
import datasets
|
23 |
+
|
24 |
+
|
25 |
+
logger = datasets.logging.get_logger(__name__)
|
26 |
+
|
27 |
+
|
28 |
+
_CITATION = """\
|
29 |
+
@InProceedings{XLiu.etal:IWSDS2019,
|
30 |
+
author = {Xingkun Liu, Arash Eshghi, Pawel Swietojanski and Verena Rieser},
|
31 |
+
title = {Benchmarking Natural Language Understanding Services for building Conversational Agents},
|
32 |
+
booktitle = {Proceedings of the Tenth International Workshop on Spoken Dialogue Systems Technology (IWSDS)},
|
33 |
+
month = {April},
|
34 |
+
year = {2019},
|
35 |
+
address = {Ortigia, Siracusa (SR), Italy},
|
36 |
+
publisher = {Springer},
|
37 |
+
pages = {xxx--xxx},
|
38 |
+
url = {http://www.xx.xx/xx/}
|
39 |
+
}
|
40 |
+
"""
|
41 |
+
|
42 |
+
# You can copy an official description
|
43 |
+
_DESCRIPTION = """\
|
44 |
+
Raw part of NLU Evaluation Data. It contains 25 715 non-empty examples (original dataset has 25716 examples) from 68 unique intents belonging to 18 scenarios.
|
45 |
+
"""
|
46 |
+
|
47 |
+
_HOMEPAGE = "https://github.com/xliuhw/NLU-Evaluation-Data"
|
48 |
+
|
49 |
+
_LICENSE = "Creative Commons Attribution 4.0 International License (CC BY 4.0)"
|
50 |
+
|
51 |
+
_URL = "https://raw.githubusercontent.com/xliuhw/NLU-Evaluation-Data/master/AnnotatedData/NLU-Data-Home-Domain-Annotated-All.csv"
|
52 |
+
|
53 |
+
ANNOTATION_PATTERN = re.compile(r"\[(.+?)\s+\:+\s(.+?)\]")
|
54 |
+
|
55 |
+
|
56 |
+
def remove_annotations(text):
|
57 |
+
"""Remove named entity annotations from text example.
|
58 |
+
|
59 |
+
Examples are defined based on `answer_annotation` column since it has the least number
|
60 |
+
of Nans. However, this column contains patterns of annotation of the form:
|
61 |
+
|
62 |
+
[named_entity : part_of_text]
|
63 |
+
|
64 |
+
e.g. [time : five am], [date : this week]
|
65 |
+
|
66 |
+
We identity them with regex rule and replace all occurrences with just part_of_text.
|
67 |
+
"""
|
68 |
+
return ANNOTATION_PATTERN.sub(r"\2", text)
|
69 |
+
|
70 |
+
|
71 |
+
def define_intent_name(scenario, intent):
|
72 |
+
"""Intent name is defined as concatenation of `scenario` and `intent`
|
73 |
+
values.
|
74 |
+
|
75 |
+
See Also:
|
76 |
+
https://github.com/xliuhw/NLU-Evaluation-Data/issues/5
|
77 |
+
"""
|
78 |
+
return f"{scenario}_{intent}"
|
79 |
+
|
80 |
+
|
81 |
+
class NLUEvaluationData(datasets.GeneratorBasedBuilder):
|
82 |
+
"""Raw part of NLU Evaluation Data."""
|
83 |
+
|
84 |
+
VERSION = datasets.Version("1.1.0")
|
85 |
+
|
86 |
+
def _info(self):
|
87 |
+
features = datasets.Features(
|
88 |
+
{
|
89 |
+
"text": datasets.Value("string"),
|
90 |
+
"scenario": datasets.Value("string"),
|
91 |
+
"label": datasets.features.ClassLabel(
|
92 |
+
names=[
|
93 |
+
"alarm_query",
|
94 |
+
"alarm_remove",
|
95 |
+
"alarm_set",
|
96 |
+
"audio_volume_down",
|
97 |
+
"audio_volume_mute",
|
98 |
+
"audio_volume_other",
|
99 |
+
"audio_volume_up",
|
100 |
+
"calendar_query",
|
101 |
+
"calendar_remove",
|
102 |
+
"calendar_set",
|
103 |
+
"cooking_query",
|
104 |
+
"cooking_recipe",
|
105 |
+
"datetime_convert",
|
106 |
+
"datetime_query",
|
107 |
+
"email_addcontact",
|
108 |
+
"email_query",
|
109 |
+
"email_querycontact",
|
110 |
+
"email_sendemail",
|
111 |
+
"general_affirm",
|
112 |
+
"general_commandstop",
|
113 |
+
"general_confirm",
|
114 |
+
"general_dontcare",
|
115 |
+
"general_explain",
|
116 |
+
"general_greet",
|
117 |
+
"general_joke",
|
118 |
+
"general_negate",
|
119 |
+
"general_praise",
|
120 |
+
"general_quirky",
|
121 |
+
"general_repeat",
|
122 |
+
"iot_cleaning",
|
123 |
+
"iot_coffee",
|
124 |
+
"iot_hue_lightchange",
|
125 |
+
"iot_hue_lightdim",
|
126 |
+
"iot_hue_lightoff",
|
127 |
+
"iot_hue_lighton",
|
128 |
+
"iot_hue_lightup",
|
129 |
+
"iot_wemo_off",
|
130 |
+
"iot_wemo_on",
|
131 |
+
"lists_createoradd",
|
132 |
+
"lists_query",
|
133 |
+
"lists_remove",
|
134 |
+
"music_dislikeness",
|
135 |
+
"music_likeness",
|
136 |
+
"music_query",
|
137 |
+
"music_settings",
|
138 |
+
"news_query",
|
139 |
+
"play_audiobook",
|
140 |
+
"play_game",
|
141 |
+
"play_music",
|
142 |
+
"play_podcasts",
|
143 |
+
"play_radio",
|
144 |
+
"qa_currency",
|
145 |
+
"qa_definition",
|
146 |
+
"qa_factoid",
|
147 |
+
"qa_maths",
|
148 |
+
"qa_stock",
|
149 |
+
"recommendation_events",
|
150 |
+
"recommendation_locations",
|
151 |
+
"recommendation_movies",
|
152 |
+
"social_post",
|
153 |
+
"social_query",
|
154 |
+
"takeaway_order",
|
155 |
+
"takeaway_query",
|
156 |
+
"transport_query",
|
157 |
+
"transport_taxi",
|
158 |
+
"transport_ticket",
|
159 |
+
"transport_traffic",
|
160 |
+
"weather_query",
|
161 |
+
]
|
162 |
+
),
|
163 |
+
}
|
164 |
+
)
|
165 |
+
|
166 |
+
return datasets.DatasetInfo(
|
167 |
+
description=_DESCRIPTION,
|
168 |
+
features=features,
|
169 |
+
supervised_keys=None,
|
170 |
+
homepage=_HOMEPAGE,
|
171 |
+
license=_LICENSE,
|
172 |
+
citation=_CITATION,
|
173 |
+
)
|
174 |
+
|
175 |
+
def _split_generators(self, dl_manager):
|
176 |
+
"""Returns SplitGenerators."""
|
177 |
+
train_path = dl_manager.download_and_extract(_URL)
|
178 |
+
return [
|
179 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}),
|
180 |
+
]
|
181 |
+
|
182 |
+
def _generate_examples(self, filepath):
|
183 |
+
"""Yields examples as (key, example) tuples."""
|
184 |
+
with open(filepath, encoding="utf-8") as f:
|
185 |
+
csv_reader = csv.reader(f, quotechar='"', delimiter=";", quoting=csv.QUOTE_ALL, skipinitialspace=True)
|
186 |
+
# call next to skip header
|
187 |
+
next(csv_reader)
|
188 |
+
for id_, row in enumerate(csv_reader):
|
189 |
+
(
|
190 |
+
userid,
|
191 |
+
answerid,
|
192 |
+
scenario,
|
193 |
+
intent,
|
194 |
+
status,
|
195 |
+
answer_annotation,
|
196 |
+
notes,
|
197 |
+
suggested_entities,
|
198 |
+
answer_normalised,
|
199 |
+
answer,
|
200 |
+
question,
|
201 |
+
) = row
|
202 |
+
|
203 |
+
# examples with empty answer are removed as part of the dataset
|
204 |
+
if answer_annotation == "null":
|
205 |
+
continue
|
206 |
+
|
207 |
+
yield id_, {
|
208 |
+
"text": remove_annotations(answer_annotation),
|
209 |
+
"scenario": scenario,
|
210 |
+
"label": define_intent_name(scenario, intent),
|
211 |
+
}
|