Coders Packet

Sentiment analysis using Python

By Hitesh Velaga

This a sentiment analysis project in which I have created a text classifier for movie reviews using Python's keras, convolutional neural network(CNN), long short term memory (LSTM).

In this movie review sentiment analysis project i have used Python's deep learning keras models for the classification part. For this I have used a movies dataset which has reviews as well as labels. In this project I first cleaned the text by removing duplicates, stop words and then replacing the abbrevations with fullforms. Then I have built a model which a convolutional neural network followed by a long short term memory. I have used a CNN as CNN can pick out unvarying features in the sequence of words in reviews. After that these spatial features may then be learned as sequences by an LSTM layer. Later after trainig this model I used precision and recall as well as ROC to determine the suitable threshold for this model. At the end I have even tried a few comments on my own it did pretty well but fails for sarcastic comments. While performing on different data you can choose a threshold according to your need if you want high precision then choose high threshold or if you want high recall choose threshold accordingly.

Requirments:

Python, Jupiter notebook, Sklearn, NLTK, Keras, re, numpy, pandas.

Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by Hitesh Velaga (saihiteshvellaga)

Download packets of source code on Coders Packet