A simple Machine Learning project that classifies SMS messages as SPAM or NOT SPAM using Python, scikit-learn, and Streamlit.
This project demonstrates an end-to-end ML workflow: dataset handling, model training, evaluation, saving, and creating an interactive demo for recruiters or users.
spam-classifier/
├─ data/ # Dataset: SMSSpamCollection
├─ models/ # Trained model saved here
├─ train.py # Script to train the model
├─ app.py # Streamlit interactive demo
├─ requirements.txt # Project dependencies
└─ README.md
- Python 3.x
- pandas – Data handling
- scikit-learn – Machine Learning (TF-IDF, Naive Bayes)
- joblib – Save/load model
- Streamlit – Interactive web demo
- SMS Spam Collection Dataset
- Place the file
SMSSpamCollectionin thedata/folder before running the scripts.
git clone https://github.com/EmranZZ/SPAM-Detection
cd spam-classifierpython -m venv venv
venv\Scripts\activate # On Windows
source venv/bin/activate # On Linux/Mac
pip install -r requirements.txtpython train.py- Trains the Naive Bayes classifier
- Saves model in
models/spam_classifier.joblib
streamlit run app.py- Opens a browser
- Enter any SMS message
- Get SPAM / NOT SPAM prediction with probability
- Accuracy: ~95%
- Confusion matrix and classification report printed during training
Add a screenshot of your Streamlit demo here for recruiters
Example:
MOHAMMAD EMRAN AHMED
- GitHub: github.com/EmranZZ
- Email: ahmed777emran@gmail.com
