File size: 1,847 Bytes
c010a6d f34ad4f 9db0aef f34ad4f 9db0aef f34ad4f 9db0aef f34ad4f |
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 69 70 71 72 |
---
language: ko
tags:
- text-classification
- emotion
- korean
license: mit
datasets:
- custom
model-name: korean-emotion-classifier
---
# Korean Emotion Classifier ๐๐ก๐ข๐จ๐ฒ๐
๋ณธ ๋ชจ๋ธ์ ํ๊ตญ์ด ํ
์คํธ๋ฅผ **6๊ฐ์ง ๊ฐ์ (๋ถ๋
ธ, ๋ถ์, ์ฌํ, ํ์จ, ๋นํฉ, ๊ธฐ์จ)**์ผ๋ก ๋ถ๋ฅํฉ๋๋ค.
`klue/roberta-base` ๊ธฐ๋ฐ์ผ๋ก ํ์ธํ๋๋์์ต๋๋ค.
---
## ๐ Evaluation Results
| Emotion | Precision | Recall | F1-Score |
|---------|-----------|--------|----------|
| ๋ถ๋
ธ | 0.9801 | 0.9788 | 0.9795 |
| ๋ถ์ | 0.9864 | 0.9848 | 0.9856 |
| ์ฌํ | 0.9837 | 0.9854 | 0.9845 |
| ํ์จ | 0.9782 | 0.9750 | 0.9766 |
| ๋นํฉ | 0.9607 | 0.9668 | 0.9652 |
| ๊ธฐ์จ | 0.9857 | 0.9886 | 0.9872 |
**Accuracy**: 0.9831
**Macro Avg**: Precision=0.9791 / Recall=0.9804 / F1=0.9798
**Weighted Avg**: Precision=0.9831 / Recall=0.9831 / F1=0.9831
```python
from transformers import pipeline
import torch
model_id = "Seonghaa/korean-emotion-classifier-roberta"
device = 0 if torch.cuda.is_available() else -1 # GPU ์์ผ๋ฉด 0, ์์ผ๋ฉด CPU(-1)
clf = pipeline(
"text-classification",
model=model_id,
tokenizer=model_id,
device=device
)
texts = [
"์ค๋ ๊ธธ์์ 10๋ง์์ ์ฃผ์ ์ด",
"์ค๋ ์น๊ตฌ๋ค์ด๋ ๋
ธ๋๋ฐฉ์ ๊ฐ์ด",
"์ค๋ ์ํ ๋ง์ณค์ด",
]
for t in texts:
pred = clf(t, truncation=True, max_length=256)[0]
print(f"์
๋ ฅ: {t}")
print(f"โ ์์ธก ๊ฐ์ : {pred['label']}, ์ ์: {pred['score']:.4f}
")
```
## ์ถ๋ ฅ ์์:
์
๋ ฅ: ์ค๋ ๊ธธ์์ 10๋ง์์ ์ฃผ์ ์ด</br>
โ ์์ธก ๊ฐ์ : ๊ธฐ์จ, ์ ์: 0.9619
์
๋ ฅ: ์ค๋ ์น๊ตฌ๋ค์ด๋ ๋
ธ๋๋ฐฉ์ ๊ฐ์ด</br>
โ ์์ธก ๊ฐ์ : ๊ธฐ์จ, ์ ์: 0.9653
์
๋ ฅ: ์ค๋ ์ํ ๋ง์ณค์ด</br>
โ ์์ธก ๊ฐ์ : ์ฌํ, ์ ์: 0.9602
|