YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
S7 Airlines Relevance — ruBERT-base-cased
Модель бинарной классификации релевантности для темы S7 Airlines.
- Базовая модель: DeepPavlov/rubert-base-cased
- Задача: Бинарная классификация: 0=нерелевантно, 1=релевантно
- Вход: [CLS] S7 Airlines [SEP] текст [SEP]
- Потеря: Focal+BCE mix
- Датасет: S7_relevance_enriched.jsonl
- Порог: 0.20 (best on val Macro F1)
- Best Macro F1 (val): 0.9080 (epoch 5)
- Test Macro F1: 0.8988
- Test ROC-AUC: 0.9703
- Обучена: 2026-08-10
Инференс
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=релевантно
- Downloads last month
- 31
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support