muxitox commited on
Commit
db4bf16
1 Parent(s): 788a69b

Initial commit

Browse files
README.md CHANGED
@@ -1,3 +1,146 @@
1
  ---
 
 
 
 
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+
3
+ language:
4
+ - ca
5
+
6
  license: apache-2.0
7
+
8
+ tags:
9
+ - "catalan"
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-ca-v2-massive
25
+ results:
26
+ - task:
27
+ name: text-classification
28
+ type: text-classification
29
+ dataset:
30
+ name: MASSIVE
31
+ type: AmazonScience/massive
32
+ config: ca-ES
33
+ split: test
34
+ metrics:
35
+ - name: F1
36
+ type: f1
37
+ value: 0.8756
38
+
39
+ widget:
40
+
41
+ - text: "m'agraden les cançons del serrat"
42
+ - text: "quina hora és"
43
+ - text: "què hi ha de nou a les notícies"
44
+ - text: "quins errors sols fer"
45
+
46
  ---
47
+
48
+ # Catalan BERTa (roberta-large-ca-v2) finetuned for Intent Classification
49
+
50
+ ## Table of Contents
51
+ <details>
52
+ <summary>Click to expand</summary>
53
+
54
+ - [Model description](#model-description)
55
+ - [Intended uses and limitations](#intended-use)
56
+ - [How to use](#how-to-use)
57
+ - [Limitations and bias](#limitations-and-bias)
58
+ - [Training](#training)
59
+ - [Training data](#training-data)
60
+ - [Training procedure](#training-procedure)
61
+ - [Evaluation](#evaluation)
62
+ - [Variable and metrics](#variable-and-metrics)
63
+ - [Evaluation results](#evaluation-results)
64
+ - [Additional information](#additional-information)
65
+ - [Author](#author)
66
+ - [Contact information](#contact-information)
67
+ - [Copyright](#copyright)
68
+ - [Licensing information](#licensing-information)
69
+ - [Funding](#funding)
70
+ - [Citing information](#citing-information)
71
+ - [Disclaimer](#disclaimer)
72
+ </details>
73
+
74
+ ## Model description
75
+
76
+ The **roberta-large-ca-v2-massive** is a Intent Classification model for the Catalan language fine-tuned from the roberta-large-ca-v2 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.
77
+
78
+ ## Intended uses and limitations
79
+
80
+ The **roberta-large-ca-v2-massive** model can be used for intent prediction in plain text sentences. 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.
81
+
82
+ ## How to use
83
+
84
+ Here is how to use this model:
85
+
86
+ ```python
87
+ from transformers import pipeline
88
+ from pprint import pprint
89
+
90
+ nlp = pipeline("text-classification", model="projecte-aina/roberta-large-ca-v2-massive")
91
+ example = "m'agraden les cançons del serrat"
92
+
93
+ intent = nlp(example)
94
+ pprint(intent)
95
+ ```
96
+
97
+ ## Limitations and bias
98
+ 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.
99
+
100
+ ## Training
101
+
102
+ ### Training data
103
+ We used the Catalan split of the [MASSIVE](https://huggingface.co/datasets/AmazonScience/massive) dataset for training and evaluation.
104
+
105
+ ### Training procedure
106
+ The model was trained with a batch size of 16 and a learning rate of 5e-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.
107
+
108
+ ## Evaluation
109
+
110
+ ### Variable and metrics
111
+
112
+ This model was finetuned maximizing the weighted F1 score.
113
+
114
+ ### Evaluation results
115
+ We evaluated the _roberta-large-ca-v2-massive_ on the MASSIVE test set obtaining a weighted F1 score of 87.56.
116
+
117
+ ## Additional information
118
+
119
+ ### Author
120
+ Text Mining Unit (TeMU) at the Barcelona Supercomputing Center (bsc-temu@bsc.es)
121
+
122
+ ### Contact information
123
+ For further information, send an email to aina@bsc.es
124
+
125
+ ### Copyright
126
+ Copyright (c) 2022 Text Mining Unit at Barcelona Supercomputing Center
127
+
128
+ ### Licensing information
129
+ [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
130
+
131
+ ### Funding
132
+ This work was funded by the [Departament de la Vicepresidència i de Polítiques Digitals i Territori de la Generalitat de Catalunya](https://politiquesdigitals.gencat.cat/ca/inici/index.html#googtrans(ca|en) within the framework of [Projecte AINA](https://politiquesdigitals.gencat.cat/ca/economia/catalonia-ai/aina).
133
+
134
+ ### Citation Information
135
+ NA
136
+
137
+ ### Disclaimer
138
+
139
+ <details>
140
+ <summary>Click to expand</summary>
141
+
142
+ 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.
143
+
144
+ 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.
145
+
146
+ In no event shall the owner and creator of the models (BSC – Barcelona Supercomputing Center) be liable for any results arising from the use made by third parties of these models.
config.json ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/gpfs/projects/bsc88/BERTs/models/roberta_large_ca_jsc/transformed_checkpoint13",
3
+ "architectures": [
4
+ "RobertaForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 2,
10
+ "finetuning_task": "tecla",
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 1024,
14
+ "id2label": {
15
+ "0": "datetime_query",
16
+ "1": "iot_hue_lightchange",
17
+ "2": "transport_ticket",
18
+ "3": "takeaway_query",
19
+ "4": "qa_stock",
20
+ "5": "general_greet",
21
+ "6": "recommendation_events",
22
+ "7": "music_dislikeness",
23
+ "8": "iot_wemo_off",
24
+ "9": "cooking_recipe",
25
+ "10": "qa_currency",
26
+ "11": "transport_traffic",
27
+ "12": "general_quirky",
28
+ "13": "weather_query",
29
+ "14": "audio_volume_up",
30
+ "15": "email_addcontact",
31
+ "16": "takeaway_order",
32
+ "17": "email_querycontact",
33
+ "18": "iot_hue_lightup",
34
+ "19": "recommendation_locations",
35
+ "20": "play_audiobook",
36
+ "21": "lists_createoradd",
37
+ "22": "news_query",
38
+ "23": "alarm_query",
39
+ "24": "iot_wemo_on",
40
+ "25": "general_joke",
41
+ "26": "qa_definition",
42
+ "27": "social_query",
43
+ "28": "music_settings",
44
+ "29": "audio_volume_other",
45
+ "30": "calendar_remove",
46
+ "31": "iot_hue_lightdim",
47
+ "32": "calendar_query",
48
+ "33": "email_sendemail",
49
+ "34": "iot_cleaning",
50
+ "35": "audio_volume_down",
51
+ "36": "play_radio",
52
+ "37": "cooking_query",
53
+ "38": "datetime_convert",
54
+ "39": "qa_maths",
55
+ "40": "iot_hue_lightoff",
56
+ "41": "iot_hue_lighton",
57
+ "42": "transport_query",
58
+ "43": "music_likeness",
59
+ "44": "email_query",
60
+ "45": "play_music",
61
+ "46": "audio_volume_mute",
62
+ "47": "social_post",
63
+ "48": "alarm_set",
64
+ "49": "qa_factoid",
65
+ "50": "calendar_set",
66
+ "51": "play_game",
67
+ "52": "alarm_remove",
68
+ "53": "lists_remove",
69
+ "54": "transport_taxi",
70
+ "55": "recommendation_movies",
71
+ "56": "iot_coffee",
72
+ "57": "music_query",
73
+ "58": "play_podcasts",
74
+ "59": "lists_query"
75
+ },
76
+ "initializer_range": 0.02,
77
+ "intermediate_size": 4096,
78
+ "label2id": {
79
+ "alarm_query": 23,
80
+ "alarm_remove": 52,
81
+ "alarm_set": 48,
82
+ "audio_volume_down": 35,
83
+ "audio_volume_mute": 46,
84
+ "audio_volume_other": 29,
85
+ "audio_volume_up": 14,
86
+ "calendar_query": 32,
87
+ "calendar_remove": 30,
88
+ "calendar_set": 50,
89
+ "cooking_query": 37,
90
+ "cooking_recipe": 9,
91
+ "datetime_convert": 38,
92
+ "datetime_query": 0,
93
+ "email_addcontact": 15,
94
+ "email_query": 44,
95
+ "email_querycontact": 17,
96
+ "email_sendemail": 33,
97
+ "general_greet": 5,
98
+ "general_joke": 25,
99
+ "general_quirky": 12,
100
+ "iot_cleaning": 34,
101
+ "iot_coffee": 56,
102
+ "iot_hue_lightchange": 1,
103
+ "iot_hue_lightdim": 31,
104
+ "iot_hue_lightoff": 40,
105
+ "iot_hue_lighton": 41,
106
+ "iot_hue_lightup": 18,
107
+ "iot_wemo_off": 8,
108
+ "iot_wemo_on": 24,
109
+ "lists_createoradd": 21,
110
+ "lists_query": 59,
111
+ "lists_remove": 53,
112
+ "music_dislikeness": 7,
113
+ "music_likeness": 43,
114
+ "music_query": 57,
115
+ "music_settings": 28,
116
+ "news_query": 22,
117
+ "play_audiobook": 20,
118
+ "play_game": 51,
119
+ "play_music": 45,
120
+ "play_podcasts": 58,
121
+ "play_radio": 36,
122
+ "qa_currency": 10,
123
+ "qa_definition": 26,
124
+ "qa_factoid": 49,
125
+ "qa_maths": 39,
126
+ "qa_stock": 4,
127
+ "recommendation_events": 6,
128
+ "recommendation_locations": 19,
129
+ "recommendation_movies": 55,
130
+ "social_post": 47,
131
+ "social_query": 27,
132
+ "takeaway_order": 16,
133
+ "takeaway_query": 3,
134
+ "transport_query": 42,
135
+ "transport_taxi": 54,
136
+ "transport_ticket": 2,
137
+ "transport_traffic": 11,
138
+ "weather_query": 13
139
+ },
140
+ "layer_norm_eps": 1e-05,
141
+ "max_position_embeddings": 514,
142
+ "model_type": "roberta",
143
+ "num_attention_heads": 16,
144
+ "num_hidden_layers": 24,
145
+ "pad_token_id": 1,
146
+ "position_embedding_type": "absolute",
147
+ "problem_type": "single_label_classification",
148
+ "torch_dtype": "float32",
149
+ "transformers_version": "4.17.0",
150
+ "type_vocab_size": 1,
151
+ "use_cache": true,
152
+ "vocab_size": 50262
153
+ }
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:3a5eb5b3a905fd5085828b39dd852bd3c016b836acc3ef2c7427e4cb5f4e10be
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_ca_jsc/transformed_checkpoint13", "tokenizer_class": "RobertaTokenizer"}
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fbf2dad39811537bdbc644e56d01264965edf8e2c7d57c4cff5dd19fc1005f0
3
+ size 3119
vocab.json ADDED
The diff for this file is too large to render. See raw diff