Sentiment Analysis on Movie Reviews: A Comparative Analysis

Ieee account.

  • Change Username/Password
  • Update Address

Purchase Details

  • Payment Options
  • Order History
  • View Purchased Documents

Profile Information

  • Communications Preferences
  • Profession and Education
  • Technical Interests
  • US & Canada: +1 800 678 4333
  • Worldwide: +1 732 981 0060
  • Contact & Support
  • About IEEE Xplore
  • Accessibility
  • Terms of Use
  • Nondiscrimination Policy
  • Privacy & Opting Out of Cookies

A not-for-profit organization, IEEE is the world's largest technical professional organization dedicated to advancing technology for the benefit of humanity. © Copyright 2024 IEEE - All rights reserved. Use of this web site signifies your agreement to the terms and conditions.

Sentiment Analysis on Movie Review Using Deep Learning RNN Method

  • Conference paper
  • First Online: 30 August 2020
  • Cite this conference paper

nltk movie reviews dataset

  • Priya Patel 18 ,
  • Devkishan Patel 19 &
  • Chandani Naik 20  

Part of the book series: Advances in Intelligent Systems and Computing ((AISC,volume 1177))

855 Accesses

4 Citations

The usage of social media grows rapidly because of the functionality like easy to use and it will also allow user to connect with all around the globe to share the ideas. It is desired to automatically use the information which is user’s interest. One of the meaningful information that is derived from the social media sites are sentiments. Sentiment analysis is used for finding relevant documents, overall sentiment, and relevant sections; quantifying the sentiment; and aggregating all sentiments to form an overview. Sentiment analysis for movie review classification is useful to analyze the information in the form of number of reviews where opinions are either positive or negative. In this paper we had applied the deep learning-based classification algorithm RNN, measured the performance of the classifier based on the pre-process of data, and obtained 94.61% accuracy. Here we had used RNN algorithm instead of machine learning algorithm because machine learning algorithm works only in single layer while RNN algorithm works on multilayer that gives you better output as compared to machine learning.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
  • Available as EPUB and PDF
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Balaji, P., Nagaraju, O., Haritha, D.: Levels of sentiment analysis and its challenges: a literature review. In: 2017 International Conference on Big Data Analytics and Computational Intelligence (ICBDAC), pp. 436–439. IEEE (2017)

Google Scholar  

Bhonde, S.B., Prasad, J.R.: Sentiment analysis-methods, application and challenges. Int. J. Electron. Commun. Comput. Eng. 6 (6) (2015)

Li, D., Qian, J.: Text sentiment analysis based on long short-term memory. In: 2016 First IEEE International Conference on Computer Communication and the Internet (ICCCI), pp. 471–475. IEEE (2016)

Sepp, H. Schmidhuber, J.: long short-term memory. Neural Comput. 12–91 (1997)

Nair, S.K., Soni, R.: Sentiment analysis on movie reviews using recurrent neural network. (2018)

Bandana, R:. Sentiment analysis of movie reviews using heterogeneous features. In: 2018 2nd International Conference on Electronics, Materials Engineering and Nano-Technology (IEMENTech), pp. 1–4. IEEE (2018)

Pouransari, H., Ghili, S.: Deep learning for sentiment analysis of movie reviews. Tech. Rep. Stanford University (2014)

Mesnil, G., Mikolov, T., Ranzato, M.A., Bengio, Y.: Ensemble of generative and discriminative techniques for sentiment analysis of movie reviews. arXiv preprint arXiv:1412.5335 (2014)

Li, B., Liu, T., Du, X., Zhang, D., Zhao, Z.: Learning document embeddings by predicting n-grams for sentiment classification of long movie reviews. arXiv preprint arXiv:1512.08183 (2015)

Lazib, L., Zhao, Y., Qin, B., Liu, T.: Negation scope detection with recurrent neural networks models in review texts. In: International Conference of Young Computer Scientists, Engineers and Educators, pp. 494–508. Springer, Singapore (2016)

Kennedy, Alistair, Inkpen, Diana: Sentiment classification of movie reviews using contextual valence shifters. Comput. Intell. 22 (2), 110–125 (2006)

