nouamanetazi HF staff commited on
Commit
6c64fa9
1 Parent(s): ea49c4f

iter archive

Browse files
Files changed (1) hide show
  1. test111.py +169 -476
test111.py CHANGED
@@ -13,470 +13,157 @@ _DESCRIPTION = """\
13
  Utterances span 60 intents and include 55 slot types. MASSIVE was created by localizing
14
  the SLURP dataset, composed of general Intelligent Voice Assistant single-shot interactions.
15
  """
16
-
17
- _CITATION = """\
18
- @misc{fitzgerald2022massive,
19
- title={MASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse Languages},
20
- author={Jack FitzGerald and Christopher Hench and Charith Peris and Scott Mackie and Kay Rottmann and Ana Sanchez and Aaron Nash and Liam Urbach and Vishesh Kakarala and Richa Singh and Swetha Ranganath and Laurie Crist and Misha Britan and Wouter Leeuwis and Gokhan Tur and Prem Natarajan},
21
- year={2022},
22
- eprint={2204.08582},
23
- archivePrefix={arXiv},
24
- primaryClass={cs.CL}
25
- }
26
- \
27
- @inproceedings{bastianelli-etal-2020-slurp,
28
- title = "{SLURP}: A Spoken Language Understanding Resource Package",
29
- author = "Bastianelli, Emanuele and
30
- Vanzo, Andrea and
31
- Swietojanski, Pawel and
32
- Rieser, Verena",
33
- booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
34
- month = nov,
35
- year = "2020",
36
- address = "Online",
37
- publisher = "Association for Computational Linguistics",
38
- url = "https://aclanthology.org/2020.emnlp-main.588",
39
- doi = "10.18653/v1/2020.emnlp-main.588",
40
- pages = "7252--7262",
41
- abstract = "Spoken Language Understanding infers semantic meaning directly from audio data, and thus promises to reduce error propagation and misunderstandings in end-user applications. However, publicly available SLU resources are limited. In this paper, we release SLURP, a new SLU package containing the following: (1) A new challenging dataset in English spanning 18 domains, which is substantially bigger and linguistically more diverse than existing datasets; (2) Competitive baselines based on state-of-the-art NLU and ASR systems; (3) A new transparent metric for entity labelling which enables a detailed error analysis for identifying potential areas of improvement. SLURP is available at https://github.com/pswietojanski/slurp."
42
- }
43
- """
44
-
45
- _LICENSE = """\
46
- Copyright Amazon.com Inc. or its affiliates.
47
-
48
- Attribution 4.0 International
49
-
50
- =======================================================================
51
-
52
- Creative Commons Corporation ("Creative Commons") is not a law firm and
53
- does not provide legal services or legal advice. Distribution of
54
- Creative Commons public licenses does not create a lawyer-client or
55
- other relationship. Creative Commons makes its licenses and related
56
- information available on an "as-is" basis. Creative Commons gives no
57
- warranties regarding its licenses, any material licensed under their
58
- terms and conditions, or any related information. Creative Commons
59
- disclaims all liability for damages resulting from their use to the
60
- fullest extent possible.
61
-
62
- Using Creative Commons Public Licenses
63
-
64
- Creative Commons public licenses provide a standard set of terms and
65
- conditions that creators and other rights holders may use to share
66
- original works of authorship and other material subject to copyright
67
- and certain other rights specified in the public license below. The
68
- following considerations are for informational purposes only, are not
69
- exhaustive, and do not form part of our licenses.
70
-
71
- Considerations for licensors: Our public licenses are
72
- intended for use by those authorized to give the public
73
- permission to use material in ways otherwise restricted by
74
- copyright and certain other rights. Our licenses are
75
- irrevocable. Licensors should read and understand the terms
76
- and conditions of the license they choose before applying it.
77
- Licensors should also secure all rights necessary before
78
- applying our licenses so that the public can reuse the
79
- material as expected. Licensors should clearly mark any
80
- material not subject to the license. This includes other CC-
81
- licensed material, or material used under an exception or
82
- limitation to copyright. More considerations for licensors:
83
- wiki.creativecommons.org/Considerations_for_licensors
84
-
85
- Considerations for the public: By using one of our public
86
- licenses, a licensor grants the public permission to use the
87
- licensed material under specified terms and conditions. If
88
- the licensor's permission is not necessary for any reason--for
89
- example, because of any applicable exception or limitation to
90
- copyright--then that use is not regulated by the license. Our
91
- licenses grant only permissions under copyright and certain
92
- other rights that a licensor has authority to grant. Use of
93
- the licensed material may still be restricted for other
94
- reasons, including because others have copyright or other
95
- rights in the material. A licensor may make special requests,
96
- such as asking that all changes be marked or described.
97
- Although not required by our licenses, you are encouraged to
98
- respect those requests where reasonable. More considerations
99
- for the public:
100
- wiki.creativecommons.org/Considerations_for_licensees
101
-
102
- =======================================================================
103
-
104
- Creative Commons Attribution 4.0 International Public License
105
-
106
- By exercising the Licensed Rights (defined below), You accept and agree
107
- to be bound by the terms and conditions of this Creative Commons
108
- Attribution 4.0 International Public License ("Public License"). To the
109
- extent this Public License may be interpreted as a contract, You are
110
- granted the Licensed Rights in consideration of Your acceptance of
111
- these terms and conditions, and the Licensor grants You such rights in
112
- consideration of benefits the Licensor receives from making the
113
- Licensed Material available under these terms and conditions.
114
-
115
-
116
- Section 1 -- Definitions.
117
-
118
- a. Adapted Material means material subject to Copyright and Similar
119
- Rights that is derived from or based upon the Licensed Material
120
- and in which the Licensed Material is translated, altered,
121
- arranged, transformed, or otherwise modified in a manner requiring
122
- permission under the Copyright and Similar Rights held by the
123
- Licensor. For purposes of this Public License, where the Licensed
124
- Material is a musical work, performance, or sound recording,
125
- Adapted Material is always produced where the Licensed Material is
126
- synched in timed relation with a moving image.
127
-
128
- b. Adapter's License means the license You apply to Your Copyright
129
- and Similar Rights in Your contributions to Adapted Material in
130
- accordance with the terms and conditions of this Public License.
131
-
132
- c. Copyright and Similar Rights means copyright and/or similar rights
133
- closely related to copyright including, without limitation,
134
- performance, broadcast, sound recording, and Sui Generis Database
135
- Rights, without regard to how the rights are labeled or
136
- categorized. For purposes of this Public License, the rights
137
- specified in Section 2(b)(1)-(2) are not Copyright and Similar
138
- Rights.
139
-
140
- d. Effective Technological Measures means those measures that, in the
141
- absence of proper authority, may not be circumvented under laws
142
- fulfilling obligations under Article 11 of the WIPO Copyright
143
- Treaty adopted on December 20, 1996, and/or similar international
144
- agreements.
145
-
146
- e. Exceptions and Limitations means fair use, fair dealing, and/or
147
- any other exception or limitation to Copyright and Similar Rights
148
- that applies to Your use of the Licensed Material.
149
-
150
- f. Licensed Material means the artistic or literary work, database,
151
- or other material to which the Licensor applied this Public
152
- License.
153
-
154
- g. Licensed Rights means the rights granted to You subject to the
155
- terms and conditions of this Public License, which are limited to
156
- all Copyright and Similar Rights that apply to Your use of the
157
- Licensed Material and that the Licensor has authority to license.
158
-
159
- h. Licensor means the individual(s) or entity(ies) granting rights
160
- under this Public License.
161
-
162
- i. Share means to provide material to the public by any means or
163
- process that requires permission under the Licensed Rights, such
164
- as reproduction, public display, public performance, distribution,
165
- dissemination, communication, or importation, and to make material
166
- available to the public including in ways that members of the
167
- public may access the material from a place and at a time
168
- individually chosen by them.
169
-
170
- j. Sui Generis Database Rights means rights other than copyright
171
- resulting from Directive 96/9/EC of the European Parliament and of
172
- the Council of 11 March 1996 on the legal protection of databases,
173
- as amended and/or succeeded, as well as other essentially
174
- equivalent rights anywhere in the world.
175
-
176
- k. You means the individual or entity exercising the Licensed Rights
177
- under this Public License. Your has a corresponding meaning.
178
-
179
-
180
- Section 2 -- Scope.
181
-
182
- a. License grant.
183
-
184
- 1. Subject to the terms and conditions of this Public License,
185
- the Licensor hereby grants You a worldwide, royalty-free,
186
- non-sublicensable, non-exclusive, irrevocable license to
187
- exercise the Licensed Rights in the Licensed Material to:
188
-
189
- a. reproduce and Share the Licensed Material, in whole or
190
- in part; and
191
-
192
- b. produce, reproduce, and Share Adapted Material.
193
-
194
- 2. Exceptions and Limitations. For the avoidance of doubt, where
195
- Exceptions and Limitations apply to Your use, this Public
196
- License does not apply, and You do not need to comply with
197
- its terms and conditions.
198
-
199
- 3. Term. The term of this Public License is specified in Section
200
- 6(a).
201
-
202
- 4. Media and formats; technical modifications allowed. The
203
- Licensor authorizes You to exercise the Licensed Rights in
204
- all media and formats whether now known or hereafter created,
205
- and to make technical modifications necessary to do so. The
206
- Licensor waives and/or agrees not to assert any right or
207
- authority to forbid You from making technical modifications
208
- necessary to exercise the Licensed Rights, including
209
- technical modifications necessary to circumvent Effective
210
- Technological Measures. For purposes of this Public License,
211
- simply making modifications authorized by this Section 2(a)
212
- (4) never produces Adapted Material.
213
-
214
- 5. Downstream recipients.
215
-
216
- a. Offer from the Licensor -- Licensed Material. Every
217
- recipient of the Licensed Material automatically
218
- receives an offer from the Licensor to exercise the
219
- Licensed Rights under the terms and conditions of this
220
- Public License.
221
-
222
- b. No downstream restrictions. You may not offer or impose
223
- any additional or different terms or conditions on, or
224
- apply any Effective Technological Measures to, the
225
- Licensed Material if doing so restricts exercise of the
226
- Licensed Rights by any recipient of the Licensed
227
- Material.
228
-
229
- 6. No endorsement. Nothing in this Public License constitutes or
230
- may be construed as permission to assert or imply that You
231
- are, or that Your use of the Licensed Material is, connected
232
- with, or sponsored, endorsed, or granted official status by,
233
- the Licensor or others designated to receive attribution as
234
- provided in Section 3(a)(1)(A)(i).
235
-
236
- b. Other rights.
237
-
238
- 1. Moral rights, such as the right of integrity, are not
239
- licensed under this Public License, nor are publicity,
240
- privacy, and/or other similar personality rights; however, to
241
- the extent possible, the Licensor waives and/or agrees not to
242
- assert any such rights held by the Licensor to the limited
243
- extent necessary to allow You to exercise the Licensed
244
- Rights, but not otherwise.
245
-
246
- 2. Patent and trademark rights are not licensed under this
247
- Public License.
248
-
249
- 3. To the extent possible, the Licensor waives any right to
250
- collect royalties from You for the exercise of the Licensed
251
- Rights, whether directly or through a collecting society
252
- under any voluntary or waivable statutory or compulsory
253
- licensing scheme. In all other cases the Licensor expressly
254
- reserves any right to collect such royalties.
255
-
256
-
257
- Section 3 -- License Conditions.
258
-
259
- Your exercise of the Licensed Rights is expressly made subject to the
260
- following conditions.
261
-
262
- a. Attribution.
263
-
264
- 1. If You Share the Licensed Material (including in modified
265
- form), You must:
266
-
267
- a. retain the following if it is supplied by the Licensor
268
- with the Licensed Material:
269
-
270
- i. identification of the creator(s) of the Licensed
271
- Material and any others designated to receive
272
- attribution, in any reasonable manner requested by
273
- the Licensor (including by pseudonym if
274
- designated);
275
-
276
- ii. a copyright notice;
277
-
278
- iii. a notice that refers to this Public License;
279
-
280
- iv. a notice that refers to the disclaimer of
281
- warranties;
282
-
283
- v. a URI or hyperlink to the Licensed Material to the
284
- extent reasonably practicable;
285
-
286
- b. indicate if You modified the Licensed Material and
287
- retain an indication of any previous modifications; and
288
-
289
- c. indicate the Licensed Material is licensed under this
290
- Public License, and include the text of, or the URI or
291
- hyperlink to, this Public License.
292
-
293
- 2. You may satisfy the conditions in Section 3(a)(1) in any
294
- reasonable manner based on the medium, means, and context in
295
- which You Share the Licensed Material. For example, it may be
296
- reasonable to satisfy the conditions by providing a URI or
297
- hyperlink to a resource that includes the required
298
- information.
299
-
300
- 3. If requested by the Licensor, You must remove any of the
301
- information required by Section 3(a)(1)(A) to the extent
302
- reasonably practicable.
303
-
304
- 4. If You Share Adapted Material You produce, the Adapter's
305
- License You apply must not prevent recipients of the Adapted
306
- Material from complying with this Public License.
307
-
308
-
309
- Section 4 -- Sui Generis Database Rights.
310
-
311
- Where the Licensed Rights include Sui Generis Database Rights that
312
- apply to Your use of the Licensed Material:
313
-
314
- a. for the avoidance of doubt, Section 2(a)(1) grants You the right
315
- to extract, reuse, reproduce, and Share all or a substantial
316
- portion of the contents of the database;
317
-
318
- b. if You include all or a substantial portion of the database
319
- contents in a database in which You have Sui Generis Database
320
- Rights, then the database in which You have Sui Generis Database
321
- Rights (but not its individual contents) is Adapted Material; and
322
-
323
- c. You must comply with the conditions in Section 3(a) if You Share
324
- all or a substantial portion of the contents of the database.
325
-
326
- For the avoidance of doubt, this Section 4 supplements and does not
327
- replace Your obligations under this Public License where the Licensed
328
- Rights include other Copyright and Similar Rights.
329
-
330
-
331
- Section 5 -- Disclaimer of Warranties and Limitation of Liability.
332
-
333
- a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
334
- EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
335
- AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
336
- ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
337
- IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
338
- WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
339
- PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
340
- ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
341
- KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
342
- ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
343
-
344
- b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
345
- TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
346
- NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
347
- INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
348
- COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
349
- USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
350
- ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
351
- DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
352
- IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
353
-
354
- c. The disclaimer of warranties and limitation of liability provided
355
- above shall be interpreted in a manner that, to the extent
356
- possible, most closely approximates an absolute disclaimer and
357
- waiver of all liability.
358
-
359
-
360
- Section 6 -- Term and Termination.
361
-
362
- a. This Public License applies for the term of the Copyright and
363
- Similar Rights licensed here. However, if You fail to comply with
364
- this Public License, then Your rights under this Public License
365
- terminate automatically.
366
-
367
- b. Where Your right to use the Licensed Material has terminated under
368
- Section 6(a), it reinstates:
369
-
370
- 1. automatically as of the date the violation is cured, provided
371
- it is cured within 30 days of Your discovery of the
372
- violation; or
373
-
374
- 2. upon express reinstatement by the Licensor.
375
-
376
- For the avoidance of doubt, this Section 6(b) does not affect any
377
- right the Licensor may have to seek remedies for Your violations
378
- of this Public License.
379
-
380
- c. For the avoidance of doubt, the Licensor may also offer the
381
- Licensed Material under separate terms or conditions or stop
382
- distributing the Licensed Material at any time; however, doing so
383
- will not terminate this Public License.
384
-
385
- d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
386
- License.
387
-
388
-
389
- Section 7 -- Other Terms and Conditions.
390
-
391
- a. The Licensor shall not be bound by any additional or different
392
- terms or conditions communicated by You unless expressly agreed.
393
-
394
- b. Any arrangements, understandings, or agreements regarding the
395
- Licensed Material not stated herein are separate from and
396
- independent of the terms and conditions of this Public License.
397
-
398
-
399
- Section 8 -- Interpretation.
400
-
401
- a. For the avoidance of doubt, this Public License does not, and
402
- shall not be interpreted to, reduce, limit, restrict, or impose
403
- conditions on any use of the Licensed Material that could lawfully
404
- be made without permission under this Public License.
405
-
406
- b. To the extent possible, if any provision of this Public License is
407
- deemed unenforceable, it shall be automatically reformed to the
408
- minimum extent necessary to make it enforceable. If the provision
409
- cannot be reformed, it shall be severed from this Public License
410
- without affecting the enforceability of the remaining terms and
411
- conditions.
412
-
413
- c. No term or condition of this Public License will be waived and no
414
- failure to comply consented to unless expressly agreed to by the
415
- Licensor.
416
-
417
- d. Nothing in this Public License constitutes or may be interpreted
418
- as a limitation upon, or waiver of, any privileges and immunities
419
- that apply to the Licensor or You, including from the legal
420
- processes of any jurisdiction or authority.
421
-
422
-
423
- =======================================================================
424
-
425
- Creative Commons is not a party to its public licenses.
426
- Notwithstanding, Creative Commons may elect to apply one of its public
427
- licenses to material it publishes and in those instances will be
428
- considered the “Licensor.” The text of the Creative Commons public
429
- licenses is dedicated to the public domain under the CC0 Public Domain
430
- Dedication. Except for the limited purpose of indicating that material
431
- is shared under a Creative Commons public license or as otherwise
432
- permitted by the Creative Commons policies published at
433
- creativecommons.org/policies, Creative Commons does not authorize the
434
- use of the trademark "Creative Commons" or any other trademark or logo
435
- of Creative Commons without its prior written consent including,
436
- without limitation, in connection with any unauthorized modifications
437
- to any of its public licenses or any other arrangements,
438
- understandings, or agreements concerning use of licensed material. For
439
- the avoidance of doubt, this paragraph does not form part of the public
440
- licenses.
441
-
442
- Creative Commons may be contacted at creativecommons.org.
443
- """
444
-
445
  _URL = "https://amazon-massive-nlu-dataset.s3.amazonaws.com/amazon-massive-dataset-1.0.tar.gz"
