Skip to content

This is a flask app that predicts whether a text message is "Spam" or not spam("Ham").

Notifications You must be signed in to change notification settings

swarnava-96/Spam-Classifier-NLP-ML

Repository files navigation

Spam-Classifier-NLP

Overview

This is a flask app that predicts whether a text message is "Spam" or not spam("Ham").

Project Description:

Text pre-processing was performed by removing stop words from the data and Stemming was performed. Bag of Words was used to convert the words into vectors. Multinomial Naïve Bayes was used for model building after testing with other classification algorithms. Model was evaluated using accuracy score, confusion metrics and classification report. Model gave an accuracy of 98.5% on the test data and the number of False positives and False negatives were also very less. We can say that the model performed really well.

Installation

The Code is written in Python 3.7.3 If you don't have Python installed you can find it here. If you are using a lower version of Python you can upgrade using the pip package, ensuring you have the latest version of pip. To install the required packages and libraries, run this command in the project directory after cloning the repository:

1. First create a virtual environment by using this command:
conda create -n myenv python=3.7
2. Activate the environment using the below command:
conda activate myenv
3. Then install all the packages by using the following command
pip install -r requirements.txt
4. Then, in cmd or Anaconda prompt write the following code:
python app.py
Make sure to change the directory to the root folder.

Deployment on GCP

Login or sign up in order to create virtual app and many more things. Free tier account on Google console provides $300 credit for one year. For application deployment download the Google SDK installer.

Frontend using HTML,CSS and Backend using Flask

https://spamclassifier-sm.el.r.appspot.com

image

image

image

image

Currently app disabled,since GCP is chargeable.

Screenshot (10)

Technology Stack

Further Changes to be Done

  • Deploying the Web Application on Cloud.
    • AWS EC2 Instance
    • Azure
    • Heroku

About

This is a flask app that predicts whether a text message is "Spam" or not spam("Ham").

Topics

Resources

Stars

Watchers

Forks

Languages