Downloads · 30 days
314
0% of all-time downloads
RUSpam/spam_deberta_v4
spam_deberta_v4 is a text classification model from RUSpam. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
Это модель определения спама, основанная на архитектуре Deberta, дообученная на русскоязычных данных о спаме. Она классифицирует текст как спам или не спам.
Downloads · 30 days
314
0% of all-time downloads
All-time downloads
168K
Public
Parameters
82.1M
983 MB on disk
Likes
9
Public
Click a slice to open those files.
.bin328 MB · 50%
From the Hugging Face model README
Это модель определения спама, основанная на архитектуре Deberta, дообученная на русскоязычных данных о спаме. Она классифицирует текст как спам или не спам.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_path = "RUSpam/spam_deberta_v4"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path)
def predict(text):
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class = torch.argmax(logits, dim=1).item()
return "Спам" if predicted_class == 1 else "Не спам"
text = "Ваш текст для проверки здесь"
result = predict(text)
print(f"Результат: {result}")
@MISC{RUSpam/spam_deberta_v4,
author = {Denis Petrov, Kirill Fedko (Neurospacex), Sergey Yalovegin},
title = {Russian Spam Classification Model},
url = {https://huggingface.co/RUSpam/spam_deberta_v4/},
year = 2024
}