446
 
447
- _LANGUAGES = ['af-ZA', 'am-ET', 'ar-SA', 'az-AZ', 'bn-BD', 'cy-GB', 'da-DK', 'de-DE', 'el-GR', 'en-US',
448
- 'es-ES', 'fa-IR', 'fi-FI', 'fr-FR', 'he-IL', 'hi-IN', 'hu-HU', 'hy-AM', 'id-ID', 'is-IS',
449
- 'it-IT', 'ja-JP', 'jv-ID', 'ka-GE', 'km-KH', 'kn-IN', 'ko-KR', 'lv-LV', 'ml-IN', 'mn-MN',
450
- 'ms-MY', 'my-MM', 'nb-NO', 'nl-NL', 'pl-PL', 'pt-PT', 'ro-RO', 'ru-RU', 'sl-SL', 'sq-AL',
451
- 'sv-SE', 'sw-KE', 'ta-IN', 'te-IN', 'th-TH', 'tl-PH', 'tr-TR', 'ur-PK', 'vi-VN', 'zh-CN',
452
- 'zh-TW']
453
-
454
- _SCENARIOS = ['social', 'transport', 'calendar', 'play', 'news', 'datetime', 'recommendation', 'email',
455
- 'iot', 'general', 'audio', 'lists', 'qa', 'cooking', 'takeaway', 'music', 'alarm', 'weather']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
456
 
