Downloads · 30 days
9
2% of all-time downloads
udit-k/HamSpamBERT
HamSpamBERT is a text classification model from udit-k. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
9
2% of all-time downloads
All-time downloads
512
Public
Repo size
3.9 GB
Likes
1
Public
Click a slice to open those files.
.bin438 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of bert-base-uncased on Spam-Ham dataset. It achieves the following results on the evaluation set:
from transformers import pipeline, BertTokenizer, BertForSequenceClassification
tokenizer = BertTokenizer.from_pretrained("udit-k/HamSpamBERT")
model = BertForSequenceClassification.from_pretrained("udit-k/HamSpamBERT")
classifier = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
print(classifier("Call this number to win FREE IPL FINAL tickets!!!"))
print(classifier("Call me when you reach home :)"))
[{'label': 'LABEL_1', 'score': 0.9999189376831055}]
[{'label': 'LABEL_0', 'score': 0.9999370574951172}]
This model is a fine-tuned version of the BERT model on Spam-Ham dataset to improve the performance of sentiment analysis on Spam Detection tasks.
This model can be used to detect spam texts. The primary limitation of this model is that it was trained on a corpus of about 4700 rows and evaluated on around 1200 rows.
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|---|---|---|
| No log | 1.0 | 279 | 0.0492 | 0.9901 | 1.0 | 0.9262 | 0.9617 |
| 0.0635 | 2.0 | 558 | 0.0117 | 0.9982 | 1.0 | 0.9866 | 0.9932 |
| 0.0635 | 3.0 | 837 | 0.0120 | 0.9982 | 0.9933 | 0.9933 | 0.9933 |
| 0.0138 | 4.0 | 1116 | 0.0072 | 0.9991 | 1.0 | 0.9933 | 0.9966 |
| 0.0138 | 5.0 | 1395 | 0.0086 | 0.9982 | 0.9933 | 0.9933 | 0.9933 |
| 0.0007 | 6.0 | 1674 | 0.0090 | 0.9982 | 0.9933 | 0.9933 | 0.9933 |
| 0.0007 | 7.0 | 1953 | 0.0091 | 0.9982 | 0.9933 | 0.9933 | 0.9933 |