Datasets:
mteb
/

Modalities:
Text
Formats:
json
Libraries:
Datasets
Dask
nouamanetazi HF staff commited on
Commit
fdf5bd8
·
1 Parent(s): 4f02d92

rename languages

Browse files
Files changed (1) hide show
  1. 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
- _LANGUAGES = [
19
- "af-ZA",
20
- "am-ET",
21
- "ar-SA",
22
- "az-AZ",
23
- "bn-BD",
24
- "cy-GB",
25
- "da-DK",
26
- "de-DE",
27
- "el-GR",
28
- "en-US",
29
- "es-ES",
30
- "fa-IR",
31
- "fi-FI",
32
- "fr-FR",
33
- "he-IL",
34
- "hi-IN",
35
- "hu-HU",
36
- "hy-AM",
37
- "id-ID",
38
- "is-IS",
39
- "it-IT",
40
- "ja-JP",
41
- "jv-ID",
42
- "ka-GE",
43
- "km-KH",
44
- "kn-IN",
45
- "ko-KR",
46
- "lv-LV",
47
- "ml-IN",
48
- "mn-MN",
49
- "ms-MY",
50
- "my-MM",
51
- "nb-NO",
52
- "nl-NL",
53
- "pl-PL",
54
- "pt-PT",
55
- "ro-RO",
56
- "ru-RU",
57
- "sl-SL",
58
- "sq-AL",
59
- "sv-SE",
60
- "sw-KE",
61
- "ta-IN",
62
- "te-IN",
63
- "th-TH",
64
- "tl-PH",
65
- "tr-TR",
66
- "ur-PK",
67
- "vi-VN",
68
- "zh-CN",
69
- "zh-TW",
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: