RUSpam/spam_deberta_v4
Описание
Это модель определения спама, основанная на архитектуре 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
}
- Downloads last month
- 1,167
Inference Providers
NEW
This model is not currently available via any of the supported third-party Inference Providers, and
the model is not deployed on the HF Inference API.