Article   MathSciNet   Google Scholar  

Pang, B., Lee, L., Vaithyanathan, S.: Thumbs up?: sentiment classification using machine learning techniques. In: Proceedings of the ACL-02 Conference on Empirical Methods In Natural Language Processing, vol. 10, pp. 79–86. Association for Computational Linguistics (2002)

Ahuja, R., Anand, W.: Sentiment classification of movie reviews using dual training and dual predition. In: 2017 Fourth International Conference on Image Information Processing (ICIIP), pp. 1–4. IEEE (2017)

Narayanan, V., Arora I, Bhatia, A.: Fast and accurate sentiment classification using an enhanced Naive Bayes model. In: International Conference on Intelligent Data Engineering and Automated Learning, pp. 194–201. Springer, Berlin, Heidelberg (2013)

Socher, R., Lin, C.C., Manning, C., Ng, A.Y.: Parsing natural scenes and natural language with recursive neural networks. In: Proceedings of the 28th International Conference On Machine Learning (ICML-11), pp. 129–136. (2011)

Download references

Author information

Authors and affiliations.

Department of Computer Engineering, N. G. Polytechnic, Isroli, India

Priya Patel

Department of Computer Engineering, Pacific School of Engineering, Palsana, India

Devkishan Patel

Department of Computer Engineering, CGPIT, Uka Tarsadiya University, Bardoli, India

Chandani Naik

You can also search for this author in PubMed   Google Scholar

Corresponding author

Correspondence to Priya Patel .

Editor information

Editors and affiliations.

School of Computer Engineering, Kalinga Institute Industrial Technology, Bhubaneswar, Odisha, India

Suresh Chandra Satapathy

Department of Informatics, University of Leicester, Leicester, UK

Yu-Dong Zhang

Department of Electronics and Communication Engineering, Shri Ramswaroop Memorial Group of Professional Colleges (SRMGPC), Lucknow, Uttar Pradesh, India

Vikrant Bhateja

School of Management, National Institute of Technology Karnataka, Surathkal, Karnataka, India

Ritanjali Majhi

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Cite this paper.

Patel, P., Patel, D., Naik, C. (2021). Sentiment Analysis on Movie Review Using Deep Learning RNN Method. In: Satapathy, S., Zhang, YD., Bhateja, V., Majhi, R. (eds) Intelligent Data Engineering and Analytics. Advances in Intelligent Systems and Computing, vol 1177. Springer, Singapore. https://doi.org/10.1007/978-981-15-5679-1_15

Download citation

DOI : https://doi.org/10.1007/978-981-15-5679-1_15

Published : 30 August 2020

Publisher Name : Springer, Singapore

Print ISBN : 978-981-15-5678-4

Online ISBN : 978-981-15-5679-1

eBook Packages : Intelligent Technologies and Robotics Intelligent Technologies and Robotics (R0)

Share this paper

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

  • Publish with us

Policies and ethics

  • Find a journal
  • Track your research

Sentiment Classification on the Large Movie Review Dataset

Data mining project, bert sentiment classification.

  • Monticone Pietro
  • Moroni Claudio
  • Orsenigo Davide

Problem: Sentiment Classification

A sentiment classification problem consists, roughly speaking, in detecting a piece of text and predicting if the author likes or dislikes what he/she is talking about: the input X is a piece of text and the output Y is the sentiment we want to predict, such as the rating of a movie review.

If we can train a model to map X to Y based on a labelled dataset then it can be used to predict sentiment of a reviewer after watching a movie.

Data: Large Movie Review Dataset v1.0

The dataset contains movie reviews along with their associated binary sentiment polarity labels.

  • The core dataset contains 50,000 reviews split evenly into 25k train and 25k test sets.
  • The overall distribution of labels is balanced (25k pos and 25k neg).
  • 50,000 unlabeled documents for unsupervised learning are included, but they won’t be used.
  • The train and test sets contain a disjoint set of movies, so no significant performance is obtained by memorizing movie-unique terms and their associated with observed labels.
  • In the labeled train/test sets, a negative review has a score ≤ 4 out of 10, and a positive review has a score ≥ 7 out of 10. Thus reviews with more neutral ratings are not included in the train/test sets.
  • In the unsupervised set, reviews of any rating are included and there are an even number of reviews > 5 and ≤ 5.

Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. (2011). Learning Word Vectors for Sentiment Analysis . The 49th Annual Meeting of the Association for Computational Linguistics (ACL 2011).

Theoretical introduction

The encoder-decoder sequence.

Roughly speaking, an encoder-decoder sequence is an ordered collection of steps ( coders ) designed to automatically translate sentences from a language to another (e.g. the English “the pen is on the table” into the Italian “la penna è sul tavolo”), which could be useful to visualize as follows: input sentence → ( encoders ) → ( decoders ) → output/translated sentence .

For our practical purpose, encoders and decoders are effectively indistinguishable (that’s why we will call them coders ): both are composed of two layers: a LSTM or GRU neural network and an attention module (AM) . They only differ in the way in which their output is processed.

LSTM or GRU neural network

Both the input and the output of an LSTM/GRU neural network consists of two vectors:

  • the hidden state : the representation of what the network has learnt about the sentence it’s reading;
  • the prediction : the representation of what the network predicts (e.g. translation).

Each word in the English input sentence is translated into its word embedding vector (WEV) before being processed by the first coder (e.g. with word2vec ). The WEV of the first word of the sentence and a random hidden state are processed by the first coder of the sequence. Regarding the output: the prediction is ignored, while the hidden state and the WEV of the second word are passed as input into the second coder and so on to the last word of the sentence. Therefore in this phase the coders work as encoders .

At the end of the sequence of N encoders (N being the number of words in the input sentence), the decoding phase begins:

  • the last hidden state and the WEV of the “START” token are passed to the first decoder ;
  • the decoder outputs a hidden state and a prection;
  • the hidden state and the prediction are passed to the second decoder;
  • the second decoder outputs a new hidden state and the second word of the translated/output sentence

and so on up until the whole sentence has been translated, namely when a decoder of the sequence outputs the WEV of the “END” token. Then there is an external mechanism to convert prediction vectors into real words, so it’s very importance to notice that the only purpose of decoders is to predict the next word .

Attention module (AM)

The attention module is a further layer that is placed before the network which provides the collection of words of the sentence with a relational structure. Let’s consider the word “table” in the sentence used as an exampe above. Because of the AM, the encoder will weight the preposition “on” (processed by the previous encoder) more than the article “the” which refers to the subject “cat”.

Bidirectional Encoder Representations from Transformers (BERT)

Transformer.

The transformer is a coder endowed with the AM layer. Transformers have been observed to work much better than the basic encoder-decoder sequences.

BERT is a sequence of encoder-type transformers which was pre-trained to predict a word or sentence (i.e. used as decoder). The benefit of improved performance of Transformers comes at a cost: the loss of bidirectionality , which is the ability to predict both next word and the previous one. BERT is the solution to this problem, a Tranformer which preserves biderectionality .

The first token is not “START”. In order to use BERT as a pre-trained language model for sentence-classification, we need to input the BERT prediction of “CLS” into a linear regression because

  • the model has been trained to predict the next sentence, not just the next word;
  • the semantic information of the sentence is encoded in the prediction output of “CLS” as a document vector of 512 elements.

nltk movie reviews dataset

  • bert_final_data
  • https://www.kaggle.com/dataset/5f1193b4685a6e3aa8b72fa3fdc427d18c3568c66734d60cf8f79f2607551a38
  • https://www.kaggle.com/dataset/9850d2e4b7d095e2b723457263fbef547437b159e3eb7ed6dc2e88c7869fca0b
  • Bert-For-Tf2
  • Google github repository
  • BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
  • A Visual Guide to Using BERT for the First Time
  • Machine Translation(Encoder-Decoder Model)!
  • The Illustarted Tranformers
  • The Illustrated BERT, ELMo, and co. (How NLP Cracked Transfer Learning)
  • BERT Explained: State of the art language model for NLP
  • Learning Word Vectors for Sentiment Analysis .

Documentation

NLTK Documentation

  • API Reference
  • Example Usage
  • Module Index
  • Open Issues
  • NLTK on GitHub

Installation

  • Installing NLTK
  • Installing NLTK Data
  • Release Notes
  • Contributing to NLTK

Source code for nltk.corpus.reader.reviews

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications

Abhishek700366/Sentiment-Analysis-NLP

Folders and files, repository files navigation.

Objective 2.1) “This report aims to use the NLP techniques including chunking, NER, tokenization, and stopwords removal to have the sentiment analysis on the IMDb dataset.” (KEYWORDS USED: IMDb, NLP, Chunking, NER, Tokenization, Stopwords removal, Sentiment analysis, Dataset)

2.2) “The primary objective of the report is to showcase the impact of comprehensive preprocessing towards improving the accuracy and effectiveness of sentiment classification models made for analyzing movie reviews. Added to the preprocessing, the report also includes EDA, Basic NLTK, Vader Sentimental Analysis” (KEYWORDS USED: Preprocessing, Accuracy, Effectiveness, Sentiment classification models, Movie reviews, EDA, Basic NLTK, Vader Sentiment Analysis)

2.3) “The report also seeks to provide insights highlighting the importance of cleaning the dataset and preprocessing, while utilizing the machine learning algorithms in the realm of the NLP and refining the feature sets for sentiment analysis.”

(KEYWORDS USED: Cleaning, Preprocessing, Machine learning algorithms, NLP, Feature sets, Sentiment analysis)

2.4) “I submit this report, in hopes of using this preprocessed dataset for further projects, if not research pertaining with implications for broader applications in understanding and interpreting textual sentiments.”

(KEYWORDS USED: Report submission, Preprocessed dataset, Further projects, Research, Implications, Broader applications, Understanding, Interpreting, Textual sentiments)

About the dataset

The dataset utilized in the project is on the infamous Internet Movie Database (IMDb), an online repository of information related to various sitcoms, movies, series, and even video games. According to several critics and customers of their own, IMDb is said to be the authoritative and the largest internet platform that supports several user-generated content, and reviews from critics and also celebrates an inclusive and diverse perspective on a vast array of public and media.

The dataset extracted that is used in the project, is sourced from Kaggle and consists of quite a substantial movie and series reviews, accompanied by a label indicating whether or not the reviews by the user are positive or negative. The purpose of my choosing this dataset despite the volume of rows in the same is due to its contribution to providing a varied and equal collection of textual data and to understand how the data can be trained and the machine learning models can be evaluated over the same. The dataset is a clear reflection of real-world movie sentiments, however, the names of the movies are not included in the dataset, capturing the nuances of an individual’s choice of words to communicate their feelings and viewpoints. It is a given that IMDb’s prominence and diversity of its user-contributed reviews make the dataset one of a kind and particularly advantageous in the field of sentiment analysis

  • Jupyter Notebook 100.0%

IMAGES

  1. Python

    nltk movie reviews dataset

  2. GitHub

    nltk movie reviews dataset

  3. Data exploration

    nltk movie reviews dataset

  4. Use NLTK to classify sentiments in movie reviews

    nltk movie reviews dataset

  5. 29 Python NLTK Text Classification Sentiment Analysis movie reviews

    nltk movie reviews dataset

  6. GitHub

    nltk movie reviews dataset

VIDEO

  1. Misha's Cyberbully song but I have just enough room to say bee movie

  2. Same Person

  3. 🏆🥇🥺✌️motivation#shorts #freefire #decorbhai

  4. Ethirneechal

  5. Anushka comedy video #trending shorts #viralshort2024 #viral trend 2024 #trending #instagram

  6. Actor Suhas Great Words About Naga Chaitanya Attitude

