muxitox commited on
Commit
c740c4c
1 Parent(s): 185c23b

Initial commit. Upload model

Browse files
README.md CHANGED
@@ -1,3 +1,145 @@
1
  ---
 
 
 
 
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+
3
+ language:
4
+ - ca
5
+
6
  license: apache-2.0
7
+
8
+ tags:
9
+ - "spanish"
10
+ - "text-classification"
11
+ - "multi-class-classification"
12
+ - "natural-language-understanding"
13
+ - "intent-classificaiton"
14
+ - "roberta-large"
15
+
16
+
17
+ datasets:
18
+ - "AmazonScience/massive"
19
+
20
+ metrics:
21
+ - f1
22
+
23
+ model-index:
24
+ - name: roberta-large-bne-massive
25
+ results:
26
+ - task:
27
+ name: text-classification
28
+ type: text-classification
29
+ dataset:
30
+ name: MASSIVE
31
+ type: AmazonScience/massive
32
+ config: es-ES
33
+ split: test
34
+ metrics:
35
+ - name: F1
36
+ type: f1
37
+ value: 0.8727
38
+
39
+
40
  ---
41
+
42
+ # Spanish BERTa (roberta-large-bne-massive) finetuned for Intent Classification
43
+
44
+ ## Table of Contents
45
+ <details>
46
+ <summary>Click to expand</summary>
47
+
48
+ - [Model description](#model-description)
49
+ - [Intended uses and limitations](#intended-use)
50
+ - [How to use](#how-to-use)
51
+ - [Limitations and bias](#limitations-and-bias)
52
+ - [Training](#training)
53
+ - [Training data](#training-data)
54
+ - [Training procedure](#training-procedure)
55
+ - [Evaluation](#evaluation)
56
+ - [Variable and metrics](#variable-and-metrics)
57
+ - [Evaluation results](#evaluation-results)
58
+ - [Additional information](#additional-information)
59
+ - [Author](#author)
60
+ - [Contact information](#contact-information)
61
+ - [Copyright](#copyright)
62
+ - [Licensing information](#licensing-information)
63
+ - [Funding](#funding)
64
+ - [Citing information](#citing-information)
65
+ - [Disclaimer](#disclaimer)
66
+ </details>
67
+
68
+ ## Model description
69
+
70
+ The **roberta-large-bne-massive** is a Intent Classification model for the Catalan language fine-tuned from the roberta-large-bne-massive model, a [RoBERTa](https://arxiv.org/abs/1907.11692) based model pre-trained on a medium-size corpus collected from publicly available corpora and crawlers.
71
+
72
+ ## Intended uses and limitations
73
+
74
+ The **roberta-large-bne-massive** model can be used for intent prediction in plain text sentences in Spanish. It can be used in combination with an Automatic Speech Recognition model in order to implement a Voice Assistant. The model is limited by its training dataset and may not generalize well for all use cases.
75
+
76
+ ## How to use
77
+
78
+ Here is how to use this model:
79
+
80
+ ```python
81
+ from transformers import pipeline
82
+ from pprint import pprint
83
+
84
+ nlp = pipeline("text-classification", model="PlanTL-GOB-ES/roberta-large-bne-massive")
85
+ example = "m'agraden les cançons del serrat"
86
+
87
+ intent = nlp(example)
88
+ pprint(intent)
89
+ ```
90
+
91
+ ## Limitations and bias
92
+ At the time of submission, no measures have been taken to estimate the bias embedded in the model. However, we are well aware that our models may be biased since the corpora have been collected using crawling techniques on multiple web sources. We intend to conduct research in these areas in the future, and if completed, this model card will be updated.
93
+
94
+ ## Training
95
+
96
+ ### Training data
97
+ We used the Catalan split of the [MASSIVE](https://huggingface.co/datasets/AmazonScience/massive) dataset for training and evaluation.
98
+
99
+ ### Training procedure
100
+ The model was trained with a batch size of 16 and a learning rate of 1e-5 for 20 epochs. We then selected the best checkpoint using the downstream task metric in the corresponding development set and then evaluated it on the test set.
101
+
102
+ ## Evaluation
103
+
104
+ ### Variable and metrics
105
+
106
+ This model was finetuned maximizing the weighted F1 score.
107
+
108
+ ### Evaluation results
109
+ We evaluated the _roberta-large-bne-massive_ on the MASSIVE test set obtaining a weighted F1 score of 87.27.
110
+
111
+ ## Additional information
112
+
113
+ ### Author
114
+ Text Mining Unit (TeMU) at the Barcelona Supercomputing Center (bsc-temu@bsc.es)
115
+
116
+ ### Contact information
117
+ For further information, send an email to <plantl-gob-es@bsc.es>
118
+
119
+ ### Copyright
120
+ Copyright by the Spanish State Secretariat for Digitalization and Artificial Intelligence (SEDIA) (2022)
121
+
122
+ ### Licensing information
123
+ [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
124
+
125
+ ### Funding
126
+ This work was funded by the Spanish State Secretariat for Digitalization and Artificial Intelligence (SEDIA) within the framework of the Plan-TL.
127
+
128
+ ### Disclaimer
129
+
130
+ <details>
131
+ <summary>Click to expand</summary>
132
+
133
+ The models published in this repository are intended for a generalist purpose and are available to third parties. These models may have bias and/or any other undesirable distortions.
134
+
135
+ When third parties, deploy or provide systems and/or services to other parties using any of these models (or using systems based on these models) or become users of the models, they should note that it is their responsibility to mitigate the risks arising from their use and, in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.
136
+
137
+ In no event shall the owner of the models (SEDIA – State Secretariat for Digitalization and Artificial Intelligence) nor the creator (BSC – Barcelona Supercomputing Center) be liable for any results arising from the use made by third parties of these models.
138
+
139
+
140
+ Los modelos publicados en este repositorio tienen una finalidad generalista y están a disposición de terceros. Estos modelos pueden tener sesgos y/u otro tipo de distorsiones indeseables.
141
+
142
+ Cuando terceros desplieguen o proporcionen sistemas y/o servicios a otras partes usando alguno de estos modelos (o utilizando sistemas basados en estos modelos) o se conviertan en usuarios de los modelos, deben tener en cuenta que es su responsabilidad mitigar los riesgos derivados de su uso y, en todo caso, cumplir con la normativa aplicable, incluyendo la normativa en materia de uso de inteligencia artificial.
143
+
144
+ En ningún caso el propietario de los modelos (SEDIA – Secretaría de Estado de Digitalización e Inteligencia Artificial) ni el creador (BSC – Barcelona Supercomputing Center) serán responsables de los resultados derivados del uso que hagan terceros de estos modelos.
145
+ </details>
config.json ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/gpfs/projects/bsc88/BERTs/models/roberta-large-bne",
3
+ "architectures": [
4
+ "RobertaForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 2,
10
+ "finetuning_task": "tecla",
11
+ "gradient_checkpointing": false,
12
+ "hidden_act": "gelu",
13
+ "hidden_dropout_prob": 0.0,
14
+ "hidden_size": 1024,
15
+ "id2label": {
16
+ "0": "datetime_query",
17
+ "1": "iot_hue_lightchange",
18
+ "2": "transport_ticket",
19
+ "3": "takeaway_query",
20
+ "4": "qa_stock",
21
+ "5": "general_greet",
22
+ "6": "recommendation_events",
23
+ "7": "music_dislikeness",
24
+ "8": "iot_wemo_off",
25
+ "9": "cooking_recipe",
26
+ "10": "qa_currency",
27
+ "11": "transport_traffic",
28
+ "12": "general_quirky",
29
+ "13": "weather_query",
30
+ "14": "audio_volume_up",
31
+ "15": "email_addcontact",
32
+ "16": "takeaway_order",
33
+ "17": "email_querycontact",
34
+ "18": "iot_hue_lightup",
35
+ "19": "recommendation_locations",
36
+ "20": "play_audiobook",
37
+ "21": "lists_createoradd",
38
+ "22": "news_query",
39
+ "23": "alarm_query",
40
+ "24": "iot_wemo_on",
41
+ "25": "general_joke",
42
+ "26": "qa_definition",
43
+ "27": "social_query",
44
+ "28": "music_settings",
45
+ "29": "audio_volume_other",
46
+ "30": "calendar_remove",
47
+ "31": "iot_hue_lightdim",
48
+ "32": "calendar_query",
49
+ "33": "email_sendemail",
50
+ "34": "iot_cleaning",
51
+ "35": "audio_volume_down",
52
+ "36": "play_radio",
53
+ "37": "cooking_query",
54
+ "38": "datetime_convert",
55
+ "39": "qa_maths",
56
+ "40": "iot_hue_lightoff",
57
+ "41": "iot_hue_lighton",
58
+ "42": "transport_query",
59
+ "43": "music_likeness",
60
+ "44": "email_query",
61
+ "45": "play_music",
62
+ "46": "audio_volume_mute",
63
+ "47": "social_post",
64
+ "48": "alarm_set",
65
+ "49": "qa_factoid",
66
+ "50": "calendar_set",
67
+ "51": "play_game",
68
+ "52": "alarm_remove",
69
+ "53": "lists_remove",
70
+ "54": "transport_taxi",
71
+ "55": "recommendation_movies",
72
+ "56": "iot_coffee",
73
+ "57": "music_query",
74
+ "58": "play_podcasts",
75
+ "59": "lists_query"
76
+ },
77
+ "initializer_range": 0.02,
78
+ "intermediate_size": 4096,
79
+ "label2id": {
80
+ "alarm_query": 23,
81
+ "alarm_remove": 52,
82
+ "alarm_set": 48,
83
+ "audio_volume_down": 35,
84
+ "audio_volume_mute": 46,
85
+ "audio_volume_other": 29,
86
+ "audio_volume_up": 14,
87
+ "calendar_query": 32,
88
+ "calendar_remove": 30,
89
+ "calendar_set": 50,
90
+ "cooking_query": 37,
91
+ "cooking_recipe": 9,
92
+ "datetime_convert": 38,
93
+ "datetime_query": 0,
94
+ "email_addcontact": 15,
95
+ "email_query": 44,
96
+ "email_querycontact": 17,
97
+ "email_sendemail": 33,
98
+ "general_greet": 5,
99
+ "general_joke": 25,
100
+ "general_quirky": 12,
101
+ "iot_cleaning": 34,
102
+ "iot_coffee": 56,
103
+ "iot_hue_lightchange": 1,
104
+ "iot_hue_lightdim": 31,
105
+ "iot_hue_lightoff": 40,
106
+ "iot_hue_lighton": 41,
107
+ "iot_hue_lightup": 18,
108
+ "iot_wemo_off": 8,
109
+ "iot_wemo_on": 24,
110
+ "lists_createoradd": 21,
111
+ "lists_query": 59,
112
+ "lists_remove": 53,
113
+ "music_dislikeness": 7,
114
+ "music_likeness": 43,
115
+ "music_query": 57,
116
+ "music_settings": 28,
117
+ "news_query": 22,
118
+ "play_audiobook": 20,
119
+ "play_game": 51,
120
+ "play_music": 45,
121
+ "play_podcasts": 58,
122
+ "play_radio": 36,
123
+ "qa_currency": 10,
124
+ "qa_definition": 26,
125
+ "qa_factoid": 49,
126
+ "qa_maths": 39,
127
+ "qa_stock": 4,
128
+ "recommendation_events": 6,
129
+ "recommendation_locations": 19,
130
+ "recommendation_movies": 55,
131
+ "social_post": 47,
132
+ "social_query": 27,
133
+ "takeaway_order": 16,
134
+ "takeaway_query": 3,
135
+ "transport_query": 42,
136
+ "transport_taxi": 54,
137
+ "transport_ticket": 2,
138
+ "transport_traffic": 11,
139
+ "weather_query": 13
140
+ },
141
+ "layer_norm_eps": 1e-05,
142
+ "max_position_embeddings": 514,
143
+ "model_type": "roberta",
144
+ "num_attention_heads": 16,
145
+ "num_hidden_layers": 24,
146
+ "pad_token_id": 1,
147
+ "position_embedding_type": "absolute",
148
+ "problem_type": "single_label_classification",
149
+ "torch_dtype": "float32",
150
+ "transformers_version": "4.17.0",
151
+ "type_vocab_size": 1,
152
+ "use_cache": true,
153
+ "vocab_size": 50262
154
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5002feed6943461f33ecf76e794b8a1f611490ff9e266b0c0d8212bf0622e2f
3
+ size 1421838701
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": {"content": "<s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "eos_token": {"content": "</s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "unk_token": {"content": "<unk>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "sep_token": {"content": "</s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "pad_token": {"content": "<pad>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "cls_token": {"content": "<s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true}}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"errors": "replace", "bos_token": {"content": "<s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "eos_token": {"content": "</s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "sep_token": {"content": "</s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "cls_token": {"content": "<s>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "unk_token": {"content": "<unk>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "pad_token": {"content": "<pad>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "add_prefix_space": true, "trim_offsets": true, "max_len": 512, "special_tokens_map_file": null, "name_or_path": "/gpfs/projects/bsc88/BERTs/models/roberta-large-bne", "tokenizer_class": "RobertaTokenizer"}
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e80baf7156920e17b3c4817bdfa2487562d076629a25044739da968ae59a7cf
3
+ size 3055
vocab.json ADDED
The diff for this file is too large to render. See raw diff