Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,47 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
-
# Spam Detection
|
| 3 |
-
|
| 4 |
-
A
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
| Vocabulary size | 151,669 |
|
| 19 |
-
| Embedding dimension | 128 |
|
| 20 |
-
| Attention heads | 4 |
|
| 21 |
-
| KV groups | 2 |
|
| 22 |
-
| Transformer layers | 2 |
|
| 23 |
-
| Feed-forward dimension | 256 |
|
| 24 |
-
| Output classes | 2 |
|
| 25 |
|
| 26 |
## Labels
|
| 27 |
-
- 0
|
| 28 |
-
- 1
|
| 29 |
|
| 30 |
-
##
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
|
| 34 |
|
| 35 |
## Files
|
| 36 |
-
-
|
| 37 |
-
-
|
| 38 |
-
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
|
| 5 |
+
# Spam Detection SLM
|
| 6 |
+
|
| 7 |
+
A custom Small Language Model project for detecting spam and ham messages.
|
| 8 |
+
|
| 9 |
+
## Project Overview
|
| 10 |
+
This project uses a custom Transformer-based classifier to classify text messages as Spam or Ham.
|
| 11 |
+
|
| 12 |
+
## Model Architecture
|
| 13 |
+
- Custom Qwen-inspired Transformer
|
| 14 |
+
- Vocabulary size: 151669
|
| 15 |
+
- Embedding dimension: 128
|
| 16 |
+
- Attention heads: 4
|
| 17 |
+
- KV groups: 2
|
| 18 |
+
- Transformer layers: 2
|
| 19 |
+
- Feed-forward dimension: 256
|
| 20 |
+
- Output classes: 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
## Labels
|
| 23 |
+
- 0 = Ham
|
| 24 |
+
- 1 = Spam
|
| 25 |
|
| 26 |
+
## Dataset
|
| 27 |
+
Training dataset contains 28,544 records.
|
| 28 |
+
- Ham: 13,998
|
| 29 |
+
- Spam: 14,546
|
| 30 |
+
- Columns: text, label
|
| 31 |
|
| 32 |
+
Dataset: https://huggingface.co/datasets/Pannuru/Spam-Detection-Dataset
|
| 33 |
|
| 34 |
## Files
|
| 35 |
+
- spam_slm_model.pth
|
| 36 |
+
- config.json
|
| 37 |
+
- dataset_info.json
|
| 38 |
+
- tokenizer/
|
| 39 |
+
- requirements.txt
|
| 40 |
+
|
| 41 |
+
## Usage
|
| 42 |
+
Load the matching tokenizer and custom model architecture,
|
| 43 |
+
then load spam_slm_model.pth using PyTorch.
|
| 44 |
+
|
| 45 |
+
## Ollama Demo
|
| 46 |
+
Ollama Qwen2.5 0.5B is used as an explanation assistant
|
| 47 |
+
alongside the custom PyTorch spam classifier.
|
| 48 |
+
The classifier performs the Spam/Ham prediction.
|
| 49 |
+
|
| 50 |
+
## GitHub
|
| 51 |
+
Add your GitHub repository URL here.
|
| 52 |
+
|
| 53 |
+
## Note
|
| 54 |
+
This checkpoint is a binary text classifier, not a standalone
|
| 55 |
+
generative language model.
|