A sleek, interactive web application that uses a fine-tuned GPT-2 model to detect spam messages with high accuracy.
This application demonstrates the power of transformer-based language models for text classification tasks. Using a custom-trained GPT-2 model, it can identify spam messages with remarkable accuracy, providing a practical example of NLP in action.
- 🤖 Fine-tuned GPT-2 model for spam detection
- 📊 Real-time classification with confidence scores
- 🎨 Clean, intuitive user interface
- 🔄 Example messages to test functionality
- 📱 Mobile-friendly design
The classifier is built on a fine-tuned GPT-2 small model (124M parameters), trained on the SMS Spam Collection dataset. The model achieves:
- Accuracy: ~98% on test set
- Precision: ~97%
- Recall: ~98%
The model is hosted on Hugging Face Hub: vaibhav-vibe/spam-classifier-model
The complete implementation of the GPT-2 model from scratch can be found in this repository: https://github.com/vaifai/GPT2_from_scratch
The repository includes:
- Custom implementation of the GPT architecture
- Training pipeline for text classification
- Fine-tuning process for spam detection
- Evaluation metrics and analysis
pip install -r requirements.txt
streamlit run app.py
- Enter a message in the text area
- Click "Classify Message"
- View the classification result with confidence score
- Try example messages to see how the model performs on known spam and ham
- Multi-language support
- Expanded training dataset
- Fine-tuning on domain-specific spam
- Explainable AI features to highlight spam indicators
Vaibhav Pandey
This project is open source and available under the MIT License.
This project was created as part of a learning portfolio to demonstrate practical applications of transformer-based language models.