A simple Streamlit app to classify messages as spam or ham using a Naive Bayes model.
- Python 3.x
- All required Python packages are listed in
requirements.txt.
-
Clone the repository:
git clone https://github.com/yourusername/spam-message-classifier.git cd spam-message-classifier -
Install dependencies:
pip install -r requirements.txt
-
Train the model (optional):
- If you need to retrain the model, run:
python train_and_save_model.py
This will save the model and vectorizer as
.pklfiles. -
Run the Streamlit app:
streamlit run app.py
-
Usage:
- Enter a message in the input box to see if it’s classified as spam or ham.
app.py: The Streamlit app to classify messages.train_and_save_model.py: Script to train and save the model.vectorizer.pklandspam_classifier.pkl: Saved vectorizer and model files (generated bytrain_and_save_model.py).
This project is licensed under the MIT License.