457
- _INTENTS = ['datetime_query', 'iot_hue_lightchange', 'transport_ticket', 'takeaway_query', 'qa_stock',
458
- 'general_greet', 'recommendation_events', 'music_dislikeness', 'iot_wemo_off', 'cooking_recipe',
459
- 'qa_currency', 'transport_traffic', 'general_quirky', 'weather_query', 'audio_volume_up',
460
- 'email_addcontact', 'takeaway_order', 'email_querycontact', 'iot_hue_lightup',
461
- 'recommendation_locations', 'play_audiobook', 'lists_createoradd', 'news_query',
462
- 'alarm_query', 'iot_wemo_on', 'general_joke', 'qa_definition', 'social_query',
463
- 'music_settings', 'audio_volume_other', 'calendar_remove', 'iot_hue_lightdim',
464
- 'calendar_query', 'email_sendemail', 'iot_cleaning', 'audio_volume_down',
465
- 'play_radio', 'cooking_query', 'datetime_convert', 'qa_maths', 'iot_hue_lightoff',
466
- 'iot_hue_lighton', 'transport_query', 'music_likeness', 'email_query', 'play_music',
467
- 'audio_volume_mute', 'social_post', 'alarm_set', 'qa_factoid', 'calendar_set',
468
- 'play_game', 'alarm_remove', 'lists_remove', 'transport_taxi', 'recommendation_movies',
469
- 'iot_coffee', 'music_query', 'play_podcasts', 'lists_query']
470
 
