File size: 908 Bytes
6cc0611 d61d770 1f9f282 d61d770 |
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 |
---
language:
- en
metrics:
- accuracy
pipeline_tag: text-classification
library_name: bertopic
tags:
- code
---
# SpamHunter Model
This is a fine-tuned BERT model for spam detection.
## Model Details
- **Base Model**: bert-base-uncased
- **Dataset**: Custom spam emails dataset
- **Training Steps**: 3 epochs
- **Validation Accuracy**: ~99%
## How to Use
### Direct Integration with Transformers
```python
from transformers import BertTokenizer, BertForSequenceClassification
# Load model and tokenizer
tokenizer = BertTokenizer.from_pretrained("ar4min/SpamHunter")
model = BertForSequenceClassification.from_pretrained("ar4min/SpamHunter")
# Example
text = "Congratulations! You've won a $1000 gift card. Click here to claim now."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
prediction = outputs.logits.argmax(-1).item()
print("Spam" if prediction == 1 else "Not Spam")
|