Skip to content

AishwaryaParaspatki/Sentiment-Analysis-for-Movie-Reviews-with-LSTM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis for Movie Reviews with LSTM

This is a project depicts a basic LSTM model to analyse sentiments based on IMDB's movie reviews dataset.

Technology Stack:

Python
Keras - TensorFlow
sklearn
matplolib
seaborn

Dataset:

I hacve used the IMDB dataset provided in the keras dataset library.

Workflow of the notebook:

  1. Loading the data using the keras dataset for IMDB.
  2. Splitting data into training and testing data.
  3. Preprocessing the data: Padding sequences to the same length.
  4. Building the model:
    a. Converting the vocabulary into integers using embeddings in the first layer of the model.
    b. Add LSTM layer with 128 units.
    c. Add output layer with sigmoid activation.
    d. Used binary cross entropy as the loss function and RMSprop optimizer with accuracy as the evaluation metric.
  5. Plot accuracy for each epoch using the RMSprop optimizer:
    TrainvsValidationacc
  6. Plot confusion matrix:
    Confusion_Matrix

Training vs Validation Accuracy with SGD Optimizer:
SGD_optimizer
Training vs Validation Accuracy with Adam Optimizer:
Adam_optimizer