471
  class MASSIVE(datasets.GeneratorBasedBuilder):
472
  """MASSIVE: A 1M-Example Multilingual Natural Language Understanding Dataset with 51 Typologically-Diverse Languages"""
473
 
474
  BUILDER_CONFIGS = [
475
  datasets.BuilderConfig(
476
- name = name,
477
- version = datasets.Version("1.0.0"),
478
- description = f"The MASSIVE corpora for {name}",
479
- ) for name in _LANGUAGES
 
480
  ]
481
 
482
  DEFAULT_CONFIG_NAME = "en-US"
@@ -494,29 +181,33 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
494
  "utt": datasets.Value("string"),
495
  "annot_utt": datasets.Value("string"),
496
  "worker_id": datasets.Value("string"),
497
- "slot_method": datasets.Sequence({
498
- "slot": datasets.Value("string"),
499
- "method": datasets.Value("string"),
500
- }),
501
- "judgments": datasets.Sequence({
502
- "worker_id": datasets.Value("string"),
503
- "intent_score": datasets.Value("int8"),
504
- "slots_score": datasets.Value("int8"),
505
- "grammar_score": datasets.Value("int8"),
506
- "spelling_score": datasets.Value("int8"),
507
- "language_identification": datasets.Value("string"),
508
- }),
 
 
 
 
509
  },
