Downloads · 30 days
3
3% of all-time downloads
DanielNRU/S7-tags-ruroberta-20260811
S7-tags-ruroberta-20260811 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.
Модель multi-label тегирования для темы S7 Airlines.
Downloads · 30 days
3
3% of all-time downloads
All-time downloads
87
Public
Parameters
355M
7.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt4.3 GB · 60%
From the Hugging Face model README
Модель multi-label тегирования для темы S7 Airlines.
import json, torch
from transformers import AutoTokenizer
with open("config.json") as f:
cfg = json.load(f)
all_tags = cfg["all_tags"]
tokenizer = AutoTokenizer.from_pretrained("DanielNRU/S7-tags-ruroberta-20260811")
# model = RuRoBERTaTagClassifier("ai-forever/ruRoBERTa-large", num_tags=len(all_tags))
# model.load_state_dict(torch.load("best_pytorch_model.bin", map_location="cpu"))
model.eval()
text = "Потеряли багаж, служба поддержки не отвечает"
enc = tokenizer(
text,
max_length=512,
truncation=True,
padding="max_length",
return_tensors="pt",
)
with torch.no_grad():
logits = model(enc["input_ids"], enc["attention_mask"])
probs = torch.sigmoid(logits).squeeze(0).tolist()
result = {
all_tags[i]: round(probs[i], 3)
for i in range(len(all_tags))
if probs[i] >= 0.3
}
print(result)