This is a project depicts a basic LSTM model to analyse sentiments based on IMDB's movie reviews dataset.
Python
Keras - TensorFlow
sklearn
matplolib
seaborn
I hacve used the IMDB dataset provided in the keras dataset library.
- Loading the data using the keras dataset for IMDB.
- Splitting data into training and testing data.
- Preprocessing the data: Padding sequences to the same length.
- 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. - Plot accuracy for each epoch using the RMSprop optimizer:
- Plot confusion matrix:
Training vs Validation Accuracy with SGD Optimizer:
Training vs Validation Accuracy with Adam Optimizer: