Skip to content
/ spammer Public

Streamlit application to perform spam detection using Naive Bayes for multinomial models.

Notifications You must be signed in to change notification settings

grayoj/spammer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streamlit Spam Classification

A quite simple application that demonstrates the use of Naive Bayes algorithm for multinomial models, pandas for reading datasets and other sickitlearn models.

Requirements

  • Python 3 +
  • Pip (To Install packages)
  • Streamlit
  • Pandas
  • Numpy
  • Sickitlearn

Installation

Step 1

Clone this repository.

git clone https://github.com/grayoj/spam-detection.git

Install the Python Programming Language

Step 2 Using Pip, Install Streamlit which is the server for the application.

$ pip install streamlit

Step 3 Install pandas to read data sets

$ pip install pandas

Step 4 Install Sickitlearn modules that contains all necessary modules used in the project

$ pip install sklearn

Step 5 Install Numpy for mathematical functions.

$ pip install numpy

Step 6 Install the Natural language model toolkit.

$ pip install nltk

If you use Pylance, it should validate all imports made.

# Import String
import string
from sklearn.model_selection import train_test_split

# Import Streamlit.
import streamlit as st


# Import pandas to read CSV files.
import pandas as pd

# Import natural language toolkit.
import nltk

nltk.download('stopwords')
from nltk.corpus import stopwords

# Import Sickitlearn
import sklearn

# Import Naive Bayes Module
from sklearn.naive_bayes import MultinomialNB
from sklearn.feature_extraction.text import CountVectorizer
# Import module to display accuracy
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report

The imports as above.

Run Application

cd spam-detection
streamlit run app.py

Done. Should be running on the localhost. MIT License.

About

Streamlit application to perform spam detection using Naive Bayes for multinomial models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published