finiteautomata commited on
Commit
d2805e7
1 Parent(s): d2e0a2e

First version

Browse files
README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Sentiment Analysis in Spanish
2
+ ## robertuito-sentiment-analysis
3
+
4
+ Repository: [https://github.com/pysentimiento/pysentimiento/](https://github.com/finiteautomata/pysentimiento/)
5
+
6
+
7
+
8
+ Model trained with TASS 2020 Task 2 corpus for Emotion detection in Spanish. Base model is [BETO](https://github.com/dccuchile/beto), a BERT model trained in Spanish.
9
+
10
+ Contains the six Ekman emotions plus a neutral class:
11
+
12
+ - anger
13
+ - disgust
14
+ - fear
15
+ - joy
16
+ - sadness
17
+
18
+
19
+ ## Results
20
+
21
+ Results for the four tasks evaluated in `pysentimiento`. Results are expressed as Macro F1 scores
22
+
23
+
24
+ | model | emotion | hate_speech | irony | sentiment |
25
+ |:--------------|:--------------|:--------------|:--------------|:--------------|
26
+ | robertuito | 0.560 ± 0.010 | 0.759 ± 0.007 | 0.739 ± 0.005 | 0.705 ± 0.003 |
27
+ | roberta | 0.527 ± 0.015 | 0.741 ± 0.012 | 0.721 ± 0.008 | 0.670 ± 0.006 |
28
+ | bertin | 0.524 ± 0.007 | 0.738 ± 0.007 | 0.713 ± 0.012 | 0.666 ± 0.005 |
29
+ | beto_uncased | 0.532 ± 0.012 | 0.727 ± 0.016 | 0.701 ± 0.007 | 0.651 ± 0.006 |
30
+ | beto_cased | 0.516 ± 0.012 | 0.724 ± 0.012 | 0.705 ± 0.009 | 0.662 ± 0.005 |
31
+ | mbert_uncased | 0.493 ± 0.010 | 0.718 ± 0.011 | 0.681 ± 0.010 | 0.617 ± 0.003 |
32
+ | biGRU | 0.264 ± 0.007 | 0.592 ± 0.018 | 0.631 ± 0.011 | 0.585 ± 0.011 |
33
+
34
+
35
+ Note that for Hate Speech, these are the results for Semeval 2019, Task 5 Subtask B (HS+TR+AG detection)
36
+
37
+ ## Citation
38
+
39
+ If you use this model in your research, please cite pysentimiento and RoBERTuito papers:
40
+
41
+ ```
42
+ @misc{perez2021pysentimiento,
43
+ title={pysentimiento: A Python Toolkit for Sentiment Analysis and SocialNLP tasks},
44
+ author={Juan Manuel Pérez and Juan Carlos Giudici and Franco Luque},
45
+ year={2021},
46
+ eprint={2106.09462},
47
+ archivePrefix={arXiv},
48
+ primaryClass={cs.CL}
49
+ }
50
+ @misc{perez2021robertuito,
51
+ title={RoBERTuito: a pre-trained language model for social media text in Spanish},
52
+ author={Juan Manuel Pérez and Damián A. Furman and Laura Alonso Alemany and Franco Luque},
53
+ year={2021},
54
+ eprint={2111.09453},
55
+ archivePrefix={arXiv},
56
+ primaryClass={cs.CL}
57
+ }
58
+ ```
config.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "pysentimiento/robertuito-base-uncased",
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
+ "gradient_checkpointing": false,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 768,
14
+ "id2label": {
15
+ "0": "others",
16
+ "1": "joy",
17
+ "2": "sadness",
18
+ "3": "anger",
19
+ "4": "surprise",
20
+ "5": "disgust",
21
+ "6": "fear"
22
+ },
23
+ "initializer_range": 0.02,
24
+ "intermediate_size": 3072,
25
+ "label2id": {
26
+ "anger": 3,
27
+ "disgust": 5,
28
+ "fear": 6,
29
+ "joy": 1,
30
+ "others": 0,
31
+ "sadness": 2,
32
+ "surprise": 4
33
+ },
34
+ "layer_norm_eps": 1e-12,
35
+ "max_position_embeddings": 130,
36
+ "model_type": "roberta",
37
+ "num_attention_heads": 12,
38
+ "num_hidden_layers": 12,
39
+ "pad_token_id": 1,
40
+ "position_embedding_type": "absolute",
41
+ "problem_type": "single_label_classification",
42
+ "torch_dtype": "float32",
43
+ "transformers_version": "4.11.3",
44
+ "type_vocab_size": 1,
45
+ "use_cache": true,
46
+ "vocab_size": 30002
47
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d676686bcdb3436444ff2b9bc2bd7e8385eda4bc869e185e33db7839020a8f94
3
+ size 435258797
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": "<mask>"}
test_results.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "test_loss": 0.8017865419387817,
3
+ "test_others_f1": 0.7855089131684877,
4
+ "test_others_precision": 0.7489035087719298,
5
+ "test_others_recall": 0.8258766626360339,
6
+ "test_joy_f1": 0.6942148760330579,
7
+ "test_joy_precision": 0.6923076923076923,
8
+ "test_joy_recall": 0.6961325966850829,
9
+ "test_sadness_f1": 0.7789473684210526,
10
+ "test_sadness_precision": 0.8176795580110497,
11
+ "test_sadness_recall": 0.7437185929648241,
12
+ "test_anger_f1": 0.6787878787878787,
13
+ "test_anger_precision": 0.7,
14
+ "test_anger_recall": 0.6588235294117647,
15
+ "test_surprise_f1": 0.39639639639639646,
16
+ "test_surprise_precision": 0.5116279069767442,
17
+ "test_surprise_recall": 0.3235294117647059,
18
+ "test_disgust_f1": 0.0,
19
+ "test_disgust_precision": 0.0,
20
+ "test_disgust_recall": 0.0,
21
+ "test_fear_f1": 0.5714285714285715,
22
+ "test_fear_precision": 0.5882352941176471,
23
+ "test_fear_recall": 0.5555555555555556,
24
+ "test_micro_f1": 0.7316636851520574,
25
+ "test_acc": 0.7316636851520573,
26
+ "test_macro_f1": 0.557897686958313,
27
+ "test_macro_precision": 0.5798220038414001,
28
+ "test_macro_recall": 0.543376624584198,
29
+ "test_runtime": 4.5214,
30
+ "test_samples_per_second": 370.905,
31
+ "test_steps_per_second": 23.223
32
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "sep_token": "</s>", "cls_token": "<s>", "unk_token": "<unk>", "pad_token": "<pad>", "mask_token": "<mask>", "special_tokens_map_file": "models/twerto-base-uncased/special_tokens_map.json", "name_or_path": "pysentimiento/robertuito-base-uncased", "tokenizer_class": "PreTrainedTokenizerFast"}
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d1a89cea00663172987fb24abc1fdb376f1e51de07bfe016111505010e457a7
3
+ size 2799