Safetensors
Latvian
bert
SkyWater21 commited on
Commit
8835ae8
·
verified ·
1 Parent(s): 39b06d2

Initial commit

Browse files
README.md CHANGED
@@ -1,3 +1,98 @@
1
  ---
2
- license: apache-2.0
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: mit
3
+ datasets:
4
+ - SkyWater21/lv_go_emotions
5
+ language:
6
+ - lv
7
  ---
8
+ Fine-tuned [multilingual BERT](https://huggingface.co/google-bert/bert-base-multilingual-cased) 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: 64
71
+ shuffle: True
72
+ num_workers: 8
73
+ pin_memory: False
74
+ drop_last: False
75
+ optimizer: adam
76
+ lr: 0.00001
77
+ weight_decay: 0
78
+
79
+ problem_type: multi_label_classification
80
+
81
+ num_epochs: 4
82
+ ```
83
+
84
+
85
+ Evaluation results on test split of [lv_go_emotions](https://huggingface.co/datasets/SkyWater21/lv_go_emotions/viewer/simplified_ekman)
86
+ | |Precision|Recall|F1-Score|AUC-ROC|Support|
87
+ |--------------|---------|------|--------|-------|-------|
88
+ |anger | 0.58| 0.36| 0.45| 0.83| 726|
89
+ |disgust | 0.88| 0.12| 0.21| 0.90| 123|
90
+ |fear | 0.75| 0.48| 0.58| 0.93| 98|
91
+ |joy | 0.82| 0.76| 0.79| 0.90| 2104|
92
+ |sadness | 0.69| 0.46| 0.55| 0.88| 379|
93
+ |surprise | 0.61| 0.51| 0.55| 0.87| 677|
94
+ |neutral | 0.65| 0.62| 0.64| 0.83| 1787|
95
+ |micro avg | 0.71| 0.60| 0.65| 0.92| 5894|
96
+ |macro avg | 0.71| 0.47| 0.54| 0.88| 5894|
97
+ |weighted avg | 0.71| 0.60| 0.64| 0.87| 5894|
98
+ |samples avg | 0.63| 0.62| 0.62| nan| 5894|
config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "google-bert/bert-base-multilingual-cased",
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.45.1",
47
+ "type_vocab_size": 2,
48
+ "use_cache": true,
49
+ "vocab_size": 119547
50
+ }
evaluation_results_on_test_split.csv ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ ,anger,disgust,fear,joy,sadness,surprise,neutral,micro avg,macro avg,weighted avg,samples avg
2
+ precision,0.58,0.88,0.75,0.82,0.69,0.61,0.65,0.71,0.71,0.71,0.63
3
+ recall,0.36,0.12,0.48,0.76,0.46,0.51,0.62,0.6,0.47,0.6,0.62
4
+ f1-score,0.45,0.21,0.58,0.79,0.55,0.55,0.64,0.65,0.54,0.64,0.62
5
+ support,726.0,123.0,98.0,2104.0,379.0,677.0,1787.0,5894.0,5894.0,5894.0,5894.0
6
+ auc-roc,0.83,0.9,0.93,0.9,0.88,0.87,0.83,0.92,0.88,0.87,
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c81861f6623de9da59fe8cda0c9f2a402fbb8866cf9362403d19bb0a9ed2be4f
3
+ size 711458836
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,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
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": false,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": false,
47
+ "mask_token": "[MASK]",
48
+ "model_max_length": 512,
49
+ "pad_token": "[PAD]",
50
+ "sep_token": "[SEP]",
51
+ "strip_accents": null,
52
+ "tokenize_chinese_chars": true,
53
+ "tokenizer_class": "BertTokenizer",
54
+ "unk_token": "[UNK]"
55
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff