Sebastian Gehrmann
commited on
Commit
•
6f0f662
1
Parent(s):
7042afa
- dataset_infos.json +1 -188
- schema_guided_dialog.py +26 -4
dataset_infos.json
CHANGED
@@ -1,188 +1 @@
|
|
1 |
-
{
|
2 |
-
"schema_guided_dialog": {
|
3 |
-
"description": "GEM is a benchmark environment for Natural Language Generation with a focus on its Evaluation,\nboth through human annotations and automated Metrics.\n\nGEM aims to:\n- measure NLG progress across 13 datasets spanning many NLG tasks and languages.\n- provide an in-depth analysis of data and models presented via data statements and challenge sets.\n- develop standards for evaluation of generated text using both automated and human metrics.\n\nIt is our goal to regularly update GEM and to encourage toward more inclusive practices in dataset development\nby extending existing data or developing datasets for additional languages.\n",
|
4 |
-
"citation": "@article{gem_benchmark,\n author = {Sebastian Gehrmann and\n Tosin P. Adewumi and\n Karmanya Aggarwal and\n Pawan Sasanka Ammanamanchi and\n Aremu Anuoluwapo and\n Antoine Bosselut and\n Khyathi Raghavi Chandu and\n Miruna{-}Adriana Clinciu and\n Dipanjan Das and\n Kaustubh D. Dhole and\n Wanyu Du and\n Esin Durmus and\n Ondrej Dusek and\n Chris Emezue and\n Varun Gangal and\n Cristina Garbacea and\n Tatsunori Hashimoto and\n Yufang Hou and\n Yacine Jernite and\n Harsh Jhamtani and\n Yangfeng Ji and\n Shailza Jolly and\n Dhruv Kumar and\n Faisal Ladhak and\n Aman Madaan and\n Mounica Maddela and\n Khyati Mahajan and\n Saad Mahamood and\n Bodhisattwa Prasad Majumder and\n Pedro Henrique Martins and\n Angelina McMillan{-}Major and\n Simon Mille and\n Emiel van Miltenburg and\n Moin Nadeem and\n Shashi Narayan and\n Vitaly Nikolaev and\n Rubungo Andre Niyongabo and\n Salomey Osei and\n Ankur P. Parikh and\n Laura Perez{-}Beltrachini and\n Niranjan Ramesh Rao and\n Vikas Raunak and\n Juan Diego Rodriguez and\n Sashank Santhanam and\n Joao Sedoc and\n Thibault Sellam and\n Samira Shaikh and\n Anastasia Shimorina and\n Marco Antonio Sobrevilla Cabezudo and\n Hendrik Strobelt and\n Nishant Subramani and\n Wei Xu and\n Diyi Yang and\n Akhila Yerukola and\n Jiawei Zhou},\n title = {The {GEM} Benchmark: Natural Language Generation, its Evaluation and\n Metrics},\n journal = {CoRR},\n volume = {abs/2102.01672},\n year = {2021},\n url = {https://arxiv.org/abs/2102.01672},\n archivePrefix = {arXiv},\n eprint = {2102.01672}\n}\n",
|
5 |
-
"homepage": "https://gem-benchmark.github.io/",
|
6 |
-
"license": "CC-BY-SA-4.0",
|
7 |
-
"features": {
|
8 |
-
"gem_id": {
|
9 |
-
"dtype": "string",
|
10 |
-
"id": null,
|
11 |
-
"_type": "Value"
|
12 |
-
},
|
13 |
-
"gem_parent_id": {
|
14 |
-
"dtype": "string",
|
15 |
-
"id": null,
|
16 |
-
"_type": "Value"
|
17 |
-
},
|
18 |
-
"dialog_acts": [
|
19 |
-
{
|
20 |
-
"act": {
|
21 |
-
"num_classes": 18,
|
22 |
-
"names": [
|
23 |
-
"AFFIRM",
|
24 |
-
"AFFIRM_INTENT",
|
25 |
-
"CONFIRM",
|
26 |
-
"GOODBYE",
|
27 |
-
"INFORM",
|
28 |
-
"INFORM_COUNT",
|
29 |
-
"INFORM_INTENT",
|
30 |
-
"NEGATE",
|
31 |
-
"NEGATE_INTENT",
|
32 |
-
"NOTIFY_FAILURE",
|
33 |
-
"NOTIFY_SUCCESS",
|
34 |
-
"OFFER",
|
35 |
-
"OFFER_INTENT",
|
36 |
-
"REQUEST",
|
37 |
-
"REQUEST_ALTS",
|
38 |
-
"REQ_MORE",
|
39 |
-
"SELECT",
|
40 |
-
"THANK_YOU"
|
41 |
-
],
|
42 |
-
"names_file": null,
|
43 |
-
"id": null,
|
44 |
-
"_type": "ClassLabel"
|
45 |
-
},
|
46 |
-
"slot": {
|
47 |
-
"dtype": "string",
|
48 |
-
"id": null,
|
49 |
-
"_type": "Value"
|
50 |
-
},
|
51 |
-
"values": [
|
52 |
-
{
|
53 |
-
"dtype": "string",
|
54 |
-
"id": null,
|
55 |
-
"_type": "Value"
|
56 |
-
}
|
57 |
-
]
|
58 |
-
}
|
59 |
-
],
|
60 |
-
"context": [
|
61 |
-
{
|
62 |
-
"dtype": "string",
|
63 |
-
"id": null,
|
64 |
-
"_type": "Value"
|
65 |
-
}
|
66 |
-
],
|
67 |
-
"dialog_id": {
|
68 |
-
"dtype": "string",
|
69 |
-
"id": null,
|
70 |
-
"_type": "Value"
|
71 |
-
},
|
72 |
-
"service": {
|
73 |
-
"dtype": "string",
|
74 |
-
"id": null,
|
75 |
-
"_type": "Value"
|
76 |
-
},
|
77 |
-
"turn_id": {
|
78 |
-
"dtype": "int32",
|
79 |
-
"id": null,
|
80 |
-
"_type": "Value"
|
81 |
-
},
|
82 |
-
"prompt": {
|
83 |
-
"dtype": "string",
|
84 |
-
"id": null,
|
85 |
-
"_type": "Value"
|
86 |
-
},
|
87 |
-
"target": {
|
88 |
-
"dtype": "string",
|
89 |
-
"id": null,
|
90 |
-
"_type": "Value"
|
91 |
-
},
|
92 |
-
"references": [
|
93 |
-
{
|
94 |
-
"dtype": "string",
|
95 |
-
"id": null,
|
96 |
-
"_type": "Value"
|
97 |
-
}
|
98 |
-
]
|
99 |
-
},
|
100 |
-
"post_processed": null,
|
101 |
-
"supervised_keys": null,
|
102 |
-
"builder_name": "gem",
|
103 |
-
"config_name": "schema_guided_dialog",
|
104 |
-
"version": {
|
105 |
-
"version_str": "1.1.0",
|
106 |
-
"description": null,
|
107 |
-
"major": 1,
|
108 |
-
"minor": 1,
|
109 |
-
"patch": 0
|
110 |
-
},
|
111 |
-
"splits": {
|
112 |
-
"train": {
|
113 |
-
"name": "train",
|
114 |
-
"num_bytes": 146648117,
|
115 |
-
"num_examples": 164982,
|
116 |
-
"dataset_name": "gem"
|
117 |
-
},
|
118 |
-
"validation": {
|
119 |
-
"name": "validation",
|
120 |
-
"num_bytes": 9376504,
|
121 |
-
"num_examples": 10000,
|
122 |
-
"dataset_name": "gem"
|
123 |
-
},
|
124 |
-
"test": {
|
125 |
-
"name": "test",
|
126 |
-
"num_bytes": 10160596,
|
127 |
-
"num_examples": 10000,
|
128 |
-
"dataset_name": "gem"
|
129 |
-
},
|
130 |
-
"challenge_train_sample": {
|
131 |
-
"name": "challenge_train_sample",
|
132 |
-
"num_bytes": 441326,
|
133 |
-
"num_examples": 500,
|
134 |
-
"dataset_name": "gem"
|
135 |
-
},
|
136 |
-
"challenge_validation_sample": {
|
137 |
-
"name": "challenge_validation_sample",
|
138 |
-
"num_bytes": 491492,
|
139 |
-
"num_examples": 500,
|
140 |
-
"dataset_name": "gem"
|
141 |
-
},
|
142 |
-
"challenge_test_backtranslation": {
|
143 |
-
"name": "challenge_test_backtranslation",
|
144 |
-
"num_bytes": 512834,
|
145 |
-
"num_examples": 500,
|
146 |
-
"dataset_name": "gem"
|
147 |
-
},
|
148 |
-
"challenge_test_bfp02": {
|
149 |
-
"name": "challenge_test_bfp02",
|
150 |
-
"num_bytes": 529404,
|
151 |
-
"num_examples": 500,
|
152 |
-
"dataset_name": "gem"
|
153 |
-
},
|
154 |
-
"challenge_test_bfp05": {
|
155 |
-
"name": "challenge_test_bfp05",
|
156 |
-
"num_bytes": 515151,
|
157 |
-
"num_examples": 500,
|
158 |
-
"dataset_name": "gem"
|
159 |
-
},
|
160 |
-
"challenge_test_nopunc": {
|
161 |
-
"name": "challenge_test_nopunc",
|
162 |
-
"num_bytes": 509332,
|
163 |
-
"num_examples": 500,
|
164 |
-
"dataset_name": "gem"
|
165 |
-
},
|
166 |
-
"challenge_test_scramble": {
|
167 |
-
"name": "challenge_test_scramble",
|
168 |
-
"num_bytes": 514644,
|
169 |
-
"num_examples": 500,
|
170 |
-
"dataset_name": "gem"
|
171 |
-
}
|
172 |
-
},
|
173 |
-
"download_checksums": {
|
174 |
-
"https://storage.googleapis.com/huggingface-nlp/datasets/gem/gem_sgd_context.zip": {
|
175 |
-
"num_bytes": 16544230,
|
176 |
-
"checksum": "abb2af00031152dbead4a75275dc195a576005529cc19b7f942669f5d257ef30"
|
177 |
-
},
|
178 |
-
"https://storage.googleapis.com/huggingface-nlp/datasets/gem/gem_challenge_sets/schema_guided_dialog.zip": {
|
179 |
-
"num_bytes": 1282238,
|
180 |
-
"checksum": "79231851df998a9dc2a1298f8061cf7e9e9ad0b1ea34f7e5124eb31960a4b842"
|
181 |
-
}
|
182 |
-
},
|
183 |
-
"download_size": 17826468,
|
184 |
-
"post_processing_size": null,
|
185 |
-
"dataset_size": 169699400,
|
186 |
-
"size_in_bytes": 187525868
|
187 |
-
}
|
188 |
-
}
|
|
|
1 |
+
{"schema_guided_dialog": {"description": "GEM is a benchmark environment for Natural Language Generation with a focus on its Evaluation,\nboth through human annotations and automated Metrics.\n\nGEM aims to:\n- measure NLG progress across 13 datasets spanning many NLG tasks and languages.\n- provide an in-depth analysis of data and models presented via data statements and challenge sets.\n- develop standards for evaluation of generated text using both automated and human metrics.\n\nIt is our goal to regularly update GEM and to encourage toward more inclusive practices in dataset development\nby extending existing data or developing datasets for additional languages.\n", "citation": "@article{gem_benchmark,\n author = {Sebastian Gehrmann and\n Tosin P. Adewumi and\n Karmanya Aggarwal and\n Pawan Sasanka Ammanamanchi and\n Aremu Anuoluwapo and\n Antoine Bosselut and\n Khyathi Raghavi Chandu and\n Miruna{-}Adriana Clinciu and\n Dipanjan Das and\n Kaustubh D. Dhole and\n Wanyu Du and\n Esin Durmus and\n Ondrej Dusek and\n Chris Emezue and\n Varun Gangal and\n Cristina Garbacea and\n Tatsunori Hashimoto and\n Yufang Hou and\n Yacine Jernite and\n Harsh Jhamtani and\n Yangfeng Ji and\n Shailza Jolly and\n Dhruv Kumar and\n Faisal Ladhak and\n Aman Madaan and\n Mounica Maddela and\n Khyati Mahajan and\n Saad Mahamood and\n Bodhisattwa Prasad Majumder and\n Pedro Henrique Martins and\n Angelina McMillan{-}Major and\n Simon Mille and\n Emiel van Miltenburg and\n Moin Nadeem and\n Shashi Narayan and\n Vitaly Nikolaev and\n Rubungo Andre Niyongabo and\n Salomey Osei and\n Ankur P. Parikh and\n Laura Perez{-}Beltrachini and\n Niranjan Ramesh Rao and\n Vikas Raunak and\n Juan Diego Rodriguez and\n Sashank Santhanam and\n Joao Sedoc and\n Thibault Sellam and\n Samira Shaikh and\n Anastasia Shimorina and\n Marco Antonio Sobrevilla Cabezudo and\n Hendrik Strobelt and\n Nishant Subramani and\n Wei Xu and\n Diyi Yang and\n Akhila Yerukola and\n Jiawei Zhou},\n title = {The {GEM} Benchmark: Natural Language Generation, its Evaluation and\n Metrics},\n journal = {CoRR},\n volume = {abs/2102.01672},\n year = {2021},\n url = {https://arxiv.org/abs/2102.01672},\n archivePrefix = {arXiv},\n eprint = {2102.01672}\n}\n", "homepage": "https://gem-benchmark.github.io/", "license": "CC-BY-SA-4.0", "features": {"gem_id": {"dtype": "string", "id": null, "_type": "Value"}, "gem_parent_id": {"dtype": "string", "id": null, "_type": "Value"}, "dialog_acts": [{"act": {"num_classes": 18, "names": ["AFFIRM", "AFFIRM_INTENT", "CONFIRM", "GOODBYE", "INFORM", "INFORM_COUNT", "INFORM_INTENT", "NEGATE", "NEGATE_INTENT", "NOTIFY_FAILURE", "NOTIFY_SUCCESS", "OFFER", "OFFER_INTENT", "REQUEST", "REQUEST_ALTS", "REQ_MORE", "SELECT", "THANK_YOU"], "id": null, "_type": "ClassLabel"}, "slot": {"dtype": "string", "id": null, "_type": "Value"}, "values": [{"dtype": "string", "id": null, "_type": "Value"}]}], "context": [{"dtype": "string", "id": null, "_type": "Value"}], "dialog_id": {"dtype": "string", "id": null, "_type": "Value"}, "service": {"dtype": "string", "id": null, "_type": "Value"}, "turn_id": {"dtype": "int32", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"dtype": "string", "id": null, "_type": "Value"}, "references": [{"dtype": "string", "id": null, "_type": "Value"}]}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "gem", "config_name": "schema_guided_dialog", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 146648117, "num_examples": 164982, "dataset_name": "gem"}, "validation": {"name": "validation", "num_bytes": 9376504, "num_examples": 10000, "dataset_name": "gem"}, "test": {"name": "test", "num_bytes": 10160596, "num_examples": 10000, "dataset_name": "gem"}, "challenge_train_sample": {"name": "challenge_train_sample", "num_bytes": 441326, "num_examples": 500, "dataset_name": "gem"}, "challenge_validation_sample": {"name": "challenge_validation_sample", "num_bytes": 491492, "num_examples": 500, "dataset_name": "gem"}, "challenge_test_backtranslation": {"name": "challenge_test_backtranslation", "num_bytes": 512834, "num_examples": 500, "dataset_name": "gem"}, "challenge_test_bfp02": {"name": "challenge_test_bfp02", "num_bytes": 529404, "num_examples": 500, "dataset_name": "gem"}, "challenge_test_bfp05": {"name": "challenge_test_bfp05", "num_bytes": 515151, "num_examples": 500, "dataset_name": "gem"}, "challenge_test_nopunc": {"name": "challenge_test_nopunc", "num_bytes": 509332, "num_examples": 500, "dataset_name": "gem"}, "challenge_test_scramble": {"name": "challenge_test_scramble", "num_bytes": 514644, "num_examples": 500, "dataset_name": "gem"}}, "download_checksums": {"https://storage.googleapis.com/huggingface-nlp/datasets/gem/gem_sgd_context.zip": {"num_bytes": 16544230, "checksum": "abb2af00031152dbead4a75275dc195a576005529cc19b7f942669f5d257ef30"}, "https://storage.googleapis.com/huggingface-nlp/datasets/gem/gem_challenge_sets/schema_guided_dialog.zip": {"num_bytes": 1282238, "checksum": "79231851df998a9dc2a1298f8061cf7e9e9ad0b1ea34f7e5124eb31960a4b842"}}, "download_size": 17826468, "post_processing_size": null, "dataset_size": 169699400, "size_in_bytes": 187525868}, "default": {"description": "The Schema-Guided Dialogue (SGD) dataset contains 18K multi-domain task-oriented\ndialogues between a human and a virtual assistant, which covers 17 domains\nranging from banks and events to media, calendar, travel, and weather. The\nlanguage presents in the datset is only English. The SGD dataset provides a\nchallenging testbed for a number of tasks in task-oriented dialogue, including\nlanguage understanding, slot filling, dialogue state tracking and response\ngeneration. For the creation of the SGD dataset, they developed a multi-domain\ndialogue simulator that generates dialogue outlines over an arbitrary combination\nof APIs, dialogue states and system actions. Then, they used a crowd-sourcing\nprocedure to paraphrase these outlines to natural language utterances. This novel\ncrowd-sourcing procedure preserves all annotations obtained from the simulator and\ndoes not require any extra annotations after dialogue collection.\n\n", "citation": "@inproceedings{rastogi2020towards,\n title={Towards scalable multi-domain conversational agents: The schema-guided dialogue dataset},\n author={Rastogi, Abhinav and Zang, Xiaoxue and Sunkara, Srinivas and Gupta, Raghav and Khaitan, Pranav},\n booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},\n volume={34},\n number={05},\n pages={8689--8696},\n year={2020}\n}\n", "homepage": "", "license": "", "features": {"gem_id": {"dtype": "string", "id": null, "_type": "Value"}, "gem_parent_id": {"dtype": "string", "id": null, "_type": "Value"}, "dialog_acts": [{"act": {"num_classes": 18, "names": ["AFFIRM", "AFFIRM_INTENT", "CONFIRM", "GOODBYE", "INFORM", "INFORM_COUNT", "INFORM_INTENT", "NEGATE", "NEGATE_INTENT", "NOTIFY_FAILURE", "NOTIFY_SUCCESS", "OFFER", "OFFER_INTENT", "REQUEST", "REQUEST_ALTS", "REQ_MORE", "SELECT", "THANK_YOU"], "id": null, "_type": "ClassLabel"}, "slot": {"dtype": "string", "id": null, "_type": "Value"}, "values": [{"dtype": "string", "id": null, "_type": "Value"}]}], "context": [{"dtype": "string", "id": null, "_type": "Value"}], "dialog_id": {"dtype": "string", "id": null, "_type": "Value"}, "service": {"dtype": "string", "id": null, "_type": "Value"}, "turn_id": {"dtype": "int32", "id": null, "_type": "Value"}, "prompt": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"dtype": "string", "id": null, "_type": "Value"}, "references": [{"dtype": "string", "id": null, "_type": "Value"}], "linearized_input": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "schema_guided_dialog", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 189823851, "num_examples": 164982, "dataset_name": "schema_guided_dialog"}, "validation": {"name": "validation", "num_bytes": 11342250, "num_examples": 10000, "dataset_name": "schema_guided_dialog"}, "test": {"name": "test", "num_bytes": 12125104, "num_examples": 10000, "dataset_name": "schema_guided_dialog"}, "challenge_train_sample": {"name": "challenge_train_sample", "num_bytes": 540672, "num_examples": 500, "dataset_name": "schema_guided_dialog"}, "challenge_validation_sample": {"name": "challenge_validation_sample", "num_bytes": 591290, "num_examples": 500, "dataset_name": "schema_guided_dialog"}, "challenge_test_backtranslation": {"name": "challenge_test_backtranslation", "num_bytes": 609480, "num_examples": 500, "dataset_name": "schema_guided_dialog"}, "challenge_test_bfp02": {"name": "challenge_test_bfp02", "num_bytes": 630597, "num_examples": 500, "dataset_name": "schema_guided_dialog"}, "challenge_test_bfp05": {"name": "challenge_test_bfp05", "num_bytes": 611891, "num_examples": 500, "dataset_name": "schema_guided_dialog"}, "challenge_test_nopunc": {"name": "challenge_test_nopunc", "num_bytes": 613410, "num_examples": 500, "dataset_name": "schema_guided_dialog"}, "challenge_test_scramble": {"name": "challenge_test_scramble", "num_bytes": 615233, "num_examples": 500, "dataset_name": "schema_guided_dialog"}}, "download_checksums": {"https://storage.googleapis.com/huggingface-nlp/datasets/gem/gem_sgd_context.zip": {"num_bytes": 16544230, "checksum": "abb2af00031152dbead4a75275dc195a576005529cc19b7f942669f5d257ef30"}, "https://storage.googleapis.com/huggingface-nlp/datasets/gem/gem_challenge_sets/schema_guided_dialog.zip": {"num_bytes": 1282238, "checksum": "79231851df998a9dc2a1298f8061cf7e9e9ad0b1ea34f7e5124eb31960a4b842"}}, "download_size": 17826468, "post_processing_size": null, "dataset_size": 217503778, "size_in_bytes": 235330246}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
schema_guided_dialog.py
CHANGED
@@ -57,6 +57,24 @@ _SGD_ACTS = [
|
|
57 |
]
|
58 |
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
class SchemaGuidedDialog(datasets.GeneratorBasedBuilder):
|
61 |
VERSION = datasets.Version("1.0.0")
|
62 |
DEFAULT_CONFIG_NAME = "schema_guided_dialog"
|
@@ -80,6 +98,7 @@ class SchemaGuidedDialog(datasets.GeneratorBasedBuilder):
|
|
80 |
"prompt": datasets.Value("string"),
|
81 |
"target": datasets.Value("string"),
|
82 |
"references": [datasets.Value("string")],
|
|
|
83 |
}
|
84 |
)
|
85 |
return datasets.DatasetInfo(
|
@@ -157,6 +176,7 @@ class SchemaGuidedDialog(datasets.GeneratorBasedBuilder):
|
|
157 |
continue
|
158 |
exple["gem_parent_id"] = exple["gem_id"]
|
159 |
exple["gem_id"] = f"schema_guided_dialog-{split}-{id_}"
|
|
|
160 |
yield id_, exple
|
161 |
else:
|
162 |
examples = json.load(open(filepath, encoding="utf-8"))[split]
|
@@ -164,9 +184,8 @@ class SchemaGuidedDialog(datasets.GeneratorBasedBuilder):
|
|
164 |
# Fix the one example that has an empty target.
|
165 |
if not example["target"]:
|
166 |
example["target"] = "Thank you, goodbye."
|
167 |
-
|
168 |
-
|
169 |
-
yield id_, {
|
170 |
"gem_id": f"schema_guided_dialog-{split}-{id_}",
|
171 |
"gem_parent_id": f"schema_guided_dialog-{split}-{id_}",
|
172 |
"dialog_acts": [
|
@@ -183,5 +202,8 @@ class SchemaGuidedDialog(datasets.GeneratorBasedBuilder):
|
|
183 |
"turn_id": example["turn_ix"],
|
184 |
"prompt": example["prompt"],
|
185 |
"target": example["target"],
|
186 |
-
"references": [
|
187 |
}
|
|
|
|
|
|
|
|
57 |
]
|
58 |
|
59 |
|
60 |
+
def process_sgd(example):
|
61 |
+
prompt = example["prompt"]
|
62 |
+
inp = f'Prompt: "{prompt}", '
|
63 |
+
for da in example["dialog_acts"]:
|
64 |
+
act = _SGD_ACTS[da["act"]].lower()
|
65 |
+
slot = da["slot"]
|
66 |
+
values = " or ".join(da["values"])
|
67 |
+
inp += f"Response Type: {act}"
|
68 |
+
if slot:
|
69 |
+
inp += f", Type of Slot: {slot}"
|
70 |
+
if values:
|
71 |
+
inp += f", Values: {values}"
|
72 |
+
inp += ", "
|
73 |
+
inp += f'Agent: {example["service"]}'
|
74 |
+
|
75 |
+
return inp
|
76 |
+
|
77 |
+
|
78 |
class SchemaGuidedDialog(datasets.GeneratorBasedBuilder):
|
79 |
VERSION = datasets.Version("1.0.0")
|
80 |
DEFAULT_CONFIG_NAME = "schema_guided_dialog"
|
|
|
98 |
"prompt": datasets.Value("string"),
|
99 |
"target": datasets.Value("string"),
|
100 |
"references": [datasets.Value("string")],
|
101 |
+
"linearized_input": datasets.Value("string"),
|
102 |
}
|
103 |
)
|
104 |
return datasets.DatasetInfo(
|
|
|
176 |
continue
|
177 |
exple["gem_parent_id"] = exple["gem_id"]
|
178 |
exple["gem_id"] = f"schema_guided_dialog-{split}-{id_}"
|
179 |
+
exple["linearized_input"] = process_sgd(exple)
|
180 |
yield id_, exple
|
181 |
else:
|
182 |
examples = json.load(open(filepath, encoding="utf-8"))[split]
|
|
|
184 |
# Fix the one example that has an empty target.
|
185 |
if not example["target"]:
|
186 |
example["target"] = "Thank you, goodbye."
|
187 |
+
|
188 |
+
exple = {
|
|
|
189 |
"gem_id": f"schema_guided_dialog-{split}-{id_}",
|
190 |
"gem_parent_id": f"schema_guided_dialog-{split}-{id_}",
|
191 |
"dialog_acts": [
|
|
|
202 |
"turn_id": example["turn_ix"],
|
203 |
"prompt": example["prompt"],
|
204 |
"target": example["target"],
|
205 |
+
"references": [example["target"]],
|
206 |
}
|
207 |
+
exple["linearized_input"] = process_sgd(exple)
|
208 |
+
|
209 |
+
yield id_, exple
|