Downloads · 30 days
2
5% of all-time downloads
DanielNRU/S7-relevance-rubert-20260810
S7-relevance-rubert-20260810 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
5% of all-time downloads
All-time downloads
41
Public
Repo size
2.8 GB
Likes
0
Public
Click a slice to open those files.
.pt2.1 GB · 75%
From the Hugging Face model README
Модель бинарной классификации релевантности для темы S7 Airlines.
import json, torch
from transformers import AutoTokenizer
with open("config.json") as f:
cfg = json.load(f)
tokenizer = AutoTokenizer.from_pretrained("DanielNRU/S7-relevance-rubert-20260810")
# model = RuBERTRelevanceClassifier("DeepPavlov/rubert-base-cased")
# model.load_state_dict(torch.load("best_pytorch_model.bin", map_location="cpu"))
model.eval()
text = "Рейс задержался на 2 часа, шаттль был повреждён"
enc = tokenizer(
"S7 Airlines",
text,
max_length=512,
truncation=True,
padding="max_length",
return_tensors="pt",
)
with torch.no_grad():
logit = model(enc["input_ids"], enc["attention_mask"])
prob = torch.sigmoid(logit).item()
result = 1 if prob >= 0.20 else 0
print(f"relevance={result} prob={prob:.3f}") # 1=релевантно