File size: 1,836 Bytes
a033cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
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....