Text Classification
Transformers
Safetensors
English
distilbert
spam-detection
nlp
text-embeddings-inference
Instructions to use Abdallah-Thuieb/distilbert-spam-classification-binary with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Abdallah-Thuieb/distilbert-spam-classification-binary with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Abdallah-Thuieb/distilbert-spam-classification-binary")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Abdallah-Thuieb/distilbert-spam-classification-binary") model = AutoModelForSequenceClassification.from_pretrained("Abdallah-Thuieb/distilbert-spam-classification-binary", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit History
-
Upload 7 files
Verified signature--- language: ar tags: - text-classification - spam-detection library_name: transformers --- # DistilBERT Spam Classification (Binary) This model is a fine-tuned DistilBERT for binary spam/ham text classification. ## Labels - 0: ham - 1: spam ## How to use ```python from transformers import AutoTokenizer, AutoModelForSequenceClassification import torch repo_id = "Abdallah-Thuieib/distilbert-spam-classification-binary" tokenizer = AutoTokenizer.from_pretrained(repo_id) model = AutoModelForSequenceClassification.from_pretrained(repo_id) text = "free money now!!!" inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True) with torch.no_grad(): logits = model(**inputs).logits pred = logits.argmax(-1).item() print(pred)5ef9c9a