Sentiment Analysis On IMDB Movie Reviews Using Machine Learning and Deep Learning Algorithms
Sentiment Analysis On IMDB Movie Reviews Using Machine Learning and Deep Learning Algorithms
Abstract—Sentiment analysis is the study, to classify the text customer reviews. Reviews are considered as short text by
based on customer reviews which can provide valuable which the opinion of a person can be identified. As everything
information to improve business. Previously the analysis was is digitalized, people check blogs for reviews before they
carried out based on the information provided by the customers watch a movie or purchase a product. These reviews drive
using natural language processing and machine learning. In this
paper, sentiment analysis on IMDB movie reviews dataset is
people to theatres and customers towards products. This
implemented using Machine Learning (ML) and Deep Learning analysis of sentiment helps to implement a strategic plan and
(DL) approaches to measure the accuracy of the model. ML attract more customers.
algorithms are the traditional algorithms that work in a single As per the previous work, sentiment analysis implementation
layer while deep learning algorithms work on multilayers and
gives better output. This paper helps the researchers to identify
was through NLP (Natural Language Processing) and
the best algorithm for sentiment analysis. The comparison of the machine learning algorithm. Sentiment analysis of movie
machine learning and deep learning approaches shows that DL reviews includes pre-processing and implementation of
algorithms provide accurate and efficient results. modelling techniques.These modelling techniques are used to
identify the reviewer sentiment that is categorized as either
Keywords— machine learning, NLP, deep learning,
positive or negative. Model accuracy can also be known by
comparison
machine learning algorithm which provides the accuracy
I. INT RODUCT ION percentage of the sentiment identified on a particular review
dataset.
Sentiment analysis is a perspective, thought, or judgment of a
specific feeling. Most of the analysis is done based on online In this paper, sentiment analysis is done using ML and Deep
reviews. It is troublesome to analyze using forum discussions learning approach on the considered IMDB review dataset.
because most of the information provided is irrelevant. To The text reviews categorised as negative and positive reviews.
overcome this, aspect-based sentiment analysis can be used Deep learning is used to reduce human intervention and the
as it is a text analysis technique used to categorize data and issues of big data are dealt effectively to provide a better
identify the sentiment attributed to specific review. Aspect- model for handling the data efficiently [17].
based sentiment analysis can be used to analyze customer
feedback through sentiments with different aspects of a Deep learning can also be used in NLP to analyze the
product or service. By using this analysis, the sentiment of the customer's point of view [18]. In this paper, deep learning and
reviews can be identified easily. machine learning approaches are used to analyze the
sentiment of the movie reviews and to identify whether the
Natural language explanations have become challenging du e reviews are negative or positive. These reviews can be
to the complexity of human languages. The main reason is utilized as a tool for recommending movies. Filmmakers can
that textual data doesn't have a proper structure. There is a also utilize this information to make marketing decisions and
need to parse the data as it helps the machine to understand attract customers.
and utilize the data. Sentiment analysis helps companies to
analyze large amounts of data within less time. Sentiment
analysis helps to analyze and prepare strategies based on
II. LIT ERAT URE SURVEY Socher et.al. [9] projected that a text cannot be analyzed in
isolation which states that sentences are closely associated
Sentiment Analysis is based on feature extraction and with the words.
sentiment classification. It is achieved by applying the
statistical approach using machine learning [2]. IMDB The invention [10] expressed that (RNN) model will
reviews were analyzed using sentiment analysis and show subsume the short dependence during a sequence of
reviews by n-gram approaches. information however, includes a drawback of gradient
explosion as they will have a major impact on overall
Different classifiers are used to train the model and the polarity to unravel this semipermanent dependence
unigram approach is performed well in comparison to drawback, the LSTM model is proposed by Vu et al. [11].
others. The n-gram approach of experimentation was
finished and tried to produce the simplest results. Similar Remote sensing applications are not fully engaged in the use
work was done by Tripathy et al. [1], where TF, TF-IDF of CNN. In order to address this issue, they introduced a
was used for the conversion of the text file to a numerical novel CNN so that there is an increase in the performance of
vector. Experimentation was done with n-gram approaches detectors [14]. The research study performs an analysis by
and its combination are tried to get the best results. considering a dataset obtained from online social media,
where the detection is based on a ML algorithm [17].
Not only the word features, but special symbols present with
words can also be considered as features [3]. The emotions
with the word features can be utilized. Classifier ensemble
III. M ET HODOLOGY
is used to classify the results obtained by different ML
algorithms and produce a good result. In this paper, two approaches are compared on the data set
of 50000 IMDB movie reviews, the reviews are in the text
Research is done to extract features that include the parts of
format the sample format of the used dataset is shown in
the speech by using a tagger [4]. The unigram model is used
Fig. 1.
to extract adjectives that describe the positive or negative
sentence. Emotion recognition had always been attracted The first implementation is performed on this dataset by
attention in multiple fields that include NL processing, applying ML algorithms for the prediction of accuracy on
psychology [12]. the model. The second implementation is performed using
deep learning techniques which resulted in better accuracy
Aspect-based sentiment analysis requires two conceptual
for sentiment analysis.
tasks, syntactical information to explore the grammatical
methods and address this problem by utilizing the effective The input data set is applied as a set of movie reviews and
encoding of the syntax. the expected output is the accuracy of the model. In this
paper, both the ML and DL approaches are implemented
Analyzing the sentiment of the customers is essential as a
and a comparison of these approaches is shown. A short
customer plays an important role to improve business . The
note on the techniques used is given below.
work of sentiment recognition mainly focused on semantic
processing to understand the customer better and analyze Natural language processing: NLP is taken into
through the reviews. This approach, shows the graphs, account as a field of applied science and is
similarity measures, algorithms using graph theory to make additionally concerned with the interactions between
the process simplified and easy [13]by considering the texts machines and human languages. It helps to spot the
that could promote to understand the language better so that sentiment of the reviewer and consists of many pre-
the sentiment analysis tasks can be done easily. processing techniques to convert the information into
Preethi et.al. [5] introduced a new application (RNN) with simpler text. So, that it will be easily understood.
deep learning system for sentiment analysis using pic
reviews. Qian et.al.[6] projected a model to train with Machine Learning Algorithms: ML is the study of
sentence-level annotation, they conjointly did an effort to systems related to field of computer science and it can learn
come up with linguistic coherent representations of the from data. It mostly focuses on predictions supported on
model using regularizers. known properties and learns from the training data. It
Nguyen et.al. [7] Designed a model that predicts stock requires training data set to be considered and therefore
worth movement by mistreatment of the sentiment collected the classifier has to be trained on some labelled training
from social media. It shows the analysis of stock prediction data, before it is applied to the particular classification Task.
task and the authors adopted the neural network
methodology to demonstrate that ML methodology is Some of the machine learning algorithms is given below.
beneficial for finding out the variations and commonalities Logistic Regression
of various quantizing strategies of quantum correlation [8]. Naive Baye’s
The study of Recursive Neural Tensor Network was SVM
accustomed to determine sentences based on the user XGBOOST
sentiment, and they used a dataset that contains 11,855
movie reviews. The accuracy achieved by RNTN is 80.7%.
Process of Implementation
In this paper, different ML and DL approaches are
considered and the implementation of both Approaches is
listed below briefly.
The first algorithm considered by us is logistic regression Pre- Processing Stage: As the dataset is required to be
which is a classification technique that serves to solve the clean to apply and create and train model. In this stage, it
binary classification problem. Movie reviews were includes removal of attribute missing values, Standard
considered as positive and negative thus logistic regression Scalar, Min-Max Scalar has been applied to the dataset
can be used and was applied on both count vectorizer and to clean the data and obtain required clean data.
TF-IDF to find out the accuracy score. The accuracy score Predictive Models: The predictive models used in this
obtained is around 87% for TF-IDF and 86% for the count paper are Logistic regression, SVM, XGboost,
vectorizer. Multinomial Naive Baye’s and Deep Learning CNN,
The second algorithm considered is the support vector RNN, and LSTM model.
machines and was applied on TF-IDF and count vectorizer
to find out the accuracy score and the accuracy score Performance Metrics and its Evaluation: Evaluation
obtained is 89% for TF-IDF and 86% for count vectorizer. metrics are used for classifiers to know the performance.
The third algorithm considered is Multinomial Naive baye’s Metrics for a model on a binary classification problem
algorithm that can be used for text analysis and this
technique is accustomed to find the possibilities of classes are listed with the equations:
assigned to texts by considering the joint probabilities of the Recall metrics: tp / (tp + fn) (1)
words and classes. This algorithm was also applied on both
TF-IDF and count vectorizer to understand the accuracy F1 Score metrics: 2 tp / (2 tp + fp + fn) (2)
score. The obtained accuracy is 86% in both cases. Accuracy metrics = (TP + TN) (TP + TN + FP +
The fourth algorithm considered is XGBoost algorithm FN) × 100 (3)
which boosts the speed and performance of the model. Here
the accuracy obtained by applying XGBoost on TF-IDF and Precision metrics: tp / (tp + fp) (4)
count vectorizer is 80%. The overall flow process of the implementation on IMDB
movie reviews by using ML and DL approach is shown in
IMDB Data pre- Modeling Fig. 4.
Movie Processing Techniques
Reviews IMDB Data Extraction
Movie
reviews
Data integration
and transformation
Model
accuracy
Feature Extraction
comparison
Fig. 3. Shows the block diagram of algorithms applied on IMDB movie Train and Test data
reviews. split 70:30
V. RESULTS
In this approach ML and DL algorithms are applied to the
IMDB movie reviews dataset to analyze positive and
negative sentiment by detecting the emotion of the reviewer
through text that includes some emotional key words which
determine the emotion of the reviewer. Some positive
emotions include “good”, “like”, “best”, “great” and
negative emotions include “worst”, “sadly”, “disappointed”,
“uncomfortable”, “bad”. To analyze these positive and
negative emotions machine learning algorithms (Logistic
Regression, SVM, Multinomial Navies baye’s and
XGBoost) and Deep learning (CNN, RNN, and LSTM)
models are applied. The different approaches are compared
with Recall metrics (eq. 1), F1 Score metrics (eq. 2),
Accuracy metrics (eq. 3) and Precision metrics (eq. 4) as
shown in Table II. The Accuracy comparison of ML and DL
algorithms is represented as Bar graph in Fig. 5. The Fig. 6. T he graphical representation of CNN validation accuracy
accuracy and loss of CNN and RNN are shown in and loss of trained model.
learning algorithms are more accurate and efficient than sentiment analysis,’’ in Proc. Conf. Empirical Methods Natural
machine learning algorithms. Lang. Process. (EMNLP), 2020, pp. 6975 –6988
[14] P. Karuppusamy “Building Detection using T wo-Layered Novel
Convolutional Neural Networks” Journal of Soft Computing
In future work, better models are hoped to be identified Paradigm (JSCP) 3, no. 01 (2021): 29-37.
using deep learning to achieve better accuracy and to [15] Smys, S., and Haoxiang Wang “Security Enhancement in Smart
improve the effect of movie reviews by using sentiment Vehicle Using Blockchain- based Architectural Framework”
analysis. Data pre-processing plays an important role in Journal of Art ificial Intelligence 3, no. 02 (2021): 90-100.
such large data sets. The aim is to identify better data pre- [16] S.R. Mugunthan,“Soft computing based autonomous low rate
DDOS attack detection and security for cloud computing” J.
processing methods to achieve improved accuracy for movie Soft Comput. Paradig.(JSCP) 1, no. 02 (2019): 80 -90.
review sentiment analysis. [17] Smys, S., and Jennifer S. Raj “Analysis of Deep Learning
T echniques for Early Detection of Depression on Social Media
Network-A Comparative Study” Journal of trends in Computer
REFERENCES Science and Smart technology (TCSST ) 3, no. 01 (2021): 24-39.
[1] A. T ripathy, A. Agrawal, and S.K. Rath. “Classification of [18] Kumar, T . Senthil “Construction of Hybrid Deep Learning
sentiment reviews using n-gram machine learning approach.” Model for Predicting Children Behavior based on their
Expert Systems with Applications, Vol. 57, pp. 117-126. 2016. Emotional Reaction” Journal of Information Technology 3, no.
01 (2021): 29-43.
[2] B. Pang, L. Lee, and S. Vaithyanathan. “Thumbs up? sentiment
classification using machine learning techniques.” In
Proceedings of the ACL-02 conference on Empirical methods in
natural language processingVolume 10, Association for
Computational Linguistics, pp. 79-86. 2002.