Commit
·
fdf5bd8
1
Parent(s):
4f02d92
rename languages
Browse files- amazon_massive_scenario.py +56 -118
amazon_massive_scenario.py
CHANGED
@@ -15,59 +15,60 @@ _DESCRIPTION = """\
|
|
15 |
"""
|
16 |
_URL = "https://amazon-massive-nlu-dataset.s3.amazonaws.com/amazon-massive-dataset-1.0.tar.gz"
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
"
|
21 |
-
"
|
22 |
-
"
|
23 |
-
"
|
24 |
-
"
|
25 |
-
"
|
26 |
-
"
|
27 |
-
"
|
28 |
-
"
|
29 |
-
"
|
30 |
-
"
|
31 |
-
"
|
32 |
-
"
|
33 |
-
"
|
34 |
-
"
|
35 |
-
"
|
36 |
-
"
|
37 |
-
"
|
38 |
-
"
|
39 |
-
"
|
40 |
-
"
|
41 |
-
"
|
42 |
-
"
|
43 |
-
"
|
44 |
-
"
|
45 |
-
"
|
46 |
-
"
|
47 |
-
"
|
48 |
-
"
|
49 |
-
"
|
50 |
-
"
|
51 |
-
"
|
52 |
-
"
|
53 |
-
"
|
54 |
-
"
|
55 |
-
"
|
56 |
-
"
|
57 |
-
"
|
58 |
-
"
|
59 |
-
"
|
60 |
-
"
|
61 |
-
"
|
62 |
-
"
|
63 |
-
"
|
64 |
-
"
|
65 |
-
"
|
66 |
-
"
|
67 |
-
"
|
68 |
-
"
|
69 |
-
"zh-
|
70 |
-
|
|
|
71 |
|
72 |
_SCENARIOS = [
|
73 |
"social",
|
@@ -90,69 +91,6 @@ _SCENARIOS = [
|
|
90 |
"weather",
|
91 |
]
|
92 |
|
93 |
-
_INTENTS = [
|
94 |
-
"datetime_query",
|
95 |
-
"iot_hue_lightchange",
|
96 |
-
"transport_ticket",
|
97 |
-
"takeaway_query",
|
98 |
-
"qa_stock",
|
99 |
-
"general_greet",
|
100 |
-
"recommendation_events",
|
101 |
-
"music_dislikeness",
|
102 |
-
"iot_wemo_off",
|
103 |
-
"cooking_recipe",
|
104 |
-
"qa_currency",
|
105 |
-
"transport_traffic",
|
106 |
-
"general_quirky",
|
107 |
-
"weather_query",
|
108 |
-
"audio_volume_up",
|
109 |
-
"email_addcontact",
|
110 |
-
"takeaway_order",
|
111 |
-
"email_querycontact",
|
112 |
-
"iot_hue_lightup",
|
113 |
-
"recommendation_locations",
|
114 |
-
"play_audiobook",
|
115 |
-
"lists_createoradd",
|
116 |
-
"news_query",
|
117 |
-
"alarm_query",
|
118 |
-
"iot_wemo_on",
|
119 |
-
"general_joke",
|
120 |
-
"qa_definition",
|
121 |
-
"social_query",
|
122 |
-
"music_settings",
|
123 |
-
"audio_volume_other",
|
124 |
-
"calendar_remove",
|
125 |
-
"iot_hue_lightdim",
|
126 |
-
"calendar_query",
|
127 |
-
"email_sendemail",
|
128 |
-
"iot_cleaning",
|
129 |
-
"audio_volume_down",
|
130 |
-
"play_radio",
|
131 |
-
"cooking_query",
|
132 |
-
"datetime_convert",
|
133 |
-
"qa_maths",
|
134 |
-
"iot_hue_lightoff",
|
135 |
-
"iot_hue_lighton",
|
136 |
-
"transport_query",
|
137 |
-
"music_likeness",
|
138 |
-
"email_query",
|
139 |
-
"play_music",
|
140 |
-
"audio_volume_mute",
|
141 |
-
"social_post",
|
142 |
-
"alarm_set",
|
143 |
-
"qa_factoid",
|
144 |
-
"calendar_set",
|
145 |
-
"play_game",
|
146 |
-
"alarm_remove",
|
147 |
-
"lists_remove",
|
148 |
-
"transport_taxi",
|
149 |
-
"recommendation_movies",
|
150 |
-
"iot_coffee",
|
151 |
-
"music_query",
|
152 |
-
"play_podcasts",
|
153 |
-
"lists_query",
|
154 |
-
]
|
155 |
-
|
156 |
|
157 |
class MASSIVE(datasets.GeneratorBasedBuilder):
|
158 |
"""MASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse Languages"""
|
@@ -163,7 +101,7 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
|
|
163 |
version=datasets.Version("1.0.0"),
|
164 |
description=f"The MASSIVE corpora for {name}",
|
165 |
)
|
166 |
-
for name in _LANGUAGES
|
167 |
]
|
168 |
|
169 |
DEFAULT_CONFIG_NAME = "en-US"
|
@@ -218,7 +156,7 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
|
|
218 |
]
|
219 |
|
220 |
def _generate_examples(self, files, split, lang):
|
221 |
-
filepath = "1.0/data/" + lang + ".jsonl"
|
222 |
logger.info("⏳ Generating examples from = %s", filepath)
|
223 |
for path, f in files:
|
224 |
if path == filepath:
|
|
|
15 |
"""
|
16 |
_URL = "https://amazon-massive-nlu-dataset.s3.amazonaws.com/amazon-massive-dataset-1.0.tar.gz"
|
17 |
|
18 |
+
|
19 |
+
_LANGUAGES = {
|
20 |
+
"af": "af-ZA",
|
21 |
+
"am": "am-ET",
|
22 |
+
"ar": "ar-SA",
|
23 |
+
"az": "az-AZ",
|
24 |
+
"bn": "bn-BD",
|
25 |
+
"cy": "cy-GB",
|
26 |
+
"da": "da-DK",
|
27 |
+
"de": "de-DE",
|
28 |
+
"el": "el-GR",
|
29 |
+
"en": "en-US",
|
30 |
+
"es": "es-ES",
|
31 |
+
"fa": "fa-IR",
|
32 |
+
"fi": "fi-FI",
|
33 |
+
"fr": "fr-FR",
|
34 |
+
"he": "he-IL",
|
35 |
+
"hi": "hi-IN",
|
36 |
+
"hu": "hu-HU",
|
37 |
+
"hy": "hy-AM",
|
38 |
+
"id": "id-ID",
|
39 |
+
"is": "is-IS",
|
40 |
+
"it": "it-IT",
|
41 |
+
"ja": "ja-JP",
|
42 |
+
"jv": "jv-ID",
|
43 |
+
"ka": "ka-GE",
|
44 |
+
"km": "km-KH",
|
45 |
+
"kn": "kn-IN",
|
46 |
+
"ko": "ko-KR",
|
47 |
+
"lv": "lv-LV",
|
48 |
+
"ml": "ml-IN",
|
49 |
+
"mn": "mn-MN",
|
50 |
+
"ms": "ms-MY",
|
51 |
+
"my": "my-MM",
|
52 |
+
"nb": "nb-NO",
|
53 |
+
"nl": "nl-NL",
|
54 |
+
"pl": "pl-PL",
|
55 |
+
"pt": "pt-PT",
|
56 |
+
"ro": "ro-RO",
|
57 |
+
"ru": "ru-RU",
|
58 |
+
"sl": "sl-SL",
|
59 |
+
"sq": "sq-AL",
|
60 |
+
"sv": "sv-SE",
|
61 |
+
"sw": "sw-KE",
|
62 |
+
"ta": "ta-IN",
|
63 |
+
"te": "te-IN",
|
64 |
+
"th": "th-TH",
|
65 |
+
"tl": "tl-PH",
|
66 |
+
"tr": "tr-TR",
|
67 |
+
"ur": "ur-PK",
|
68 |
+
"vi": "vi-VN",
|
69 |
+
"zh-CN": "zh-CN",
|
70 |
+
"zh-TW": "zh-TW",
|
71 |
+
}
|
72 |
|
73 |
_SCENARIOS = [
|
74 |
"social",
|
|
|
91 |
"weather",
|
92 |
]
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
class MASSIVE(datasets.GeneratorBasedBuilder):
|
96 |
"""MASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse Languages"""
|
|
|
101 |
version=datasets.Version("1.0.0"),
|
102 |
description=f"The MASSIVE corpora for {name}",
|
103 |
)
|
104 |
+
for name in _LANGUAGES.keys()
|
105 |
]
|
106 |
|
107 |
DEFAULT_CONFIG_NAME = "en-US"
|
|
|
156 |
]
|
157 |
|
158 |
def _generate_examples(self, files, split, lang):
|
159 |
+
filepath = "1.0/data/" + _LANGUAGES[lang] + ".jsonl"
|
160 |
logger.info("⏳ Generating examples from = %s", filepath)
|
161 |
for path, f in files:
|
162 |
if path == filepath:
|