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
- 745
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.