๋ณธ ๋ชจ๋ธ์ ํ๊ตญ์ด ํ
์คํธ๋ฅผ **6๊ฐ์ง ๊ฐ์ (๋ถ๋
ธ, ๋ถ์, ์ฌํ, ํ์จ, ๋นํฉ, ๊ธฐ์จ)**์ผ๋ก ๋ถ๋ฅํฉ๋๋ค.
klue/roberta-base ๊ธฐ๋ฐ์ผ๋ก ํ์ธํ๋๋์์ต๋๋ค.
| 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
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๋ง์์ ์ฃผ์ ์ด
โ ์์ธก ๊ฐ์ : ๊ธฐ์จ, ์ ์: 0.9619
์
๋ ฅ: ์ค๋ ์น๊ตฌ๋ค์ด๋ ๋
ธ๋๋ฐฉ์ ๊ฐ์ด
โ ์์ธก ๊ฐ์ : ๊ธฐ์จ, ์ ์: 0.9653
์
๋ ฅ: ์ค๋ ์ํ ๋ง์ณค์ด
โ ์์ธก ๊ฐ์ : ์ฌํ, ์ ์: 0.9602
model.safetensors 443 MBtraining_args.bin 5.3 kB