Skip to content

siddharthpal18/spam_email_classifier

Repository files navigation

Spam-Ham Email Classifier

Project Overview

The Spam-Ham Email Classifier is an advanced machine learning application designed to accurately distinguish between spam (unwanted email) and ham (legitimate email). This project uses Python and Flask for web deployment, making it easily accessible via a browser. It leverages a robust set of machine learning tools and techniques, including pre-trained embeddings from the GloVe model, and is backed by a SQLite database for efficient data handling.

Project Structure

app.py: Flask application for deploying the model on a web server.

glove.txt: GloVe file containing pre-trained word embeddings used for text data vectorization.

label_encoder.pkl: Pickled file of the LabelEncoder, used to transform text labels into a suitable format for model training.

model.pkl: Serialized version of the trained machine learning model ready for predictions.

my_data.db: SQLite database file containing the processed email data.

project.py: Core machine learning script that includes data preprocessing, training the model, and evaluating performance.

requirements.txt: List of Python packages required to run the project.

spam.csv: Dataset file containing the spam and ham email messages.

vectorizer.pkl: Pickled file of the CountVectorizer, used to convert text data into a format that can be used by the model.

Installation Instructions

Prerequisites

Ensure Python 3.8 or higher is installed on your system. You can download it from python.org.

Setup

Clone the repository:

git clone https://github.com/yourusername/spam-ham-classifier.git cd spam-ham-classifier

Create and activate a virtual environment (optional but recommended):

python -m venv env env\Scripts\activate # On Windows

pip install -r requirements.txt

Usage

Running the Flask Application

To launch the Flask web application: python app.py This command starts a web server that hosts the classifier. Access the application via http://localhost:5000 in your web browser.

Using the Classifier

Navigate to the web application and follow the on-screen instructions to input an email text and receive a classification result.

Contributing

Contributions to this project are welcome! Please adhere to the following workflow:

  1. Fork the repository.
  2. Create a new branch for your feature (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -am 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Create a new Pull Request.

License

This project is licensed under the GNU General Public License (GPL) 3.0 - see the LICENSE file for details.

Contact

Developer: Your Name – Siddharth Pal

Project Link: https://github.com/siddharthpal18/spam-ham-classifier

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published