Zafer Cavdar
commited on
Commit
•
59b3657
1
Parent(s):
d54c8b0
Updated README
Browse files
README.md
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- tr
|
4 |
+
thumbnail: https://avatars3.githubusercontent.com/u/32437151?s=460&u=4ec59abc8d21d5feea3dab323d23a5860e6996a4&v=4
|
5 |
+
tags:
|
6 |
+
- text-classification
|
7 |
+
- emotion
|
8 |
+
- pytorch
|
9 |
+
datasets:
|
10 |
+
- emotion (Translated to Turkish)
|
11 |
+
metrics:
|
12 |
+
- Accuracy, F1 Score
|
13 |
+
---
|
14 |
+
# distilbert-base-turkish-cased-emotion
|
15 |
+
|
16 |
+
## Model description:
|
17 |
+
[Distilbert-base-turkish-cased](https://huggingface.co/dbmdz/distilbert-base-turkish-cased) finetuned on the emotion dataset using HuggingFace Trainer with below Hyperparameters
|
18 |
+
```
|
19 |
+
learning rate 2e-5,
|
20 |
+
batch size 64,
|
21 |
+
num_train_epochs=8,
|
22 |
+
```
|
23 |
+
|
24 |
+
## Model Performance Comparision on Emotion Dataset from Twitter:
|
25 |
+
|
26 |
+
| Model | Accuracy | F1 Score | Test Sample per Second |
|
27 |
+
| --- | --- | --- | --- |
|
28 |
+
| [Distilbert-base-turkish-cased-emotion](https://huggingface.co/dbmdz/distilbert-base-turkish-cased) | 83.25 | 83.17 | 232.197 |
|
29 |
+
|
30 |
+
## How to Use the model:
|
31 |
+
```python
|
32 |
+
from transformers import pipeline
|
33 |
+
classifier = pipeline("text-classification",model='zafercavdar/distilbert-base-turkish-cased-emotion', return_all_scores=True)
|
34 |
+
prediction = classifier("Bu kütüphaneyi seviyorum, en iyi yanı kolay kullanımı.", )
|
35 |
+
print(prediction)
|
36 |
+
|
37 |
+
"""
|
38 |
+
Output:
|
39 |
+
[
|
40 |
+
[
|
41 |
+
{'label': 'sadness', 'score': 0.0026786490343511105},
|
42 |
+
{'label': 'joy', 'score': 0.6600754261016846},
|
43 |
+
{'label': 'love', 'score': 0.3203163146972656},
|
44 |
+
{'label': 'anger', 'score': 0.004358913749456406},
|
45 |
+
{'label': 'fear', 'score': 0.002354539930820465},
|
46 |
+
{'label': 'surprise', 'score': 0.010216088965535164}
|
47 |
+
]
|
48 |
+
]
|
49 |
+
|
50 |
+
"""
|
51 |
+
```
|
52 |
+
|
53 |
+
## Dataset:
|
54 |
+
[Twitter-Sentiment-Analysis](https://huggingface.co/nlp/viewer/?dataset=emotion).
|
55 |
+
|
56 |
+
## Eval results
|
57 |
+
```json
|
58 |
+
{
|
59 |
+
'eval_accuracy': 0.8325,
|
60 |
+
'eval_f1': 0.8317301441160213,
|
61 |
+
'eval_loss': 0.5021793842315674,
|
62 |
+
'eval_runtime': 8.6167,
|
63 |
+
'eval_samples_per_second': 232.108,
|
64 |
+
'eval_steps_per_second': 3.714
|
65 |
+
}
|
66 |
+
```
|