This repository contains a Streamlit app for classifying email messages as spam or not spam using a machine learning model.
The Email Spam Classification app uses a trained machine learning model to predict whether an email message is spam or not. The app is built with Streamlit and deployed on Streamlit Cloud.
-
Clone the repository:
git clone https://github.com/navyabijoy/email-spam-classification.git cd email-spam-classification
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run main.py
-
Interact with the app:
Open your browser and go to
http://localhost:8501
to interact with the app. Enter an email message in the text area and click the "Predict" button to see if it is classified as spam or not.
If you want to train the model yourself, follow these steps:
-
Prepare the dataset:
Ensure you have a dataset of email messages labeled as spam or not spam.
-
Train the model:
Use the provided Jupyter notebook or script to train a new model. Save the trained model as
model.pkl
and the vectorizer asvectorizer.pkl
.
To deploy the app on Streamlit Cloud:
-
Push your code to GitHub:
Ensure your repository is up to date on GitHub.
-
Deploy on Streamlit Cloud:
Follow the Streamlit Cloud documentation to deploy your app.
Contributions are welcome! Please open an issue or submit a pull request for any changes.
This project is licensed under the MIT License.