Downloads · 30 days
464
10% of all-time downloads
Kostya165/rubert_tiny2_russian_emotion_sentiment
rubert_tiny2_russian_emotion_sentiment is a text classification model from Kostya165. Use it when you need a label for a piece of text. The card lists the license as cc-by-sa-4.0.
Модель ruberttiny2russianemotionsentiment — это дообученная версия легковесной модели cointegrated/rubert-tiny2 для классификации пяти эмоций в русскоязычных сообщениях:
Downloads · 30 days
464
10% of all-time downloads
All-time downloads
4.6K
Public
Parameters
29.2M
117 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors117 MB · 97%
From the Hugging Face model README
Модель rubert_tiny2_russian_emotion_sentiment — это дообученная версия легковесной модели cointegrated/rubert-tiny2 для классификации пяти эмоций в русскоязычных сообщениях:
| Метрика | Значение |
|---|---|
| Accuracy | 0.8911 |
| F1 macro | 0.8910 |
| F1 micro | 0.8911 |
Точность по классам:
pip install transformers torch
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()
# Преобразуем ID обратно в метки
id2label = model.config.id2label
labels = [id2label[p] for p in preds]
print(labels) # например: ['positive', 'aggression']
cointegrated/rubert-tiny2Kostya165/ru_emotion_dvachtransformers>=4.30.0torch>=1.10.0datasetsevaluateCC-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}}
}
Description
The rubert_tiny2_russian_emotion_sentiment model is a fine‑tuned version of the lightweight cointegrated/rubert-tiny2 for classifying five emotions in Russian text:
Validation Results
| Metric | Value |
|---|---|
| Accuracy | 0.8911 |
| F1 macro | 0.8910 |
| F1 micro | 0.8911 |
Per‑class accuracy:
Usage
pip install transformers torch
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()
labels = [model.config.id2label[p] for p in preds]
print(labels) # e.g. ['positive', 'aggression']
Training Details
cointegrated/rubert-tiny2Kostya165/ru_emotion_dvach (train/validation)Requirements
transformers>=4.30.0torch>=1.10.0datasetsevaluateLicense
CC-BY-SA 4.0.
Citation
@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}}
}