spam-ham-classifier / README.md
Sathya77's picture
Create README.md
a033cd6 verified
---
tags:
- text-classification
- spam-detection
- transformers
- bert
datasets:
- codesignal/sms-spam-collection
- url
metrics:
- accuracy
- f1
- precision
- recall
base_model:
- google-bert/bert-base-cased
pipeline_tag: text-classification
library_name: transformers
---
# πŸ“Œ Spam Classifier (BERT Fine-Tuned)
## Introduction
This is my first fine-tuned model on Hugging Face πŸš€.
It is a spam vs ham (not spam) classifier built using a BERT model fine-tuned on SMS spam data.
The goal is to help detect unwanted spam messages while keeping normal communications intact.
I created and uploaded this model as part of my learning journey into NLP and Transformers.
The model was trained on a spam/ham dataset with high accuracy and strong F1 performance.
It can be used for SMS filtering, email pre-screening, or any application requiring spam detection.
## πŸ“– Model Details
- **Architecture**: BERT base (bert-base-cased)
- **Task**: Binary Text Classification
- **Labels**: `0 = ham`, `1 = spam`
- **Dataset**: Custom spam/ham dataset (e.g., SMS Spam Collection)
- **Fine-tuned epochs**: 3
- **Framework**: Hugging Face Transformers
## πŸ§ͺ Evaluation Results
| Metric | Score |
|-------------|--------|
| Accuracy | 99.3% |
| F1 Score | 97.5% |
| Precision | 100% |
| Recall | 95.1% |
## πŸš€ How to Use
```python
from transformers import pipeline
classifier = pipeline("text-classification", model="Sathya77/spam-ham-classifier")
classifier("Congratulations! You won a free gift card!")
# β†’ [{'label': 'spam', 'score': 0.99}]
```
## πŸš€ Limitations and Future Work
- May not generalize perfectly to domains outside SMS/email.
- Some borderline spam messages may still be misclassified.
- Future improvements: larger training data, multilingual support.
## Thank You For Supporting me....