Project: SMS Spam Classifier — TF-IDF + Multinomial Naive Bayes
Author: AJAYA RAJ A N
Live demo: (Add your Streamlit Cloud / HuggingFace link here after deployment)
Link : https://sms-spam-classifier-my-1st-project.streamlit.app/
A simple SMS spam classifier that detects whether an SMS is spam or ham (not spam). The project includes:
- Data preprocessing (cleaning, stopwords, stemming)
- TF-IDF feature extraction
- Multinomial Naive Bayes classifier
- Streamlit web app for interactive testing and dataset preview
sms-spam-classifier/
├── app/
│ └── streamlit_app.py
├── data/
│ └── spam.csv
├── models/
│ ├── model.joblib
│ └── vectorizer.joblib
├── src/
│ ├── preprocess.py
│ ├── train.py
│ └── predict.py
├── scripts/
├── requirements.txt
└── README.md
- Create & activate virtual environment:
python -m venv venv
# Windows:
.\venv\Scripts\activate
# macOS / Linux:
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Train the model (creates \models/model.joblib\ and \models/vectorizer.joblib):
python src/train.py- Run the web app:
streamlit run app/streamlit_app.py- Open the Streamlit URL printed in the terminal (https://sms-spam-classifier-my-1st-project.streamlit.app/ ).
- Type a message and press Predict to get label + confidence.
- Ensure
requirements.txtis present - Make sure the app entry file is:
app/streamlit_app.py - If models are ignored in
.gitignore, uploadmodels/manually to deployment platform
AJAYA RAJ A N
LinkedIn: https://www.linkedin.com/in/ajayaraj98
GitHub: https://github.com/Ajay-araj