Downloads · 30 days
2
4% of all-time downloads
DanielNRU/S7-sentiment-rubert-20260809
S7-sentiment-rubert-20260809 is a machine learning model from DanielNRU. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Модель тональности для темы S7 Airlines.
Downloads · 30 days
2
4% of all-time downloads
All-time downloads
49
Public
Repo size
22.8 GB
Likes
0
Public
Click a slice to open those files.
.bin14.3 GB · 50%
From the Hugging Face model README
Модель тональности для темы S7 Airlines.
import json, torch
from transformers import AutoTokenizer, AutoModel
from torch import nn
LABEL_MAP = {0: -1, 1: 0, 2: 1} # index → tone
tokenizer = AutoTokenizer.from_pretrained("DanielNRU/S7-sentiment-rubert-20260809")
# model = RuBERTSentimentClassifier("DeepPavlov/rubert-base-cased")
# model.load_state_dict(torch.load("best_pytorch_model.bin", map_location="cpu"))
model.eval()
text = "Задержали рейс на 3 часа без предупреждения"
enc = tokenizer(
"S7 Airlines",
text,
max_length=512,
truncation=True,
padding="max_length",
return_tensors="pt",
)
with torch.no_grad():
logits = model(enc["input_ids"], enc["attention_mask"])
label = logits.argmax(-1).item()
print("Тональность:", LABEL_MAP[label]) # -1 / 0 / +1