Downloads · 30 days
72
20% of all-time downloads
super-apple/spam-classifier-ru
spam-classifier-ru is a machine learning model from super-apple. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Модель spam-classifier-ru предназначена для бинарной классификации текстов на русском языке (Спам / Не спам).
Downloads · 30 days
72
20% of all-time downloads
All-time downloads
362
Public
Parameters
29.2M
117 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors117 MB · 98%
From the Hugging Face model README
Модель spam-classifier-ru предназначена для бинарной классификации текстов на русском языке (Спам / Не спам).
Модель представляет собой fine-tuned версию архитектуры cointegrated/rubert-tiny2.
В качестве основы использовалась подвыборка в размере 500 000 строк из открытого датасета ruSpamModels/russian-spam-detection.
Оценка проводилась на отложенной тестовой выборке с упором на минимизацию ложноположительных срабатываний (False Positives):
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "super-apple/spam-classifier-ru"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
model.eval()
text = "3APA60T0K 6E3 BЛ0ЖEHИЙ 0T 5OOO PY6ЛEЙ B ДEHb!"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128)
with torch.no_grad():
outputs = model(**inputs)
predicted_class = torch.argmax(outputs.logits, dim=-1).item()
print("Это спам!" if predicted_class == 1 else "Это нормальный текст.")