Git Product home page Git Product logo

simple-sentiment-analysis-using-nltk's Introduction

Simple-Sentiment-Analysis-using-NLTK

Introduction:

I built a sentiment analysis model that can classify IMDB movie reviews as either positive or negative. I trained the model using 50000 IMDB movie reviews.

Process:

The Algorithm :  Tokenize, clean and lemmatize the data and took only the adjectives from the reviews. Created a frequency distribution and found the most used words in all of the reviews. The top 5000 was used as the features.  

Make features vectors: Created a dictionary representation of each review. The key in the dictoinary was each of the top words and the corresponding value was True of False for whether 'Word was in the review or not' Divdided the data into train test split. Use 5 different classification models to train on the data. Namely:

Classifiers for an ensemble model from NLTK-ScikitLearn library: Naive Bayes (NB) Multinomial NB Bernoulli NB Logistic Regression Stochastic Gradient Descent Classifier - SGD Support Vector Classification - SVC

Ensemple.py: Created a classifier class that takes votes from each classifier and takes the mode of the votes to give the final decision with a certain confidence level. Module.py: Can predict the sentiment of a single review.

The most used words from the feature set in each category -

Acknowledgement

simple-sentiment-analysis-using-nltk's People

Contributors

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