Spam Classification
Introduction
The Spam Email Classification App is a web application built using Streamlit that identifies spam emails based on various input parameters. The app leverages a pre-trained machine learning model to provide accurate classification. Users can input details such as email subject, sender address, email body, and other metadata to determine whether an email is likely to be spam or not. This tool helps in efficiently filtering out unwanted emails and enhancing inbox security
Features
- User-Friendly Interface: Simple and intuitive interface for inputting email details.
- Real-Time Classifications: Provides instant spam detections based on user inputs.
- Data-Driven Insights: Utilizes a pre-trained machine learning model for accurate spam detections.
Installation
Prerequisites
- Python 3.6 or higher
- Streamlit
- Pandas
- NumPy
- Scikit-learn
- Joblib
Setup
- Create a Virtual Environment
- Install Dependencies
- Ensure Dataset and Model are Available
- Train the model in the colab file given below and place
model.pkl
&spam_vectorizer.pkl
in theModel
directory.
- Train the model in the colab file given below and place
Usage
- Run the Streamlit App
- Open the App in Your Browser
- The app will automatically open in your default web browser. If not, navigate to
http://localhost:8501
in your browser.
- The app will automatically open in your default web browser. If not, navigate to
- Input Email Text
- Use the provided input field to enter details such as the email subject, sender address, email body, and other relevant metadata to determine whether an email is likely to be spam. This helps ensure your inbox remains free of unwanted and potentially harmful emails.
- Get Spam Classification
- Click the "Classify" button to check whether the email is spam or not.
Project Structure
Google Colab Notebook
You can also run the Spam Email Classification model in a Google Colab notebook. NOTEBOOK LINK
This notebook allows you to experiment with the code and datasets without setting up a local environment.
Acknowledgements
- The app uses data from the
email.csv
file for classifications. - The machine learning model was trained using scikit-learn.
Contact
Visit codebase here