Downloads · 30 days
92.7K
2% of all-time downloads
blanchefort/rubert-base-cased-sentiment
rubert-base-cased-sentiment is a text classification model from blanchefort. Use it when you need a label for a piece of text. It is set up for transformers.
Short Russian texts sentiment classification
Downloads · 30 days
92.7K
2% of all-time downloads
All-time downloads
5.6M
Public
Parameters
178M
3.6 GB on disk
Likes
22
Public
Click a slice to open those files.
.h5712 MB · 25%
How the weights are stored.
F32178M · 100%
From the Hugging Face model README
Short Russian texts sentiment classification
This is a DeepPavlov/rubert-base-cased-conversational model trained on aggregated corpus of 351.797 texts.
0: NEUTRAL
1: POSITIVE
2: NEGATIVE
import torch
from transformers import AutoModelForSequenceClassification
from transformers import BertTokenizerFast
tokenizer = BertTokenizerFast.from_pretrained('blanchefort/rubert-base-cased-sentiment')
model = AutoModelForSequenceClassification.from_pretrained('blanchefort/rubert-base-cased-sentiment', return_dict=True)
@torch.no_grad()
def predict(text):
inputs = tokenizer(text, max_length=512, padding=True, truncation=True, return_tensors='pt')
outputs = model(**inputs)
predicted = torch.nn.functional.softmax(outputs.logits, dim=1)
predicted = torch.argmax(predicted, dim=1).numpy()
return predicted
Рубцова Ю. Автоматическое построение и анализ корпуса коротких текстов (постов микроблогов) для задачи разработки и тренировки тонового классификатора //Инженерия знаний и технологии семантического веба. – 2012. – Т. 1. – С. 109-116.
RuReviews: An Automatically Annotated Sentiment Analysis Dataset for Product Reviews in Russian.
A. Rogers A. Romanov A. Rumshisky S. Volkova M. Gronas A. Gribov RuSentiment: An Enriched Sentiment Analysis Dataset for Social Media in Russian. Proceedings of COLING 2018.
Датасет содержит пользовательские отзывы о медицинских учреждениях. Датасет собран в мае 2019 года с сайта prodoctorov.ru