Giter VIP home page Giter VIP logo

assignment-2-nlp's Introduction

SMS Spam Detector

A web application that tells you if a given SMS is spam or not spam. It uses a ML model trained on the UCI SMS Spam Collection Dataset and is built using Flask. Project made by Subhashis Suara & Siddharth Das.

About Dataset

The SMS Spam Collection is a set of SMS tagged messages that have been collected for SMS Spam research. It contains one set of SMS messages in English of 5,574 messages, tagged according being ham (legitimate) or spam.

How does it work?

Demo Website: sms-spam-detector.centralindia.cloudapp.azure.com

From the dataset, we dropped unnecessary columns i.e., 'Unnamed: 2', 'Unnamed: 3', 'Unnamed: 4'. Then we renamed the columns i.e., v1 and v2 to label and message respectively. For classification purpose we replaced not spam label with 0 and spam with 1. We preprocessed our data by removing all special characters and stopwords. We then used Porter Stemmer for stemming the words. After joining the stemmed words we have created a corpus of messages. The next step was to create a Bag of Words model which we accomplished using CountVectorize function from sklearn library. We then fit the Multinomial Naive Bayes to the training set and then saved the model using the pickle module.

For deployment purpose we have used Flask. Using the pickle module, we loaded the Multinomial Naive Bayes model and the CountVectorizer object. The Flask app has 2 routes. First route is the home page route and second route is the detect route. The home page consists of a text fiels to input the sms message and a button to detect the sms type. Upon clicking the detect button, the Flask app uses the Multinomial model to classify if the message is spam or not spam. The detect page then displays the appropriate output on the webpage.

How to run the project?

Ensure that you have Python installed and enter the following commands in your terminal:

git clone https://github.com/subhashissuara/sms-spam-detector
pip install -r requirements.txt
python app.py

assignment-2-nlp's People

Contributors

aayushj123 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.