🚀 rubert_tiny2_russian_emotion_sentiment
このモデルは、軽量なモデルcointegrated/rubert-tiny2
をファインチューニングしたもので、ロシア語のメッセージ内の5つの感情を分類することができます。
🚀 クイックスタート
このモデルを使用するには、まず必要なライブラリをインストールする必要があります。以下のコマンドを実行してください。
pip install transformers torch
次に、以下のPythonコードを使用してモデルをロードし、テキスト分類を行うことができます。
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
MODEL_ID = "Kostya165/rubert_tiny2_russian_emotion_sentiment"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID)
model.eval()
texts = [
"Сегодня отличный день!",
"Меня это всё бесит и раздражает."
]
enc = tokenizer(texts, padding=True, truncation=True, max_length=128, return_tensors="pt")
with torch.no_grad():
logits = model(**enc).logits
preds = logits.argmax(dim=-1).tolist()
id2label = model.config.id2label
labels = [id2label[p] for p in preds]
print(labels)
✨ 主な機能
- ロシア語のメッセージ内の5つの感情を分類することができます。
- 0: aggression (攻撃性)
- 1: anxiety (不安)
- 2: neutral (中立)
- 3: positive (ポジティブ)
- 4: sarcasm (皮肉)
📦 インストール
このモデルを使用するには、以下のライブラリが必要です。
transformers>=4.30.0
torch>=1.10.0
datasets
evaluate
以下のコマンドを実行して、必要なライブラリをインストールしてください。
pip install transformers torch datasets evaluate
📚 ドキュメント
検証結果
指標 |
値 |
Accuracy |
0.8911 |
F1 macro |
0.8910 |
F1 micro |
0.8911 |
クラスごとの精度:
- 攻撃性 (0): 0.9120
- 不安 (1): 0.9462
- 中立 (2): 0.8663
- ポジティブ (3): 0.8884
- 皮肉 (4): 0.8426
学習の詳細
- ベースモデル:
cointegrated/rubert-tiny2
- データセット:
Kostya165/ru_emotion_dvach
- エポック数: 2
- バッチサイズ: 32
- 学習率: 1e-5
- 混合精度: FP16
- 正則化: Dropout 0.1, weight_decay 0.01, warmup_ratio 0.1
🔧 技術詳細
このモデルは、軽量なモデルcointegrated/rubert-tiny2
をファインチューニングして作成されています。ロシア語のメッセージ内の5つの感情を分類するために、特定のデータセットで学習されています。
📄 ライセンス
このモデルはCC-BY-SA 4.0ライセンスの下で提供されています。
📖 引用
@article{rubert_tiny2_russian_emotion_sentiment,
title = {Russian Emotion Sentiment Classification with RuBERT-tiny2},
author = {Kostya165},
year = {2024},
howpublished = {\url{https://huggingface.co/Kostya165/rubert_tiny2_russian_emotion_sentiment}}
}