Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -106,10 +106,33 @@ print(train_df.head())
|
|
| 106 |
|
| 107 |
## For Fine-tuning
|
| 108 |
|
| 109 |
-
This dataset is designed for fine-tuning LLMs for spam detection.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
**Model:** [mustafaege/spam-detector-gpt2-hf](https://huggingface.co/mustafaege/spam-detector-gpt2-hf)
|
| 112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
## License
|
| 114 |
|
| 115 |
The original UCI SMS Spam Collection dataset is available under the [UCI Machine Learning Repository](https://archive.ics.uci.edu/dataset/228/sms+spam+collection) terms.
|
|
|
|
| 106 |
|
| 107 |
## For Fine-tuning
|
| 108 |
|
| 109 |
+
This dataset is designed for fine-tuning LLMs for spam detection.
|
| 110 |
+
|
| 111 |
+
### Training Details Used
|
| 112 |
+
|
| 113 |
+
- **Epochs**: 5
|
| 114 |
+
- **Batch Size**: 16
|
| 115 |
+
- **Learning Rate**: 2e-5
|
| 116 |
+
- **Optimizer**: AdamW
|
| 117 |
+
- **Loss Function**: CrossEntropyLoss
|
| 118 |
+
|
| 119 |
+
### Results
|
| 120 |
+
|
| 121 |
+
| Metric | Score |
|
| 122 |
+
|--------|-------|
|
| 123 |
+
| Test Accuracy | ~95% |
|
| 124 |
+
| Validation Accuracy | ~95%+ |
|
| 125 |
+
|
| 126 |
+
### Companion Model
|
| 127 |
|
| 128 |
**Model:** [mustafaege/spam-detector-gpt2-hf](https://huggingface.co/mustafaege/spam-detector-gpt2-hf)
|
| 129 |
|
| 130 |
+
The model was trained following the book's Chapter 6.5 approach:
|
| 131 |
+
- Base Model: openai-community/gpt2 (124M parameters)
|
| 132 |
+
- Modified Layer: Added `out_head = nn.Linear(768, 2)` classification head
|
| 133 |
+
- Unfrozen Layers: Last transformer block (h[-1]), Final LayerNorm (ln_f), Classification head (out_head)
|
| 134 |
+
- Classification Method: Using the last token hidden state for prediction
|
| 135 |
+
|
| 136 |
## License
|
| 137 |
|
| 138 |
The original UCI SMS Spam Collection dataset is available under the [UCI Machine Learning Repository](https://archive.ics.uci.edu/dataset/228/sms+spam+collection) terms.
|