GithubHelp home page GithubHelp logo

sudhi48 / spam-detector Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 306 KB

flask based web app used to detect spam messages using machine learning

Home Page: http://dark48.pythonanywhere.com/

Python 2.07% Jupyter Notebook 94.60% HTML 3.33%
flask-application machine-learning naive-bayes-classifier numpy pandas pickle-file python3 spam-detection

spam-detector's Introduction

Spam Detector

This project is a flask based web app that detects spam messages using Naive Bayes classifier algorithm of machine learning. The application is built with Python 3 and Flask. It uses CountVectorizer with MultinomialNB from naive_bayes to achieve the best performance. The vectorizer and model are serialized using pickle for easy access in the Flask web app.

Table of Contents

Project Description

The Spam Detector classifies messages as spam or not spam using a machine learning model. The model is trained with the MultinomialNB algorithm and CountVectorizer to convert text data into numerical format. The Flask web application serves as an interface for users to input messages and get predictions.

Installation and Setup

Follow these steps to set up and run the project:

  1. Create a virtual environment:

    python -m venv myenv
  2. Activate the virtual environment:

    On Windows:
    .\myenv\Scripts\activate
    On macOS and Linux:
    source myenv/bin/activate

    After activation, your terminal prompt will change to indicate that you are now working inside the virtual environment.

  3. Install the required packages:

    pip install -r Requirements.txt
  4. Run the Flask application:

    flask run

Usage

  1. Open your web browser and go to
    http://127.0.0.1:5000
  2. You will see an input field where you can enter a message.
  3. Submit the message to get the prediction of whether it is spam or not spam.

Example

Here is a brief example of how the application works:

  1. Enter a message such as
    Congratulations! You've won a $1000 gift card. Click here to claim your prize here in this below link https://bitelottery4567.com/3frfty-ofgdf.
  2. Click the "Predict" button.
  3. The application will process the message and display the result, indicating whether the message is spam.

Additional Notes

  1. Ensure that the CountVectorizer and MultinomialNB model are properly serialized and available for the Flask app to load.
  2. The project structure should include the necessary files such as app.py, the serialized model file, and Requirements.txt.

spam-detector's People

Contributors

sudhi48 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.