reshalfahsi / movie-review-sentiment-analysis

Movie Review Sentiment Analysis Using CNN and MLP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Movie Review Sentiment Analysis Using CNN and MLP

colab

CNN-MLP A diagram of the CNN-MLP model.

Audiences' reactions to the movie they have watched can be presented in a text format called reviews. These reviews can be polarized into two clusters: positive responses and negative responses. Using CNN and MLP, one can perform sentiment analysis on movie reviews to automatically recognize the viewer's tendency toward a particular movie. CNN is used for extracting the latent information within the text format. MLP leverages the extracted information of CNN and carries out the classification task. The CNN-MLP model is evaluated with Standford's IMBD Movie Review dataset. On the test set, the model achieves 85.6% accuracy.

Experiment

To run the experiment, click here.

Result

Quantitative Result

The model's performance is measured by the accuracy and loss value. These values are computed regarding the sentiment analysis of the model on the dataset. The loss value is calculated based on the loss function employed in the training process which is the cross-entropy loss.

Dataset Split Accuracy Loss
Train 94.1% 0.347
Validation 96.5% 0.331
Test 85.6% 0.454

Accuracy and Loss Curve

acc_curve
Accuracy curve on the train set and the validation set.

loss_curve
Loss curve on the train set and the validation set.

CNN Visualization

To understand what CNN sees in deciding whether it is a positive or negative opinion, the GradCAM and TAHV visualization techniques are employed.

Positive Review

pos_CNN0 Visualization of the first layer of CNN on the positive review.

pos_CNN1 Visualization of the second layer of CNN on the positive review.

pos_CNN2 Visualization of the third layer of CNN on the positive review.

Negative Review

neg_CNN0 Visualization of the first layer of CNN on the negative review.

neg_CNN1 Visualization of the second layer of CNN on the negative review.

neg_CNN2 Visualization of the third layer of CNN on the negative review.

Credit

About

Movie Review Sentiment Analysis Using CNN and MLP


Languages

Language:Jupyter Notebook 100.0%