spam-detection-distilbert
1
license:apache-2.0
by
WhiteDevilOP
Other
OTHER
New
0 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Code Examples
Spam Detection using DistilBERTpythontransformers
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("<your-username>/spam-detection-distilbert")
model = AutoModelForSequenceClassification.from_pretrained("<your-username>/spam-detection-distilbert")
inputs = tokenizer(
"You won a free iPhone!",
return_tensors="pt",
truncation=True,
padding="max_length",
max_length=128
)
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=1).item()
print("SPAM" if prediction == 1 else "HAM")Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.