Skip to content

This is a Spam Email Classifier built using Python and Streamlit. It uses a pre-trained model to predict whether an email is Spam or Not Spam. The app also provides the probability scores for both categories, enhancing transparency and reliability of the prediction.

Notifications You must be signed in to change notification settings

hasanulmukit/spam-email-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spam Email Classifier

A SSpam Email Classifier application built with Python and Streamlit. It offers an interactive interface for predicting whether an email is Spam or Not Spam, with detailed probability scores, text input, and file upload support. The project uses a pre-trained model for robust predictions and features a user-friendly design.

Features

  • Interactive Interface: A user-friendly Streamlit interface.
  • Text Input: Allows users to input email text directly.
  • File Upload: Accepts .txt files containing email content.
  • Detailed Results:
    • Displays prediction as "Spam" or "Not Spam."
    • Shows probabilities for both categories.
  • Custom Styling: Enhanced aesthetics with styled headers, buttons, and footers.

Tech Stack

  • Programming Language: Python
  • Framework: Streamlit
  • Libraries: Scikit-learn, Joblib

Installation Guide

Prerequisites

  1. Python: Ensure Python (>=3.8) is installed.
  2. Streamlit: Install using pip.
    pip install streamlit
  3. Joblib: Ensure joblib is installed.
    pip install joblib

Steps to Run

  1. Clone the Repository:

    git clone https://github.com/your-username/SpamEmailClassifierApp.git
    cd SpamEmailClassifierApp
  2. Add the Pre-trained Model:

    • Save the trained model (spam_classifier_model.pkl) and vectorizer (count_vectorizer.pkl) in the project directory.
  3. Run the App:

    streamlit run app.py
  4. Access the App:

Usage

Input Methods

  1. Direct Text Input:
    • Paste email content into the provided text box.
  2. File Upload:
    • Upload a .txt file containing the email content.

Output

  • Prediction:
    • Displays whether the email is "Spam" or "Not Spam."
  • Probabilities:
    • Shows the likelihood of the email belonging to each category.

Future Enhancements

  • Deployment:
    • Deploy on platforms like Heroku or Streamlit Cloud.
  • Enhanced Visualization:
    • Add graphical visualizations for probabilities.
  • Additional Input Formats:
    • Support for PDF and DOCX file uploads.

License

This project is licensed under the MIT License.

Acknowledgments

About

This is a Spam Email Classifier built using Python and Streamlit. It uses a pre-trained model to predict whether an email is Spam or Not Spam. The app also provides the probability scores for both categories, enhancing transparency and reliability of the prediction.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages