Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
language:
|
4 |
+
- ru
|
5 |
+
metrics:
|
6 |
+
- f1
|
7 |
+
- roc_auc
|
8 |
+
- precision
|
9 |
+
- recall
|
10 |
+
pipeline_tag: text-classification
|
11 |
+
tags:
|
12 |
+
- emotion-classification
|
13 |
+
- emotion-recognition
|
14 |
+
- multi-label-classification
|
15 |
+
- emotion
|
16 |
+
- russian
|
17 |
+
- rubert
|
18 |
+
- tiny
|
19 |
+
- sentiment
|
20 |
+
- sentiment-analysis
|
21 |
+
- classification
|
22 |
+
- multilabel
|
23 |
+
- bert
|
24 |
+
datasets:
|
25 |
+
- cedr
|
26 |
+
---
|
27 |
+
|
28 |
+
This is [RuBERT-tiny2](https://huggingface.co/cointegrated/rubert-tiny2) model fine-tuned for __emotion classification__ of short __Russian__ texts.
|
29 |
+
The task is a __multi-label classification__ with the following labels:
|
30 |
+
|
31 |
+
```yaml
|
32 |
+
0: no_emotion
|
33 |
+
1: joy
|
34 |
+
2: sadness
|
35 |
+
3: surprise
|
36 |
+
4: fear
|
37 |
+
5: anger
|
38 |
+
```
|
39 |
+
|
40 |
+
Label to Russian label:
|
41 |
+
|
42 |
+
```yaml
|
43 |
+
no_emotion: нет эмоции
|
44 |
+
joy: радость
|
45 |
+
sadness: грусть
|
46 |
+
surprise: удивление
|
47 |
+
fear: страх
|
48 |
+
anger: злость
|
49 |
+
```
|
50 |
+
|
51 |
+
## Usage
|
52 |
+
|
53 |
+
```python
|
54 |
+
from transformers import pipeline
|
55 |
+
model = pipeline(model="seara/rubert-tiny2-cedr")
|
56 |
+
model("Привет, ты мне нравишься!")
|
57 |
+
# [{'label': 'joy', 'score': 0.9605025053024292}]
|
58 |
+
```
|
59 |
+
|
60 |
+
## Dataset
|
61 |
+
|
62 |
+
This model was trained on the [CEDR dataset](https://huggingface.co/datasets/cedr).
|
63 |
+
|
64 |
+
An overview of the training data can be found in the source [article](https://www.sciencedirect.com/science/article/pii/S1877050921013247).
|
65 |
+
|
66 |
+
## Training
|
67 |
+
|
68 |
+
Training were done in this [project](https://github.com/searayeah/vkr-bert) with this parameters:
|
69 |
+
|
70 |
+
```yaml
|
71 |
+
tokenizer.max_length: null
|
72 |
+
batch_size: 64
|
73 |
+
optimizer: adam
|
74 |
+
lr: 0.00001
|
75 |
+
weight_decay: 0
|
76 |
+
num_epochs: 30
|
77 |
+
```
|
78 |
+
|
79 |
+
## Eval results (on test split)
|
80 |
+
|
81 |
+
| |no_emotion|joy |sadness|surprise|fear |anger|micro avg|macro avg|weighted avg|
|
82 |
+
|---------|----------|------|-------|--------|-------|-----|---------|---------|------------|
|
83 |
+
|precision|0.82 |0.84 |0.84 |0.79 |0.78 |0.55 |0.81 |0.77 |0.8 |
|
84 |
+
|recall |0.84 |0.83 |0.85 |0.66 |0.67 |0.33 |0.78 |0.7 |0.78 |
|
85 |
+
|f1-score |0.83 |0.83 |0.84 |0.72 |0.72 |0.41 |0.79 |0.73 |0.79 |
|
86 |
+
|auc-roc |0.92 |0.96 |0.96 |0.91 |0.91 |0.77 |0.94 |0.91 |0.93 |
|
87 |
+
|support |734 |353 |379 |170 |141 |125 |1902 |1902 |1902 |
|