File size: 1,938 Bytes
59b3657
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d10ad71
59b3657
 
 
 
 
 
 
 
 
 
d10ad71
59b3657
 
 
 
d10ad71
 
 
59b3657
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
language: 
- tr
thumbnail: https://avatars3.githubusercontent.com/u/32437151?s=460&u=4ec59abc8d21d5feea3dab323d23a5860e6996a4&v=4
tags:
- text-classification
- emotion
- pytorch
datasets:
- emotion (Translated to Turkish)
metrics:
- Accuracy, F1 Score
---
# distilbert-base-turkish-cased-emotion

## Model description:
[Distilbert-base-turkish-cased](https://huggingface.co/dbmdz/distilbert-base-turkish-cased) finetuned on the emotion dataset (Translated to Turkish via Google Translate API) using HuggingFace Trainer with below Hyperparameters
```
 learning rate 2e-5, 
 batch size 64,
 num_train_epochs=8,
```

## Model Performance Comparision on Emotion Dataset from Twitter:

| Model | Accuracy | F1 Score |  Test Sample per Second |
| --- | --- | --- | --- |
| [Distilbert-base-turkish-cased-emotion](https://huggingface.co/zafercavdar/distilbert-base-turkish-cased-emotion) | 83.25 | 83.17 | 232.197 |

## How to Use the model:
```python
from transformers import pipeline
classifier = pipeline("text-classification",
                       model='zafercavdar/distilbert-base-turkish-cased-emotion',
                       return_all_scores=True)
prediction = classifier("Bu kütüphaneyi seviyorum, en iyi yanı kolay kullanımı.", )
print(prediction)

"""
Output:
[
  [
    {'label': 'sadness', 'score': 0.0026786490343511105},
    {'label': 'joy', 'score': 0.6600754261016846},
    {'label': 'love', 'score': 0.3203163146972656},
    {'label': 'anger', 'score': 0.004358913749456406},
    {'label': 'fear', 'score': 0.002354539930820465},
    {'label': 'surprise', 'score': 0.010216088965535164}
  ]
]

"""
```

## Dataset:
[Twitter-Sentiment-Analysis](https://huggingface.co/nlp/viewer/?dataset=emotion).

## Eval results
```json
{
 'eval_accuracy': 0.8325,
 'eval_f1': 0.8317301441160213,
 'eval_loss': 0.5021793842315674,
 'eval_runtime': 8.6167,
 'eval_samples_per_second': 232.108,
 'eval_steps_per_second': 3.714
}
```