0% found this document useful (0 votes)
84 views

Sentiment Analysis On IMDB Movie Reviews Using Machine Learning and Deep Learning Algorithms

The document discusses sentiment analysis on IMDB movie reviews using machine learning and deep learning algorithms. It compares machine learning and deep learning approaches for sentiment analysis and finds that deep learning algorithms provide more accurate and efficient results. Sentiment analysis helps identify customer opinions from reviews to improve business strategies and attract more customers.

Uploaded by

Saad Tayef
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views

Sentiment Analysis On IMDB Movie Reviews Using Machine Learning and Deep Learning Algorithms

The document discusses sentiment analysis on IMDB movie reviews using machine learning and deep learning algorithms. It compares machine learning and deep learning approaches for sentiment analysis and finds that deep learning algorithms provide more accurate and efficient results. Sentiment analysis helps identify customer opinions from reviews to improve business strategies and attract more customers.

Uploaded by

Saad Tayef
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Proceedings of the Fourth International Conference on Smart Systems and Inventive Technology (ICSSIT-2022)

IEEE Xplore Part Number: CFP22P17-ART; ISBN: 978-1-6654-0118-0

Sentiment Analysis on IMDB Movie Reviews


using Machine Learning and Deep Learning
Algorithms
K. Amulya 1 S. B. Swathi2
M.Tech, Data science Assistant professor, Dept. of IT
Kakatiya Institute of Technology & Science Kakatiya Institute of Technology & Science
Warangal, India Warangal, India
amulyakompalliece@g mail.co m [email protected]
2022 4th International Conference on Smart Systems and Inventive Technology (ICSSIT) | 978-1-6654-0118-0/22/$31.00 ©2022 IEEE | DOI: 10.1109/ICSSIT53264.2022.9716550

Dr. P. Kamakshi3 Dr. Y. Bhavani4*


Professor & Head, Dept. of IT Associate professor, Dept. of IT
Kakatiya Institute of Technology & Science Kakatiya Institute of Technology & Science
Warangal, India Warangal, India
[email protected] [email protected]
ORCID: 0000-0002-8578-7126

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

978-1-6654-0118-0/22/$31.00 ©2022 IEEE 814


Authorized licensed use limited to: Rajshahi University Of Engineering and Technology. Downloaded on January 28,2024 at 11:12:48 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Fourth International Conference on Smart Systems and Inventive Technology (ICSSIT-2022)
IEEE Xplore Part Number: CFP22P17-ART; ISBN: 978-1-6654-0118-0

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%.

978-1-6654-0118-0/22/$31.00 ©2022 IEEE 815


Authorized licensed use limited to: Rajshahi University Of Engineering and Technology. Downloaded on January 28,2024 at 11:12:48 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Fourth International Conference on Smart Systems and Inventive Technology (ICSSIT-2022)
IEEE Xplore Part Number: CFP22P17-ART; ISBN: 978-1-6654-0118-0

Deep Learning Approaches  Data set


To identify the better model that can be used for sentiment
 CNN: CNN often used for identifying objects inside
images and for text classification by using word analysis, a public IMDB dataset that contains 50,000
embeddings. It's been found effective for text in search reviews is considered, of which 35,000 are used for training
query retrieval, sentence modeling, and NLP tasks. and the remaining 15,000 are used for testing which is
shown in Table I and Fig. 2. is the graphical representation
 RNN: RNN takes a sequence of information as input; of two review categories.
recursive process is performed in the evolution
direction of the sequence. It is the study on nonlinear
characteristics of the sequence and has many
advantages.
RNN is applied on NLP, like speech recognition,
language modelling, and other fields and it is a deep
learning approach that may be used for sentiment
analysis. It produces the output supported by previous
computation and taking sequential information.
 LSTM (Long Short-Term Memory): It is used to
overcome the RNN problem for memorizing data for a
longer time. LSTM works as a part of long-term
dependence. This can be used for text classification and
it produces long-term memorizing of the data compared
to RNN. Thus, LSTM is also used for the
implementation and analysis of the sentiment based on
reviews.

Fig. 2. Shows the graphical representation of two review categories

T ABLE I. Shows the IMDB movie review dataset categories

 Process of Implementation
In this paper, different ML and DL approaches are
considered and the implementation of both Approaches is
listed below briefly.

 NLP approach using Machine learning algorithms.


Fig. 1. Sample format of the text reviews of IMDB movie reviews dataset
In Fig 3. The process is shown, firstly a Movie reviews data
IV. EXPERIMENTATION set is applied and then pre-processing of data that includes
text normalization, removing noisy text, special characters,
In this paper, sentiment analysis is done using Machine text stemming, removing stop words, and word embedding.
learning Algorithms and an advanced implementation based Then modelling techniques in NLP are applied that include
on the Deep Learning RNN method to identify the better count vectorizer and TF-IDF. The data here was split into
model for sentiment analysis on movie reviews. The train and test set after that ML algorithms were applied to
experiment was done by using python code on the google check the accuracy of the model.
collab platform.

978-1-6654-0118-0/22/$31.00 ©2022 IEEE 816


Authorized licensed use limited to: Rajshahi University Of Engineering and Technology. Downloaded on January 28,2024 at 11:12:48 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Fourth International Conference on Smart Systems and Inventive Technology (ICSSIT-2022)
IEEE Xplore Part Number: CFP22P17-ART; ISBN: 978-1-6654-0118-0

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

ML and DL Data Pre-processing


algorithms datset

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

 Deep Learning approach


In the Deep learning approach, CNN, RNN, LSTM are used Validation of the
and implemented on the considered IMBD movie review Output
data by applying Model
datasets. In Deep learning, feature extraction is done
ML and DL
automatically and that makes solving complex problems Accuracy
algorithms
easier. The First Deep learning approach is CNN, by
applying this model the accuracy achieved is 87%, the
second approach is the RNN model and the accuracy
Fig. 4. Shows the flow diagram of the implementation procedure of the ML
achieved is 88%. Third and final approach is the LSTM and DL algorithms
model and the accuracy achieved by this model is 72%.

978-1-6654-0118-0/22/$31.00 ©2022 IEEE 817


Authorized licensed use limited to: Rajshahi University Of Engineering and Technology. Downloaded on January 28,2024 at 11:12:48 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Fourth International Conference on Smart Systems and Inventive Technology (ICSSIT-2022)
IEEE Xplore Part Number: CFP22P17-ART; ISBN: 978-1-6654-0118-0

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.

graphical representation in Fig. 6, Fig. 7

T ABLE II. The comparison scores of two approaches implemented


on IMDB dataset.

Pe rformance Pre dictive Precision Recall F1- Accuracy


me trics mode l Score
Pe rformance Logistic 0.89 0.85 0.87 0.86
me trics of tf- Re gression
idf fe ature s SVM 0.89 0.86 0.86 0.87
Multinomial 0.87 0.85 0.86 0.86
Naïve
Baye ’s
XGBoost 0.84 0.73 0.86 0.86
Pe rformance Logistic 0.87 0.86 0.87 0.86
me trics of Re gression
Count- SVM 0.86 0.86 0.86 0.86
Ve ctorise r Multinomial 0.87 0.85 0.86 0.86
Naïve
Baye ’s
XGBoost 0.84 0.74 0.79 0.81
Pe rformance CNN 0.94 0.85 0.87 0.87
me trics of
De e p RNN 0.95 0.86 0.88 0.88
le arning Fig. 7. T he graphical representation of RNN validation accuracy and
LSTM 0.72 0.70 0.71 0.71
Algorithms loss of trained model

VII. CONCLUSION AND FUTURE WORK


In this paper, the NLP approach using Machine Learning
algorithms and the Deep Learning methods is used to
classify reviews of the data set taken into positive and
negative categories. Comparison of ML and DL approaches
is done by considering IMDB movie reviews. From the
observations it is found that DL approaches provided
accurate results than ML algorithms. Among the DL
algorithms (CNN, RNN, LSTM), RNN gives more accuracy
of 88%. When ML algorithms is used the feature extraction
Fig. 5. T he Bar graph of the ML and DL approaches model accuracy
comparison. should be done manually whereas in DL approach there is
no need of human intervention and feature extraction is
done by machine automatically. It is concluded that deep

978-1-6654-0118-0/22/$31.00 ©2022 IEEE 818


Authorized licensed use limited to: Rajshahi University Of Engineering and Technology. Downloaded on January 28,2024 at 11:12:48 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Fourth International Conference on Smart Systems and Inventive Technology (ICSSIT-2022)
IEEE Xplore Part Number: CFP22P17-ART; ISBN: 978-1-6654-0118-0

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.

[3] M. S. Mubarok, Adiwijaya, and M. D. Aldhi. “Aspect -based


sentiment analysis to review products using Naïve Bayes.” In
AIP Conference Proceedings, vol. 1867, AIP Publishing, no. 1,
pp 1-8.2017.
[4] G. Gautam, and D. Yadav. “Sentiment analysis of twitter data
using machine learning approaches and semantic analysis.” In
Contemporary computing (IC3), 2014 seventh international
conference on, pp. 437-442. IEEE, 2014.
[5] G. Preethi; Krishna, P. V.; Obaidat, M. S.; Saritha, V.; Yenduri,
S. (2017):“Application of deep learning to sentiment analysis
for recommender system on cloud”. International Conference on
Computer, Information and T elecommunication Systems, pp.
93–97.
[6] Q. Qian.; M. Huang.; J. Lei; X. Zhu (2016): “ Linguistically
regularized LST Ms for sentiment classification. arXiv preprint
arXiv:1611.03949. Sak, H.; Senior, A.; Beaufays, F. (2014): “
Long short -term memory based recurrent neural network
architectures for large vocabulary speech recognition”. arXiv
preprint arXiv:1402.1128.
[7] T . H. Nguyen; K. Shirai; J. Velcin (2015): “Sentiment analysis
on social media for stock movement prediction”. Expert
Systems with Applications, vol. 42, no. 24, pp. 9603 -9611.
[8] Q. Li, X.; Zhu; Q. Meng; You, C.; M. Zhu (2019): “Researching
the link between the geometric and rènyi discord for special
canonical initial states based on neural network meth od”.
Computers, Materials Continua1, vol. 60, no. 3, pp. 1087-1095.
[9] R. Socher; A. Perelygin; J. Wu; J. Chuang; C. D. Manning
(2013): Recursive deep models for semantic compositionality
over a sentiment treebank. Proceedings of the 2013 Conference
on Empirical Methods in Natural Language Processing, pp.
1631-1642.
[10] T . Lin;B.G. Horne; P.T ino; C.L.Giles(1996): Learning long-
term dependencies in narx recurrent neural networks. IEEE
T ransactions on Neural Networks, vol.7, no. 6, pp. 1329-1338.
[11] N.T . Vu; H. Adel; P. Gupta.; H. Schütze, (2016): “ Combining
recurrent and convolutional neural networks for relation
classification”. arXiv preprint arXiv:1605.07333.
[12] J.B. Delbrouck, N. T its, M. Brousmiche, and S. Dupont, ‘‘A
transformerbased joint-encoding for emotion recognition and
sentiment analysis”, in Proc. 2nd Grand-Challenge Workshop
Multimodal Lang. (ChallengeHML), 2020, pp. 1–7.
[13] P. Ke, H. Ji, S. Liu, X. Zhu, and M. Huang, ‘‘Sentilare:
Linguistic knowledge enhanced language representation for

978-1-6654-0118-0/22/$31.00 ©2022 IEEE 819


Authorized licensed use limited to: Rajshahi University Of Engineering and Technology. Downloaded on January 28,2024 at 11:12:48 UTC from IEEE Xplore. Restrictions apply.

You might also like