Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
- sentiment-analysis
|
13 |
+
- multi-class-classification
|
14 |
+
- sentiment analysis
|
15 |
+
- rubert
|
16 |
+
- sentiment
|
17 |
+
- bert
|
18 |
+
- russian
|
19 |
+
- multiclass
|
20 |
+
- classification
|
21 |
+
---
|
22 |
+
|
23 |
+
Модель [RuBERT](https://huggingface.co/DeepPavlov/rubert-base-cased) которая был fine-tuned на задачу __sentiment classification__ для коротких __Russian__ текстов.
|
24 |
+
Задача представляет собой __multi-class classification__ со следующими метками:
|
25 |
+
|
26 |
+
```yaml
|
27 |
+
0: neutral
|
28 |
+
1: positive
|
29 |
+
2: negative
|
30 |
+
```
|
31 |
+
|
32 |
+
## Usage
|
33 |
+
|
34 |
+
```python
|
35 |
+
from transformers import pipeline
|
36 |
+
model = pipeline(model="r1char9/rubert-base-cased-russian-sentiment")
|
37 |
+
model("Привет, ты мне нравишься!")
|
38 |
+
# [{'label': 'positive', 'score': 0.9818321466445923}]
|
39 |
+
```
|
40 |
+
|
41 |
+
## Dataset
|
42 |
+
|
43 |
+
Модель была натренирована на данных:
|
44 |
+
|
45 |
+
- Kaggle Russian News Dataset
|
46 |
+
- Linis Crowd 2015
|
47 |
+
- Linis Crowd 2016
|
48 |
+
- RuReviews
|
49 |
+
- RuSentiment
|
50 |
+
|
51 |
+
```yaml
|
52 |
+
tokenizer.max_length: 256
|
53 |
+
batch_size: 32
|
54 |
+
optimizer: adam
|
55 |
+
lr: 0.00001
|
56 |
+
weight_decay: 0
|
57 |
+
epochs: 2
|
58 |
+
```
|
59 |
+
|
60 |
+
Train/validation/test splits are 80%/10%/10%.
|
61 |
+
|
62 |
+
## Eval results (on test split)
|
63 |
+
|
64 |
+
| |neutral|positive|negative|macro avg|weighted avg|
|
65 |
+
|---------|-------|--------|--------|---------|------------|
|
66 |
+
|precision|0.72 |0.85 |0.75 |0.77 |0.77 |
|
67 |
+
|recall |0.75 |0.84 |0.72 |0.77 |0.77 |
|
68 |
+
|f1-score |0.73 |0.84 |0.73 |0.77 |0.77 |
|
69 |
+
|auc-roc |0.86 |0.96 |0.92 |0.91 |0.91 |
|
70 |
+
|support |5196 |3831 |3599 |12626 |12626 |
|