39 - Sentiment Analysis of Movie Reviews and Blog Posts
39 - Sentiment Analysis of Movie Reviews and Blog Posts
Abstract—This paper presents our experimental work on for harnessing collective intelligence [1]. For example, a
performance evaluation of the SentiWordNet approach for user looking for a hotel in a particular tourist city may
document-level sentiment classification of Movie reviews prefer to go through the reviews of available hotels in the
and Blog posts. We have implemented SentiWordNet city before making a decision to book in one of them. Or a
approach with different variations of linguistic features, user willing to buy a particular model of digital camera
scoring schemes and aggregation thresholds. We used two may first look at reviews posted by many other users
pre-existing large datasets of Movie Reviews and two Blog about that camera before making a buying decision. This
post datasets on revolutionary changes in Libya and not only helps in allowing the user to get more and
Tunisia. We have computed sentiment polarity and also its relevant information about different products and services
strength for both movie reviews and blog posts. The paper on a mouse click, but also helps in arriving at a more
also presents an evaluative account of performance of the informed decision. Sometimes users prefer to write their
SentiWordNet approach with two popular machine learning experiences about a product or service as form of a blog
approaches: Naïve Bayes and SVM for sentiment post rather than an explicit review. However, in both case
classification. The comparative performance of the the data is basically textual.
approaches for both movie reviews and blog posts is
illustrated through standard performance evaluation
Popular sites like carwale.com, imdb.com are now full
metrics of Accuracy, F-measure and Entropy. of user reviews, in this case reviews of cars and movies
respectively. And the users writing on these sites are a
Keywords: Sentiment Analysis, SentiWordNet, Blog diverse group, ranging persons who recently bought a
Sentiment, Machine Learning Classifiers. product or used a service to those who are regular at them.
A look at the Internet movie database website
I. INTRODUCTION (www.imdb.com) will definitely show how useful it could
be when a person is interested about movies, produced
According to a recent statistics by the Social Media and released in virtually any part of the World. Similarly
tracking company Technorati, four out of every five users the posts on blog sites reflect opinion of a large number of
of Internet use social media in some form. This includes users. A blog post however is relatively a difficult source
friendship networks, blogging and micro-blogging sites, for sentiment analysis, as it often does not contain explicit
content and video sharing sites etc. It is worth observing statements that can be harnessed for sentiment. Many
that the World Wide Web (here after referred only as times they do contain more factual or episodic information
Web) has now completely transformed into a more and are not opinionated to the desired extent. However,
participative and co-creative Web. It allows a large they still constitute a tremendous source of user opinions
number of users to contribute in a variety of forms. The and views and should be harnessed for sentiment oriented
fact is that even those who are virtually novice to the and other useful analysis.
technicalities of the Web publishing are creating content
on the Web. In fact the value of a Website is now Though these reviews and posts are beyond doubt very
determined largely by its user base, which in turn decides useful and valuable, but at the same time it is also quite
the amount of data available on it. It may perhaps be true difficult for a new user (or a prospective customer) to read
to say that Data is the new Intel inside. all the reviews/ posts in a short span of time. Fortunately
we have a solution to this information overload problem
One such interesting form of user contributions on the which can present a comprehensive summary result out of
Web is reviews. Many sites on the Web allow users to a large number of reviews. The new IR formulations,
write their experiences or opinion about a product or popularly called sentiment classifiers, now not only allow
service in form of a review. The Web is now full of user- to automatically label a review as positive or negative, but
reviews for different items ranging from mobile phones, to extract and highlight positive and negative aspects of a
holiday trips, and hotel services to movie reviews etc. It is product/ service. Sentiment analysis is now an important
interesting to observe that these reviews not only express part of IR based formulations in a variety of domains. It is
opinions of a group of users but is also a valuable source traditionally used for automatic extraction of opinions
978-1-4673-4529-3/12/$31.00 2012
c IEEE 893
types about a product and for highlighting positive or terms of the text should be extracted, and (b) how to
negative aspects/ features of a product. Recently we have combine/ aggregate the individual sentiment values
seen use of sentiment analysis for opinion based clustering obtained from the library for the extracted terms so as to
of text-documents and for providing better and more arrive at a final sentiment label for the whole document.
focused recommendations by a recommender system [2], We have explored with different linguistic features and
[3]. scoring schemes. Computational Linguists suggest that
adjectives are good markers of opinions. For example, if
II. SENTIMENT ANALYSIS APPROACHES a review sentence says “The movie was excellent”, then
There are primarily three types of approaches for use of adjective ‘excellent’ tells us that the movie was
sentiment classification of opinionated texts: (a) using a liked by the reviewer and possibly he had a wonderful
machine learning based text classifier -such as Naïve experience watching it. Sometimes, Adverbs further
Bayes, SVM or kNN; (b) using Semantic Orientation modify the opinion expressed in review sentences. For
scheme of extracting relevant n-grams of the text and then example, the sentence “The movie was extremely good”
labeling them either as positive or negative and expresses a more positive opinion about the movie than
consequentially the document; and (c) using the the sentence “the movie was good”. We have therefore
SentiWordNet based publicly available library that explored with two linguistic feature selection schemes. In
provides positive, negative and neutral scores for words. one we only extract ‘adjectives’ and in the other one we
Some of the relevant past works on sentiment extract both ‘adjectives’ and ‘adverbs’. Though adverbs
classification can be found in [4], [5], [6], [7], [8], [9], are of various kinds, but for sentiment classification only
[10], [11], [12] and [13]. adjectives of degree seem useful.
The machine learning based text classifiers are a kind of After deciding for the type of terms to be extracted, the
supervised machine learning paradigm, where the remaining task was to obtain their SentiWordNet scores.
The SentiWordNet Version 3.0 gives us a sentiment
classifier needs to be trained on some labeled training data
polarity value between ‘-1’ to ‘+1’ for every term that we
before it can be applied to actual classification task. The extract and use for look up. A value towards ‘+1’ denotes
training data is usually an extracted portion of the original that the term is an indicator of positivity and a value
data hand labeled manually. After suitable training they towards ‘-1’ indicates that it is an indicator of negativity.
can be used on the actual test data. The Naïve Bayes is a After we obtain the sentiment value for all extracted
statistical classifier whereas SVM is a kind of vector space terms in a particular text document, we have to aggregate
classifier. The statistical text classifier scheme of Naïve all these scores to obtain a sentiment score for the whole
Bayes (NB) can be adapted to be used for sentiment text document. In order to find this score we aggregated
classification problem as it can be visualized as a 2-class the values for positive terms and negative terms of a text
text classification problem: in positive and negative document separately to obtain a ‘positivity score’ and
classes. A more detailed description can be found in [14]. ‘negativity score’ for the document. The magnitude of
Support Vector machine (SVM) is a kind of vector space these two values is then compared and whichever score is
model based classifier which requires that the text higher, determines the sentiment polarity of the whole
documents should be transformed to feature vectors before document. An indicative pseudo-code denoting the key
they are used for classification. Usually the text steps for computing the Sentiment scores, aggregating
documents are transformed to multidimensional tf.idf them and computing polarity strength for ‘adjective only’
vectors. The entire problem of classification is then scheme is illustrated below.
classifying every text document represented as a vector
into a particular class. It is a type of large margin • Extract the adj from text doc.
classifier. Here the goal is to find a decision boundary • For all extracted adj
between two classes that is maximally far from any o Senti_Score=SWN_Score(adj)
document in the training data. We have implemented o If a ‘NOT’ precedes the adj
Naïve Bayes algorithm as JAVA code and used Sequential Senti_Score = - (Senti_Score)
Minimal Optimizer (SMO) available in weka [15] for o If Senti_Score>0 then
implementing SVM. These two methods were Pos_Score+=Senti_Score
implemented originally in [16], and we used them here to o Else
compare their performance vis-à-vis SentiWordNet Neg_Score-=(-Senti_Score)
implementations described here.
• If Pos_Score>Neg_Score then
III. SENTIWORDNET Sentiment=Postive
Else
The SentiWordNet approach utilizes the publicly
available library of SentiWordNet [17], which provides a Sentiment=Negative
sentiment polarity values for every term occurring in the • Compute Polarity Strength
document. In this lexical resource each term t occurring o Polarity_Strength=Pos_Score-
in WordNet is associated to three numerical scores obj(t), Neg_Score
pos(t) and neg(t), describing the objective, positive and
negative polarities of the term, respectively. These three In the pseudo-code above, only adjectives (denoted as
scores are computed by combining the results produced adj) were extracted. We computed their SentiWordNet
by eight ternary classifiers. To make use of score and then checked for presence of ‘Not’ immediately
SentiWordNet we need to first extract relevant before it. If a ‘Not’ is present the Senti_Score is negated.
opinionated terms and then lookup for their scores in the This was done to incorporate the effect of negated
SentiWordNet. Therefore, the key issues in using expressive words. In the other variant we extracted an
SentiWordNet based approach are to decide: (a) which ‘Adverb+Adjective’ combine rather than only
Dataset
Method
Dataset1 Dataset2 Dataset3 Dataset4
POS 73.3 75.9 67.4 73
SVN-1
NEG 55.3 55.3 62.1 58.9
POS 75.1 75.4 65.5 69.8
SWN-2
NEG 51.3 51 60 57.1
SWN POS 71.3 72.5 66.2 73
(VS) NEG 58.6 57.8 61.8 59.5
SWN POS 72.6 73.8 66.7 74
(APS) NEG 58 58 61.2 59.3
Method
Performance measure Value
Classified Positive 513/700
Dataset1 Fig. 2 F-measure values for the four SentiWordNet schemes.
Classified Negative 387/700
Classified Positive 759/1000
Dataset2
Classified Negative 553/1000
SWN-1
Classified Positive 293/435
Dataset3
Classified Negative 653/1051
Classified Positive 232/318
Dataset4
Classified Negative 288/489
Classified Positive 526/700
Dataset1
Classified Negative 359/700
Classified Positive 754/1000
Dataset2
Classified Negative 510/1000
SWN-2
Classified Positive 285/435
Dataset3
Classified Negative 631/1051
Classified Positive 222/318
Dataset4
Classified Negative 279/489
Classified Positive 499/700
Dataset1
Classified Negative 410/700
Classified Positive 725/1000
Dataset2
Classified Negative 578/1000
SWN (VS)
Classified Positive 288/435
Dataset3
Classified Negative 649/1051
Classified Positive 232/318 Fig. 3 Entropy Values for the four SentiWordNet schemes.
Dataset4
Classified Negative 291/489
Classified Positive 508/700
Dataset1
Classified Negative 406/700
Classified Positive 738/1000
Dataset2
Classified Negative 580/1000
SWN (APS)
Classified Positive 290/435
Dataset3
Classified Negative 643/1051
Classified Positive 235/318
Dataset4
Classified Negative 290/489