Skip to content

Sentiment analysis of movie reviews using N-gram model and Naïve-Bayes Classifier in python.

Notifications You must be signed in to change notification settings

Mohilpalav/sentiment-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis of movie reviews

This code was written as part of the coursework of the CS-510 (Introduction to Artificial Intelligence) course at Drexel University.

Sentiment analysis of movie reviews using N-gram model and Naïve-Bayes Classifier in python.

We train the model using positive and negative reviews using an unigram model and use the model to classify whether a review is positive, negative or neutral using the Naïve-Bayes Classifier. We evaluate the model using macro averaging. The second model uses bigrams and a few preprocessing techniques to improve the overall accuracy.

Execution Steps:

  1. Clone the repository
  2. Alter the filename in the import statement in evaluate.py to the file you want to evaluate.
  3. Alter the trainDir variable in evaluate.py and provide the training folder path.
  4. Provide your testing folder path through the command line as follows:
    python3 evaluate.py "TEST_PATH"
    

About

Sentiment analysis of movie reviews using N-gram model and Naïve-Bayes Classifier in python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages