Downloads · 30 days
114
66% of all-time downloads
Vadim121/ruRoberta-large-tsa-news-ru
ruRoberta-large-tsa-news-ru is a text classification model from Vadim121. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a modified version of ruRoberta-large for Target sentiment Analysis (TSA) using training data from the RuSentNE-2023 collection.
Downloads · 30 days
114
66% of all-time downloads
All-time downloads
172
Public
Repo size
2.8 GB
Likes
1
Public
Click a slice to open those files.
.bin1.4 GB · 100%
From the Hugging Face model README
This model is a modified version of ruRoberta-large for Target sentiment Analysis (TSA) using training data from the RuSentNE-2023 collection.
This model is designed to analyze news texts in Russian.
Given an input sentence and a specified entity (target object) within it, this model determines the sentiment directed toward that entity and classifies it into one of the following categories: ['positive', 'negative', 'neutral'].
This is a ruRoberta-large model with the addition of a linear layer for classification.
from model import TargetSentimentClassifier
model = TargetSentimentClassifier(
model_name="sberbank-ai/ruRoberta-large",
use_multi_sample_dropout=True,
device="cuda"
)
model.load_state_dict(torch.load("pytorch_model.bin", map_location="cuda"))
text = "Джеймс «Бадди» Макгирт ... спортсмен остановить бой..."
target = "спортсмен"
entity_type = "PROFESSION"
prediction = model.predict(text, target, entity_type)
print(prediction) # Output: 0, 1 or 2
The input sentence must include a marked entity using the following format:
<en> ENTITY_TEXT <|ENTITY_TAG|> </en>
Example:
Джеймс «Бадди» Макгирт ... <en> спортсмен <|PROFESSION|> </en> остановить бой...
The model predicts one of the following labels:
| Label | Description |
|---|---|
| 0 | Neutral |
| 1 | Positive |
| 2 | Negative |
For training, the data published for the RuSentNE-2023 competition, available via repository, was used: https://github.com/dialogue-evaluation/RuSentNE-evaluation
To increase the training sample, data from the Sentiment Analysis in Russian dataset was used: https://www.kaggle.com/c/sentiment-analysis-in-russian/overview
Additionally, to expand the dataset with entity-level sentiment annotations, an automatic annotation algorithm was used: https://github.com/RyuminV01/markup-tsa-news/tree/main This algorithm enabled the generation of additional labeled data based on named entity recognition and sentiment alignment in Russian news texts.
The direct link to the test evaluation data:
https://github.com/dialogue-evaluation/RuSentNE-evaluation/blob/main/final_data.csv
For the model evaluation, two metrics were used:
positive and negative classes;positive, negative, and neutral classes;The test evaluation for this model, as shown on the showcases, demonstrates the following performance:
| Metric | Score |
|---|---|
| F1_posneg_macro | 61.84 |
| F1_macro | 70.38 |