π Ur PkΒΆ
MASSIVE is a parallel dataset of > 1M utterances across 51 languages with annotations for the Natural Language Understanding tasks of intent prediction and slot annotation. Utterances span 60 intents and include 55 slot types. MASSIVE was created by localizing the SLURP dataset, composed of general Intelligent Voice Assistant single-shot interactions. See the full description on the dataset page: https://huggingface.co/datasets/AmazonScience/massive.
Tags: annotations_creators:expert-generated, arxiv:2204.08582, flags:['natural-language-understanding'], language_creators:found, license:cc-by-4.0, multilinguality:['af-ZA', 'am-ET', 'ar-SA', 'az-AZ', 'bn-BD', 'ca-ES', 'cy-GB', 'da-DK', 'de-DE', 'el-GR', 'en-US', 'es-ES', 'fa-IR', 'fi-FI', 'fr-FR', 'he-IL', 'hi-IN', 'hu-HU', 'hy-AM', 'id-ID', 'is-IS', 'it-IT', 'ja-JP', 'jv-ID', 'ka-GE', 'km-KH', 'kn-IN', 'ko-KR', 'lv-LV', 'ml-IN', 'mn-MN', 'ms-MY', 'my-MM', 'nb-NO', 'nl-NL', 'pl-PL', 'pt-PT', 'ro-RO', 'ru-RU', 'sl-SL', 'sq-AL', 'sv-SE', 'sw-KE', 'ta-IN', 'te-IN', 'th-TH', 'tl-PH', 'tr-TR', 'ur-PK', 'vi-VN', 'zh-CN', 'zh-TW'], region:us, size_categories:100K<n<1M, source_datasets:original, task_categories:text-classification, task_ids:['intent-classification', 'multi-class-classification'], category:dataset
cards.amazon_mass.ur_PK
type: TaskCard
loader:
type: LoadHF
path: AmazonScience/massive
name: ur-PK
preprocess_steps:
- type: MapInstanceValues
mappers:
intent:
0: datetime_query
1: iot_hue_lightchange
2: transport_ticket
3: takeaway_query
4: qa_stock
5: general_greet
6: recommendation_events
7: music_dislikeness
8: iot_wemo_off
9: cooking_recipe
10: qa_currency
11: transport_traffic
12: general_quirky
13: weather_query
14: audio_volume_up
15: email_addcontact
16: takeaway_order
17: email_querycontact
18: iot_hue_lightup
19: recommendation_locations
20: play_audiobook
21: lists_createoradd
22: news_query
23: alarm_query
24: iot_wemo_on
25: general_joke
26: qa_definition
27: social_query
28: music_settings
29: audio_volume_other
30: calendar_remove
31: iot_hue_lightdim
32: calendar_query
33: email_sendemail
34: iot_cleaning
35: audio_volume_down
36: play_radio
37: cooking_query
38: datetime_convert
39: qa_maths
40: iot_hue_lightoff
41: iot_hue_lighton
42: transport_query
43: music_likeness
44: email_query
45: play_music
46: audio_volume_mute
47: social_post
48: alarm_set
49: qa_factoid
50: calendar_set
51: play_game
52: alarm_remove
53: lists_remove
54: transport_taxi
55: recommendation_movies
56: iot_coffee
57: music_query
58: play_podcasts
59: lists_query
- type: Rename
field_to_field:
utt: text
intent: label
- type: Set
fields:
classes:
- datetime_query
- iot_hue_lightchange
- transport_ticket
- takeaway_query
- qa_stock
- general_greet
- recommendation_events
- music_dislikeness
- iot_wemo_off
- cooking_recipe
- qa_currency
- transport_traffic
- general_quirky
- weather_query
- audio_volume_up
- email_addcontact
- takeaway_order
- email_querycontact
- iot_hue_lightup
- recommendation_locations
- play_audiobook
- lists_createoradd
- news_query
- alarm_query
- iot_wemo_on
- general_joke
- qa_definition
- social_query
- music_settings
- audio_volume_other
- calendar_remove
- iot_hue_lightdim
- calendar_query
- email_sendemail
- iot_cleaning
- audio_volume_down
- play_radio
- cooking_query
- datetime_convert
- qa_maths
- iot_hue_lightoff
- iot_hue_lighton
- transport_query
- music_likeness
- email_query
- play_music
- audio_volume_mute
- social_post
- alarm_set
- qa_factoid
- calendar_set
- play_game
- alarm_remove
- lists_remove
- transport_taxi
- recommendation_movies
- iot_coffee
- music_query
- play_podcasts
- lists_query
text_type: sentence
type_of_class: intent
task: tasks.classification.multi_class
templates: templates.classification.multi_class.all
[source]Explanation about TaskCardΒΆ
TaskCard delineates the phases in transforming the source dataset into model input, and specifies the metrics for evaluation of model output.
- Args:
- loader:
specifies the source address and the loading operator that can access that source and transform it into a unitxt multistream.
- preprocess_steps:
list of unitxt operators to process the data source into model input.
- task:
specifies the fields (of the already (pre)processed instance) making the inputs, the fields making the outputs, and the metrics to be used for evaluating the model output.
- templates:
format strings to be applied on the input fields (specified by the task) and the output fields. The template also carries the instructions and the list of postprocessing steps, to be applied to the model output.
- default_template:
a default template for tasks with very specific task dataset specific template
Explanation about MapInstanceValuesΒΆ
A class used to map instance values into other values.
This class is a type of
InstanceOperator, it maps values of instances in a stream using predefined mappers.
- Args:
- mappers (Dict[str, Dict[str, Any]]):
The mappers to use for mapping instance values. Keys are the names of the fields to undergo mapping, and values are dictionaries that define the mapping from old values to new values. Note that mapped values are defined by their string representation, so mapped values are converted to strings before being looked up in the mappers.
- strict (bool):
If True, the mapping is applied strictly. That means if a value does not exist in the mapper, it will raise a KeyError. If False, values that are not present in the mapper are kept as they are.
- process_every_value (bool):
If True, all fields to be mapped should be lists, and the mapping is to be applied to their individual elements. If False, mapping is only applied to a field containing a single value.
- Examples:
MapInstanceValues(mappers={"a": {"1": "hi", "2": "bye"}})replaces"1"with"hi"and"2"with"bye"in field"a"in all instances of all streams: instance{"a": 1, "b": 2}becomes{"a": "hi", "b": 2}. Note that the value of"b"remained intact, since field-name"b"does not participate in the mappers, and that1was casted to"1"before looked up in the mapper of"a".
MapInstanceValues(mappers={"a": {"1": "hi", "2": "bye"}}, process_every_value=True): Assuming field"a"is a list of values, potentially including"1"-s and"2"-s, this replaces each such"1"with"hi"and"2"β with"bye"in all instances of all streams: instance{"a": ["1", "2"], "b": 2}becomes{"a": ["hi", "bye"], "b": 2}.
MapInstanceValues(mappers={"a": {"1": "hi", "2": "bye"}}, strict=True): To ensure that all values of field"a"are mapped in every instance, usestrict=True. Input instance{"a":"3", "b": 2}will raise an exception per the above call, because"3"is not a key in the mapper of"a".
MapInstanceValues(mappers={"a": {str([1,2,3,4]): "All", str([]): "None"}}, strict=True)replaces a list[1,2,3,4]with the string"All"and an empty list by string"None".
Explanation about SetΒΆ
Sets specified fields in each instance, in a given stream or all streams (default), with specified values. If fields exist, updates them, if do not exist β adds them.
- Args:
fields (Dict[str, object]): The fields to add to each instance. Use β/β to access inner fields
use_deepcopy (bool) : Deep copy the input value to avoid later modifications
- Examples:
# Set a value of a list consisting of βpositiveβ and βnegativeβ do field βclassesβ to each and every instance of all streams
Set(fields={"classes": ["positive","negatives"]})# In each and every instance of all streams, field βspanβ is to become a dictionary containing a field βstartβ, in which the value 0 is to be set
Set(fields={"span/start": 0}# In all instances of stream βtrainβ only, Set field βclassesβ to have the value of a list consisting of βpositiveβ and βnegativeβ
Set(fields={"classes": ["positive","negatives"], apply_to_stream=["train"]})# Set field βclassesβ to have the value of a given list, preventing modification of original list from changing the instance.
Set(fields={"classes": alist}), use_deepcopy=True)if now alist is modified, still the instances remain intact.
Explanation about RenameΒΆ
Renames fields.
Move value from one field to another, potentially, if field name contains a /, from one branch into another. Remove the from field, potentially part of it in case of / in from_field.
- Examples:
Rename(field_to_field={βbβ: βcβ}) will change inputs [{βaβ: 1, βbβ: 2}, {βaβ: 2, βbβ: 3}] to [{βaβ: 1, βcβ: 2}, {βaβ: 2, βcβ: 3}]
Rename(field_to_field={βbβ: βc/dβ}) will change inputs [{βaβ: 1, βbβ: 2}, {βaβ: 2, βbβ: 3}] to [{βaβ: 1, βcβ: {βdβ: 2}}, {βaβ: 2, βcβ: {βdβ: 3}}]
Rename(field_to_field={βbβ: βb/dβ}) will change inputs [{βaβ: 1, βbβ: 2}, {βaβ: 2, βbβ: 3}] to [{βaβ: 1, βbβ: {βdβ: 2}}, {βaβ: 2, βbβ: {βdβ: 3}}]
Rename(field_to_field={βb/c/eβ: βb/dβ}) will change inputs [{βaβ: 1, βbβ: {βcβ: {βeβ: 2, βfβ: 20}}}] to [{βaβ: 1, βbβ: {βcβ: {βfβ: 20}, βdβ: 2}}]
Explanation about LoadHFΒΆ
Loads datasets from the HuggingFace Hub.
It supports loading with or without streaming, and it can filter datasets upon loading.
- Args:
- path:
The path or identifier of the dataset on the HuggingFace Hub.
- name:
An optional dataset name.
- data_dir:
Optional directory to store downloaded data.
- split:
Optional specification of which split to load.
- data_files:
Optional specification of particular data files to load.
- revision:
Optional. The revision of the dataset. Often the commit id. Use in case you want to set the dataset version.
- streaming (bool):
indicating if streaming should be used.
- filtering_lambda (str, optional):
A lambda function for filtering the data after loading.
- num_proc (int, optional):
Specifies the number of processes to use for parallel dataset loading.
- Example:
Loading glueβs mrpc dataset
load_hf = LoadHF(path='glue', name='mrpc')
References: templates.classification.multi_class.all, tasks.classification.multi_class
Read more about catalog usage here.