Downloads · 30 days
15
21% of all-time downloads
logakarthikeyan/spam-classifcation-model-bert
spam-classifcation-model-bert is a text classification model from logakarthikeyan. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model is a fine-tuned version of bert-base-uncased on the ucirvine/smsspam dataset. It achieves high precision and recall for identifying promotional or fraudulent messages.
Downloads · 30 days
15
21% of all-time downloads
All-time downloads
71
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of bert-base-uncased on the ucirvine/sms_spam dataset. It achieves high precision and recall for identifying promotional or fraudulent messages.
During training, the model showed rapid convergence, reaching over 99% accuracy by the third epoch.
| Epoch | Training Loss | Filtered Train Acc | Validation Loss | Validation Acc |
|---|---|---|---|---|
| 1 | 0.0914 | 0.9711 | 0.0400 | 0.9901 |
| 2 | 0.0215 | 0.9951 | 0.0530 | 0.9892 |
| 3 | 0.0058 | 0.9987 | 0.0513 | 0.9910 |
The final model performance on the test set:
| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| Ham (Not Spam) | 0.99 | 1.00 | 0.99 | 966 |
| Spam | 0.98 | 0.95 | 0.97 | 149 |
| Accuracy | 0.9910 | 1115 |
from transformers import pipeline
classifier = pipeline("text-classification", model="your-username/your-model-name")
result = classifier("Congratulations! You've won a $1,000 Walmart gift card. Click here to claim.")
print(result)