COMMENTS

  1. Sentiment Analysis of Movie Reviews in NLTK Python

    We would be working on the 'movie_reviews' dataset in ntlk.corpus package. ... # all_words is a dictionary which contains the frequency of words in 'movie_reviews' all_words = nltk ...

  2. Classification using movie review corpus in NLTK/Python

    The fact that you have fic/11.txt suggests that you're using some older version of the NLTK or NLTK corpora. Normally the fileids in movie_reviews, starts with either pos / neg then a slash then the filename and finally .txt , e.g. pos/cv001_18431.txt. So I think, maybe you should redownload the files with: $ python.

  3. iiakshat/Sentiment-Analysis-using-NLTK

    This project is about performing Sentiment Analysis on the "IMDB 50K movie reviews" dataset using the Natural Language Toolkit (NLTK) library. By analyzing movie reviews and classifying them as positive or negative sentiments, you can gain valuable insights into audience reactions, user preferences, and overall sentiments towards movies. - iiakshat/Sentiment-Analysis-using-NLTK

  4. Analyzing Movie Review Sentiments with Python, NLTK, and ...

    Here's how you can perform full POS tagging on movie reviews: import nltk from nltk import pos_tag, ... Let's load the movie reviews dataset, perform full POS tagging, calculate sentiment ...

  5. The Movie Reviews dataset. The dataset is imported from the NLTK libray

    The Movie Reviews dataset. The dataset is imported from the NLTK libray. It has 1000 positive and 1000 negative reviews. I have first imported the dataset into a pandas data frame which makes it easier to do the processing. The next step is to analyze the (+) and ( - ) reviews. I have also preprocessed the dataset using Lemmatizing and other standard NLP techniques.

  6. Movie Reviews (Text) Classification Using NLTK

    This post will give you a code walkthrough (Suitable for beginners in NLP) of a text classification example using movie reviews corpus from NLTK Library. Since it is a coding example and not much theory included, I recommend to copy the code step by step to your Jupyter notebook or Colab and run it parallelly for better understanding. Steps.

  7. Use Sentiment Analysis With Python to Classify Movie Reviews

    Explore different ways to pass in new reviews to generate predictions. Parametrize options such as where to save and load trained models, whether to skip training or train a new model, and so on. This project uses the Large Movie Review Dataset, which is maintained by Andrew Maas. Thanks to Andrew for making this curated dataset widely ...

  8. Decoding Emotions: Unveiling Sentiments in IMDb Movie Reviews with NLTK

    In this article, we demonstrated how to perform sentiment analysis on the IMDb Movie Reviews dataset using NLTK's SentimentIntensityAnalyzer. By leveraging NLTK's tools and resources, we were able to quickly analyze the sentiment of the movie reviews. The SentimentIntensityAnalyzer provided sentiment scores, allowing us to categorize each ...

  9. aalind0/Movie_Reviews-Sentiment_Analysis

    An analysis of the movie_review data set included in the nltk corpus. What is in this repo. An implementation of nltk.NaiveBayesClassifier trained against 5000 movie reviews. Implemented in NLTK_Naive_Bayes.py. Using sklearn. Naive Bayes: MultinomialNB: BernoulliNB: Linear Model. LogisticRegression: SGDClassifier: SVM.

  10. Analyzing Movie Reviews Sentiment

    The nltk package offers a wide range of stemmers like the PorterStemmer and LancasterStemmer. Lemmatization is very similar to stemming, where we remove word affixes to get to the base form of a word. ... This case-study oriented chapter introduces the IMDb movie review dataset with the objective of predicting the sentiment of the reviews based ...

  11. NLTK :: Sample usage for corpus

    To access a full copy of a corpus for which the NLTK data distribution only provides a sample. To access a corpus using a customized corpus reader (e.g., with a customized tokenizer). To create a new corpus reader, you will first need to look up the signature for that corpus reader's constructor.

  12. Python NLTK: Sentiment Analysis on Movie Reviews [Natural Language

    Creating Train and Test Dataset. In this example, we use the first 400 elements of the feature set array as a test set and the rest of the data as a train set. Generally, 80/20 percent is a fair split between training and testing set, i.e. 80 percent training set and 20 percent testing set. ... from nltk.corpus import movie_reviews pos_reviews ...

  13. Movie Reviews

    Sentiment Polarity Dataset Version 2.0. Sentiment Polarity Dataset Version 2.0. code. New Notebook. table_chart. New Dataset. tenancy. New Model. emoji_events. New Competition. corporate_fare. New Organization. No Active Events. Create notebooks and keep track of their status here. add New Notebook. auto_awesome_motion. 0 Active Events.

  14. Sentiment Analysis: First Steps With Python's NLTK Library

    movie_reviews: Two thousand movie reviews categorized by Bo Pang and Lillian Lee; averaged_perceptron_tagger: A data model that NLTK uses to categorize words into their part of speech; vader_lexicon: A scored list of words and jargon that NLTK references when performing sentiment analysis, created by C.J. Hutto and Eric Gilbert

  15. Sentiment Analysis on Movie Reviews: A Comparative Analysis

    The results obtained show that sentimental analysis for movie reviews using ensemble models has higher accuracy when compared to other models. The dataset used for experimentation is the NLTK dataset for sentiment analysis of movie reviews. Published in: 2023 International Conference on Intelligent Systems for Communication, IoT and Security ...

  16. (PDF) Movies Reviews Sentiment Analysis and Classification

    In NLTK [20], word tokenization is a wrapper func tion . ... (Bidirectional Encoder Representations from Transformers). IMDb movie reviews dataset is preprocessed, cleaned, and tokenized, followed ...

  17. PDF Sentiment Analysis on Movie Review Using Deep Learning RNN ...

    (NLTK) ·Recurrent neural ... (NB) algorithm for detecting sentiment from movie review dataset, and proved that NB obtained higher accuracy than linear SVM. The IMDB dataset consists of two different data, one is binary-labeled data and another one is multiclass-labeled data as discussed in [9]. They had performed skip-

  18. Sentiment Analysis on movie review data set using NLTK, Sci-Kit learner

    Sentiment Analysis on movie review data set using NLTK, Sci-Kit learner and some of the Weka classifiers. Goal- To predict the sentiments of reviews using basic classification algorithms and compare the results by varying different parameters.

  19. Sentiment Classification on the Large Movie Review Dataset

    The dataset contains movie reviews along with their associated binary sentiment polarity labels. The core dataset contains 50,000 reviews split evenly into 25k train and 25k test sets. The overall distribution of labels is balanced (25k pos and 25k neg). 50,000 unlabeled documents for unsupervised learning are included, but they won't be used.

  20. Classification using NLTK corpus of movie reviews

    I'm first trying the existing NLTK movie-review corpus. However, if I'm using this code: import string from itertools import chain from nltk.corpus import movie_reviews as mr from nltk.corpus import stopwords from nltk.probability import FreqDist from nltk.classify import NaiveBayesClassifier as nbc import nltk stop = stopwords.words('english ...

  21. Sentiment Analysis of IMDB Movie Reviews

    Explore and run machine learning code with Kaggle Notebooks | Using data from IMDB Dataset of 50K Movie Reviews. code. New Notebook. table_chart. New Dataset. tenancy. New Model. emoji_events. New Competition. corporate_fare. New Organization. No Active Events. Create notebooks and keep track of their status here. add New Notebook. auto_awesome ...

  22. IMDB Dataset of 50K Movie Reviews

    About Dataset. IMDB dataset having 50K movie reviews for natural language processing or Text analytics. This is a dataset for binary sentiment classification containing substantially more data than previous benchmark datasets. We provide a set of 25,000 highly polar movie reviews for training and 25,000 for testing.

  23. NLTK :: nltk.corpus.reader.reviews

    class ReviewLine: """ A ReviewLine represents a sentence of the review, together with (optional) annotations of its features and notes about the reviewed item.

  24. GitHub

    Objective 2.1) "This report aims to use the NLP techniques including chunking, NER, tokenization, and stopwords removal to have the sentiment analysis on the IMDb dataset." (KEYWORDS USED: IMDb, NLP, Chunking, NER, Tokenization, Stopwords removal, Sentiment analysis, Dataset). 2.2) "The primary objective of the report is to showcase the impact of comprehensive preprocessing towards ...