Text Classification
Transformers
Safetensors
distilbert
spam-detection
email-classification
text-embeddings-inference
Instructions to use Pannuru/md-validator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Pannuru/md-validator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Pannuru/md-validator")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Pannuru/md-validator") model = AutoModelForSequenceClassification.from_pretrained("Pannuru/md-validator", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add Hugging Face model metadata
Browse files
README.md
CHANGED
|
@@ -1,55 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
# Spam Email Detection Using DistilBERT
|
| 3 |
|
| 4 |
## Project Overview
|
| 5 |
-
|
| 6 |
-
model, to classify emails as Spam or Ham.
|
| 7 |
-
|
| 8 |
-
## Objectives
|
| 9 |
-
- Detect spam and legitimate emails.
|
| 10 |
-
- Classify email messages automatically.
|
| 11 |
-
- Identify suspicious words and phrases.
|
| 12 |
-
- Provide explanations for potential spam indicators.
|
| 13 |
|
| 14 |
## Dataset
|
| 15 |
-
|
| 16 |
|
| 17 |
- Training samples: 8,000
|
| 18 |
- Testing samples: 2,000
|
| 19 |
- Spam label: 1
|
| 20 |
- Ham label: 0
|
| 21 |
|
| 22 |
-
##
|
| 23 |
- Python
|
| 24 |
-
-
|
| 25 |
- Hugging Face Transformers
|
|
|
|
| 26 |
- DistilBERT
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
5. Model evaluation
|
| 36 |
-
6. Spam and Ham prediction
|
| 37 |
-
7. Spam indicator explanation
|
| 38 |
-
|
| 39 |
-
## Model
|
| 40 |
-
Architecture: DistilBERT
|
| 41 |
-
Maximum sequence length: 128
|
| 42 |
-
Training epochs: 2
|
| 43 |
|
| 44 |
## Example
|
| 45 |
Input: Congratulations! You won a free prize.
|
| 46 |
|
| 47 |
Prediction: SPAM
|
| 48 |
|
| 49 |
-
##
|
| 50 |
-
|
| 51 |
-
phrases. These phrases are indicators, not proof of spam
|
| 52 |
-
or a complete explanation of the model's decision.
|
| 53 |
-
|
| 54 |
-
## Model Repository
|
| 55 |
-
https://huggingface.co/Pannuru/spam-mail-detection
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
pipeline_tag: text-classification
|
| 4 |
+
tags:
|
| 5 |
+
- distilbert
|
| 6 |
+
- spam-detection
|
| 7 |
+
- email-classification
|
| 8 |
+
- text-classification
|
| 9 |
+
---
|
| 10 |
|
| 11 |
# Spam Email Detection Using DistilBERT
|
| 12 |
|
| 13 |
## Project Overview
|
| 14 |
+
A DistilBERT-based model that classifies email messages as Spam or Ham.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
## Dataset
|
| 17 |
+
SetFit/enron_spam
|
| 18 |
|
| 19 |
- Training samples: 8,000
|
| 20 |
- Testing samples: 2,000
|
| 21 |
- Spam label: 1
|
| 22 |
- Ham label: 0
|
| 23 |
|
| 24 |
+
## Technologies
|
| 25 |
- Python
|
| 26 |
+
- PyTorch
|
| 27 |
- Hugging Face Transformers
|
| 28 |
+
- Google Colab
|
| 29 |
- DistilBERT
|
| 30 |
+
|
| 31 |
+
## Workflow
|
| 32 |
+
1. Dataset preparation
|
| 33 |
+
2. Tokenization
|
| 34 |
+
3. Model training
|
| 35 |
+
4. Model evaluation
|
| 36 |
+
5. Spam and Ham prediction
|
| 37 |
+
6. Spam indicator explanation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## Example
|
| 40 |
Input: Congratulations! You won a free prize.
|
| 41 |
|
| 42 |
Prediction: SPAM
|
| 43 |
|
| 44 |
+
## Limitation
|
| 45 |
+
Spam explanations use predefined keyword indicators and do not establish the model's causal reasoning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|