SkyWater21
commited on
Commit
•
41aee3e
1
Parent(s):
25f7c83
Init commit
Browse files- .gitignore +2 -0
- README.md +95 -4
- config.json +50 -0
- model.safetensors +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +57 -0
- vocab.txt +0 -0
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
# Ignore .idea folder
|
2 |
+
.idea/
|
README.md
CHANGED
@@ -1,8 +1,99 @@
|
|
1 |
---
|
2 |
-
license:
|
3 |
datasets:
|
4 |
-
-
|
5 |
language:
|
6 |
- lv
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: mit
|
3 |
datasets:
|
4 |
+
- SkyWater21/lv_go_emotions
|
5 |
language:
|
6 |
- lv
|
7 |
+
---
|
8 |
+
Fine-tuned [LVBERT](https://huggingface.co/AiLab-IMCS-UL/lvbert) for multi-label emotion classification task.
|
9 |
+
|
10 |
+
Model was trained on [lv_go_emotions](https://huggingface.co/datasets/SkyWater21/lv_go_emotions) dataset. This dataset is Latvian translation of [GoEmotions](https://huggingface.co/datasets/go_emotions) dataset. Google Translate was used to generate the machine translation.
|
11 |
+
|
12 |
+
Original 26 emotions were mapped to 6 base emotions as per Dr. Ekman theory.
|
13 |
+
|
14 |
+
Labels predicted by classifier:
|
15 |
+
```yaml
|
16 |
+
0: anger
|
17 |
+
1: disgust
|
18 |
+
2: fear
|
19 |
+
3: joy
|
20 |
+
4: sadness
|
21 |
+
5: surprise
|
22 |
+
6: neutral
|
23 |
+
```
|
24 |
+
|
25 |
+
Label mapping from 27 emotions from GoEmotion to 6 base emotions as per Dr. Ekman theory:
|
26 |
+
|GoEmotion|Ekman|
|
27 |
+
|---|---|
|
28 |
+
| admiration | joy|
|
29 |
+
| amusement | joy|
|
30 |
+
| anger | anger|
|
31 |
+
| annoyance | anger|
|
32 |
+
| approval | joy|
|
33 |
+
| caring | joy|
|
34 |
+
| confusion | surprise|
|
35 |
+
| curiosity | surprise|
|
36 |
+
| desire | joy|
|
37 |
+
| disappointment | sadness|
|
38 |
+
| disapproval | anger|
|
39 |
+
| disgust | disgust|
|
40 |
+
| embarrassment | sadness|
|
41 |
+
| excitement | joy|
|
42 |
+
| fear | fear|
|
43 |
+
| gratitude | joy|
|
44 |
+
| grief | sadness|
|
45 |
+
| joy | joy|
|
46 |
+
| love | joy|
|
47 |
+
| nervousness | fear|
|
48 |
+
| optimism | joy|
|
49 |
+
| pride | joy|
|
50 |
+
| realization | surprise|
|
51 |
+
| relief | joy|
|
52 |
+
| remorse | sadness|
|
53 |
+
| sadness | sadness|
|
54 |
+
| surprise | surprise|
|
55 |
+
| neutral | neutral|
|
56 |
+
|
57 |
+
Seed used for random number generator is 42:
|
58 |
+
```python
|
59 |
+
def set_seed(seed=42):
|
60 |
+
random.seed(seed)
|
61 |
+
np.random.seed(seed)
|
62 |
+
torch.manual_seed(seed)
|
63 |
+
if torch.cuda.is_available():
|
64 |
+
torch.cuda.manual_seed_all(seed)
|
65 |
+
```
|
66 |
+
|
67 |
+
Training parameters:
|
68 |
+
```yaml
|
69 |
+
max_length: null
|
70 |
+
batch_size: 32
|
71 |
+
shuffle: True
|
72 |
+
num_workers: 2
|
73 |
+
pin_memory: False
|
74 |
+
drop_last: False
|
75 |
+
|
76 |
+
optimizer: adam
|
77 |
+
lr: 0.00001
|
78 |
+
weight_decay: 0
|
79 |
+
|
80 |
+
problem_type: multi_label_classification
|
81 |
+
|
82 |
+
num_epochs: 3
|
83 |
+
```
|
84 |
+
|
85 |
+
|
86 |
+
Evaluation results on test split of [lv_go_emotions](https://huggingface.co/datasets/SkyWater21/lv_go_emotions/viewer/simplified_ekman)
|
87 |
+
| |Precision|Recall|F1-Score|AUC-ROC|Support|
|
88 |
+
|--------------|---------|------|--------|-------|-------|
|
89 |
+
|anger | 0.57| 0.40| 0.47| 0.85| 726|
|
90 |
+
|disgust | 0.64| 0.28| 0.39| 0.93| 123|
|
91 |
+
|fear | 0.63| 0.54| 0.58| 0.95| 98|
|
92 |
+
|joy | 0.80| 0.79| 0.79| 0.91| 2104|
|
93 |
+
|sadness | 0.70| 0.44| 0.54| 0.90| 379|
|
94 |
+
|surprise | 0.63| 0.44| 0.52| 0.89| 677|
|
95 |
+
|neutral | 0.65| 0.62| 0.64| 0.83| 1787|
|
96 |
+
|micro avg | 0.70| 0.61| 0.66| 0.93| 5894|
|
97 |
+
|macro avg | 0.66| 0.50| 0.56| 0.89| 5894|
|
98 |
+
|weighted avg | 0.69| 0.61| 0.65| 0.88| 5894|
|
99 |
+
|samples avg | 0.65| 0.63| 0.63| nan| 5894|
|
config.json
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "AiLab-IMCS-UL/lvbert",
|
3 |
+
"architectures": [
|
4 |
+
"BertForSequenceClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"directionality": "bidi",
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 768,
|
12 |
+
"id2label": {
|
13 |
+
"0": "anger",
|
14 |
+
"1": "disgust",
|
15 |
+
"2": "fear",
|
16 |
+
"3": "joy",
|
17 |
+
"4": "sadness",
|
18 |
+
"5": "surprise",
|
19 |
+
"6": "neutral"
|
20 |
+
},
|
21 |
+
"initializer_range": 0.02,
|
22 |
+
"intermediate_size": 3072,
|
23 |
+
"label2id": {
|
24 |
+
"anger": 0,
|
25 |
+
"disgust": 1,
|
26 |
+
"fear": 2,
|
27 |
+
"joy": 3,
|
28 |
+
"neutral": 6,
|
29 |
+
"sadness": 4,
|
30 |
+
"surprise": 5
|
31 |
+
},
|
32 |
+
"layer_norm_eps": 1e-12,
|
33 |
+
"max_position_embeddings": 512,
|
34 |
+
"model_type": "bert",
|
35 |
+
"num_attention_heads": 12,
|
36 |
+
"num_hidden_layers": 12,
|
37 |
+
"pad_token_id": 0,
|
38 |
+
"pooler_fc_size": 768,
|
39 |
+
"pooler_num_attention_heads": 12,
|
40 |
+
"pooler_num_fc_layers": 3,
|
41 |
+
"pooler_size_per_head": 128,
|
42 |
+
"pooler_type": "first_token_transform",
|
43 |
+
"position_embedding_type": "absolute",
|
44 |
+
"problem_type": "multi_label_classification",
|
45 |
+
"torch_dtype": "float32",
|
46 |
+
"transformers_version": "4.39.3",
|
47 |
+
"type_vocab_size": 2,
|
48 |
+
"use_cache": true,
|
49 |
+
"vocab_size": 32004
|
50 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3fdf83f57d45707e774742a21d24d695e6222f14e18d41b5748a8c0f28a9e1d3
|
3 |
+
size 442526732
|
special_tokens_map.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"3": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"4": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": true,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_basic_tokenize": true,
|
47 |
+
"do_lower_case": false,
|
48 |
+
"mask_token": "[MASK]",
|
49 |
+
"model_max_length": 1000000000000000019884624838656,
|
50 |
+
"never_split": null,
|
51 |
+
"pad_token": "[PAD]",
|
52 |
+
"sep_token": "[SEP]",
|
53 |
+
"strip_accents": null,
|
54 |
+
"tokenize_chinese_chars": true,
|
55 |
+
"tokenizer_class": "BertTokenizer",
|
56 |
+
"unk_token": "[UNK]"
|
57 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|