510
  ),
511
  supervised_keys=None,
512
  homepage="https://github.com/alexa/massive",
513
- citation=_CITATION,
514
- license=_LICENSE,
515
  )
516
 
517
  def _split_generators(self, dl_manager):
518
 
519
- path = dl_manager.download_and_extract(_URL)
520
 
521
  return [
522
  datasets.SplitGenerator(
@@ -525,7 +216,7 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
525
  "filepath": path,
526
  "split": "train",
527
  "lang": self.config.name,
528
- }
529
  ),
530
  datasets.SplitGenerator(
531
  name=datasets.Split.VALIDATION,
@@ -533,7 +224,7 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
533
  "filepath": path,
534
  "split": "dev",
535
  "lang": self.config.name,
536
- }
537
  ),
538
  datasets.SplitGenerator(
539
  name=datasets.Split.TEST,
@@ -541,7 +232,7 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
541
  "filepath": path,
542
  "split": "test",
543
  "lang": self.config.name,
544
- }
545
  ),
546
  ]
547
 
@@ -552,7 +243,7 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
552
  logger.info("⏳ Generating examples from = %s", filepath)
553
 
554
  # Read the file
555
- f = open(filepath,"r")
556
  lines = f.read().split("\n")
557
  f.close()
558
 
@@ -571,7 +262,8 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
571
  {
572
  "slot": s["slot"],
573
  "method": s["method"],
574
- } for s in data["slot_method"]
 
