Skip to content

msamsami/sentiment-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis using Naive Bayes

header

Image source: www.expressanalytics.com

Introduction

A dataset of sample tweets is taken from the NLTK library and used to create a sentiment analysis model. The model is built using a Naive Bayes Classifier trained on a dataset of positive and negative tweets after preprocessing. The model takes a list of text tokens (that make up a comment) as input and predicts whether the corresponding comment is positive or negative.

Training

First, make sure to install all the requirements:

pip install -r ./requirements.txt

Then, run the train.py script:

python ./train.py --save-to ./models/naive_bayes.mdl --test-size 0.3

Run the app

The main.py file is a Streamlit app and is deployed to Streamlit Share. Visit the following link to run the app and test it:

About

Comment Sentiment Analysis using Naive Bayes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages