KLUE-RoBERTa ๋ด์ค ๊ธฐ์ฌ ๊ธฐ์ ๊ฐ์ ๋ถ์ ๋ชจ๋ธ
๋ชจ๋ธ ์ค๋ช
์ด ๋ชจ๋ธ์ ๋ด์ค ๊ธฐ์ฌ ์ ํน์ ๊ธฐ์ ์ ๋ํ ๊ฐ์ (ํธ์ฌ/์ ์ฌ/์ค๋ฆฝ)์ ๋ถ์ํ๊ธฐ ์ํด fine-tuning๋ KLUE-RoBERTa ๋ชจ๋ธ์ ๋๋ค.
์ฌ์ฉ ๋ชฉ์
- ๋ด์ค ๊ธฐ์ฌ์์ ํน์ ๊ธฐ์ ์ ๋ํ ๊ธ์ /๋ถ์ /์ค๋ฆฝ ๊ฐ์ ์๋ ๋ถ๋ฅ
- ๊ธ์ต ๋ด์ค ๊ฐ์ ๋ถ์
- ๊ธฐ์ ํํ ๋ชจ๋ํฐ๋ง
๋ ์ด๋ธ
0: negative (์ ์ฌ/๋ถ์ ) - ํด๋น ๊ธฐ์ ์ ๋ํ ๋ถ์ ์ ๋ด์ฉ1: neutral (์ค๋ฆฝ) - ํด๋น ๊ธฐ์ ์ ๋ํ ์ค๋ฆฝ์ ๋ด์ฉ2: positive (ํธ์ฌ/๊ธ์ ) - ํด๋น ๊ธฐ์ ์ ๋ํ ๊ธ์ ์ ๋ด์ฉ
์ฑ๋ฅ
| Metric | Score |
|---|---|
| Accuracy | 0.8426 |
| F1-Macro | 0.8468 |
| F1-Weighted | 0.8422 |
ํ์ดํผํ๋ผ๋ฏธํฐ (Optuna๋ก ์ต์ ํ)
{
"learning_rate": 9.78310992630157e-06,
"num_train_epochs": 8,
"weight_decay": 0.06436845335086991,
"warmup_ratio": 0.10859899755289561,
"per_device_train_batch_size": 32
}
์ฌ์ฉ ๋ฐฉ๋ฒ
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# ๋ชจ๋ธ ๋ก๋
model_name = "FISA-conclave/klue-roberta-news-sentiment"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# ์์ธก
text = "์ผ์ฑ์ ์์ 3๋ถ๊ธฐ ์ค์ ์ด ์์ฅ ์์์ ํฌ๊ฒ ์ํํ๋ค."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=1)[0]
pred = torch.argmax(probs).item()
labels = {0: "negative", 1: "neutral", 2: "positive"}
print(f"์์ธก: {labels[pred]} ({probs[pred]:.2%})")
ํ์ต ๋ฐ์ดํฐ
- ์ด ์ํ ์: 9,992๊ฐ
- ์ถ์ฒ:
- finance_sentiment_corpus
- korfin-asc
- twice_kr_fin
๋ฒ ์ด์ค ๋ชจ๋ธ
์ธ์ฉ
@misc{klue-roberta-news-sentiment,
author = {Tobykim},
title = {KLUE-RoBERTa News Sentiment Analysis},
year = {2024},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/FISA-conclave/klue-roberta-news-sentiment}}
}
๋ผ์ด์ผ์ค
Apache 2.0
- Downloads last month
- 39
Evaluation results
- Accuracyself-reported0.843
- F1-Macroself-reported0.847