575
  ]
576
  else:
577
  slot_method = []
@@ -586,7 +278,8 @@ class MASSIVE(datasets.GeneratorBasedBuilder):
586
  "grammar_score": j["grammar_score"],
587
  "spelling_score": j["spelling_score"],
588
  "language_identification": j["language_identification"],
589
- } for j in data["judgments"]
 
590
  ]
591
  else:
592
  judgments = []
 
13
  Utterances span 60 intents and include 55 slot types. MASSIVE was created by localizing
14
  the SLURP dataset, composed of general Intelligent Voice Assistant single-shot interactions.
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",
74
+ "transport",
75
+ "calendar",
76
+ "play",
77
+ "news",
78
+ "datetime",
79
+ "recommendation",
80
+ "email",
81
+ "iot",
82
+ "general",
83
+ "audio",
84
+ "lists",
85
+ "qa",
86
+ "cooking",
87
+ "takeaway",
88
+ "music",
89
+ "alarm",
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"""
159
 
160
  BUILDER_CONFIGS = [
161
  datasets.BuilderConfig(
162
+ name=name,
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"
 
181
  "utt": datasets.Value("string"),
182
  "annot_utt": datasets.Value("string"),
183
  "worker_id": datasets.Value("string"),
184
+ "slot_method": datasets.Sequence(
185
+ {
186
+ "slot": datasets.Value("string"),
187
+ "method": datasets.Value("string"),
188
+ }
189
+ ),
190
+ "judgments": datasets.Sequence(
191
+ {
192
+ "worker_id": datasets.Value("string"),
193
+ "intent_score": datasets.Value("int8"),
194
+ "slots_score": datasets.Value("int8"),
195
+ "grammar_score": datasets.Value("int8"),
196
+ "spelling_score": datasets.Value("int8"),
197
+ "language_identification": datasets.Value("string"),
198
+ }
199
+ ),
200
  },
201
  ),
202
  supervised_keys=None,
203
  homepage="https://github.com/alexa/massive",
204
+ citation="_CITATION",
205
+ license="_LICENSE",
206
  )
207
 
208
  def _split_generators(self, dl_manager):
209
 
210
+ path = dl_manager.iter_archive(_URL)
211
 
212
  return [
213
  datasets.SplitGenerator(
 
216
  "filepath": path,
217
  "split": "train",
218
  "lang": self.config.name,
219
+ },
220
  ),
221
  datasets.SplitGenerator(
222
  name=datasets.Split.VALIDATION,
 
224
  "filepath": path,
225
  "split": "dev",
226
  "lang": self.config.name,
227
+ },
228
  ),
229
  datasets.SplitGenerator(
230
  name=datasets.Split.TEST,
 
232
  "filepath": path,
233
  "split": "test",
234
  "lang": self.config.name,
235
+ },
236
  ),
237
  ]
238
 
 
243
  logger.info("⏳ Generating examples from = %s", filepath)
244
 
245
  # Read the file
246
+ f = open(filepath, "r")
247
  lines = f.read().split("\n")
248
  f.close()
249
 
 
262
  {
263
  "slot": s["slot"],
264
  "method": s["method"],
265
+ }
266
+ for s in data["slot_method"]
267
  ]
268
  else:
269
  slot_method = []
 
278
  "grammar_score": j["grammar_score"],
279
  "spelling_score": j["spelling_score"],
280
  "language_identification": j["language_identification"],
281
+ }
282
+ for j in data["judgments"]
283
  ]
284
  else:
285
  judgments = []