Sentiment Analysis of Twitter Data: A Survey of Techniques: Vishal A. Kharde S.S. Sonawane
Sentiment Analysis of Twitter Data: A Survey of Techniques: Vishal A. Kharde S.S. Sonawane
Sentiment Analysis of Twitter Data: A Survey of Techniques: Vishal A. Kharde S.S. Sonawane
5
International Journal of Computer Applications (0975 – 8887)
Volume 139 – No.11, April 2016
Mathematically we can represent an opinion as a quintuple classes. They experimented with models such as: unigram
(o, f, so, h, t), where model, a feature based model and a tree kernel based model.
For tree kernel based model they represented tweets as a
o = object; tree.The feature based model uses 100 features and the unigram
f = feature of the object o; model uses over 10,000 features. They arrived on a conclusion
that features which combine prior polarity of words with their
so= orientation or polarity of the opinion on feature f of object parts-of-speech(pos) tags are most important and plays a major
o; rolein the classification task. The tree kernel based model
h = opinion holder; outperformed the other two models.
t = time when the opinion is expressed. Davidov et al.,(2010) [7] proposed a approach to utilize Twitter
user-defined hastags in tweets as a classification of sentiment
Object:An entity which can be a, person, event, product type using punctuation, single words, n-grams and patterns as
,organization, or topic different feature types, which are then combined into a single
feature vector for sentiment classification. They made use of
Feature:An attribute (or a part) of the object with respect to
K-Nearest Neighbor strategy to assign sentiment labels by
which evaluation is made.
constructing a feature vector for each example in the training
Opinion orientation or polarity:The orientation of an opinion and test set.
on a feature f represent whether the opinion is positive,
Po-Wei Liang et.al.(2014) [8] used Twitter API to collect
negative or neutral .
twitter data. Their training data falls in three different
Opinion holder: The holder of an opinion is the person or categories (camera, movie , mobile). The data is labeled as
organization or an entitythat expresses the opinion . positive, negative and non-opinions. Tweets containing
opinions were filtered. Unigram Naive Bayes model was
In recent years a lot of work has been done in the field of implemented and the Naive Bayes simplifying independence
“Sentiment Analysis on Twitter“ by number of researchers. In assumption was employed. They also eliminated useless
its early stage it was intended for binary classification which features by using the Mutual Information and Chi square
assigns opinions or reviews to bipolar classes such as positive feature extraction method. Finally , the orientation of an tweet
or negative only. is predicted. i.e. positive or negative.
Pak and Paroubek(2010) [1] proposed a model to classify the Pablo et. al. [9] presented variations of Naive Bayes classifiers
tweets as objective, positive and negative. They created a for detecting polarity of English tweets. Two different variants
twitter corpus by collecting tweets using Twitter API and of Naive Bayes classifiers were built namely Baseline (trained
automatically annotating those tweets using emoticons. Using to classify tweets as positive, negative and neutral), and Binary
that corpus, theydeveloped a sentiment classifier based on the (makes use of a polarity lexicon and classifies as positive and
multinomial Naive Bayes method that uses features like N- negative. Neutral tweets neglected). The features considered by
gram and POS-tags. The training set they used was less classifiers were Lemmas (nouns, verbs, adjectives and
efficient since it contains only tweets having emoticons. adverbs), Polarity Lexicons, and Multiword from different
Parikh and Movassate(2009) [2] implemented two models, a sources and Valence Shifters.
Naive Bayes bigram model and a Maximum Entropy model to Turney et al [11] used bag-of-words method for sentiment
classify tweets. They found that the Naive Bayes classifiers analysis in which the relationships between words was not at
worked much better than the Maximum Entropy model. all considered and a document is represented as just a
Go and L.Huang (2009) [3] proposed a solution for sentiment collection of words. To determine the sentiment for the whole
analysis for twitter data by using distant supervision, in which document, sentiments of every word was determined and those
their training data consisted of tweets with emoticons which values are united with some aggregation functions.
served as noisy labels. They build models using Naive Bayes, Kamps et al. [12] used the lexical database WordNet to
MaxEnt and Support Vector Machines (SVM). Their feature determine the emotional content of a word along different
space consisted of unigrams, bigrams and POS. They dimensions. They developed a distance metric on WordNet and
concluded that SVM outperformed other models and that determined semantic polarity of adjectives.
unigram were more effective as features.
Xia et al. [13] used an ensemble framework for Sentiment
Barbosa et al.(2010) [4] designed a two phase automatic Classification which is obtained by combining various feature
sentiment analysis method for classifying tweets. They sets and classification techniques. In thier work, they used two
classified tweets as objective or subjective and then in second types of feature sets (Part-of-speech information and Word-
phase, the subjective tweets were classified as positive or relations) and three base classifiers (Naive Bayes, Maximum
negative. The feature space used included retweets, hashtags, Entropy and Support Vector Machines) . They applied
link, punctuation and exclamation marks in conjunction with ensemble approaches like fixed combination, weighted
features like prior polarity of words and POS. combination and Meta-classifier combination for sentiment
Bifet and Frank(2010) [5] used Twitter streaming data classification and obtained better accuracy.
provided by Firehouse API , which gave all messages from Luoet. al. [14] highlighted the challenges and an efficient
every user which are publicly available in real-time. They techniques to mine opinions from Twitter tweets. Spam and
experimented multinomial naive Bayes, stochastic gradient wildly varying language makes opinion retrieval within Twitter
descent, and the Hoeffding tree. They arrived at a conclusion challenging task.
that SGD-based model, when used with an appropriate learning
rate was the better than the rest used. A General model for sentiment analysis is as follows,
Agarwal et al. (2011)[6] developed a 3-way model for
classifying sentiment into positive, negative and neutral
6
International Journal of Computer Applications (0975 – 8887)
Volume 139 – No.11, April 2016
Remove all URLs (e.g. www.xyz.com), hash tags (e.g. Machine learning techniques require representing the key
#topic), targets (@username) features of text or documents for processing. These key
features are c o n s i d e r e d as feature vectors which are used
Correct the spellings; sequence of repeated characters is to for the classification task..Some examples features that have
be handled been reported in literature are:
Replace all the emoticons with their sentiment. 1. Words And Their Frequencies:
Remove all punctuations ,symbols, numbers Unigrams, bigrams and n-gram models with their frequency
counts are considered as features. There has been more
Remove Stop Words research on using word presence rather than frequencies to
better describe this feature. Panget al. [23] showed better
Expand Acronyms(we can use a acronym dictionary) results by using presence instead of frequencies.
Remove Non-English Tweets
2. Parts Of Speech Tags
Table 1. Publicly Available Datasets For Twitter Parts of speech like adjectives, adverbs and somegroups of
verbs and nouns are good indicators of subjectivity and
HASH Tweets http://demeter.inf 31,861 Pos sentiment. We can generate syntactic dependency patterns by
.ed.ac.uk tweets 64,850 parsing or dependency trees.
Neg tweets,
125,859 Neu
tweets
3. Opinion Words And Phrases
Apart from specific words, some phrases and idioms which
EMOT Tweets http://twittersenti 230,811 Pos&
convey sentiments can be used as features.
and ment.appspot.co 150,570 Neg
e.g. cost someone an arm and leg.
Emoticons m tweets
ISIEVE Tweets www.i-sieve.com 1,520 Pos
4. Position Of Terms
tweets,200 Neg
The position of a term with in a text can affect on how much
tweets, 2,295
the term makes difference in overall sentiment of the text.
Neu tweets
Columbia Tweets Email: 11,875 tweets
univ.dataset [email protected] 5. Negation
Negation is an important but difficult feature to interpret. The
bia.edu
presence of a negation usually changes the polarity of the
Patient Opinions http://patientopin 2000 patient
opinion..
dataset ion.org.uk opinions
7
International Journal of Computer Applications (0975 – 8887)
Volume 139 – No.11, April 2016
e.g., I am not happy. margin reduces indecisive decisions. SVM also supports
classification and regression which are useful for statistical
6. Syntax learning theory and it also helps recognizing the factors
Syntactic patterns like collocations are used as features to precisely, that needs to be taken into account, to understand it
learn subjectivity patterns by many of the researchers. successfully.
c
exp[ i fi (c, d )] Negations
i Opinion words and phrases
Where c is the class,d is the tweet and λiis the weight
vector.The weight vectors decide the importance of a feature in
classification.
8
International Journal of Computer Applications (0975 – 8887)
Volume 139 – No.11, April 2016
3.2.2. Corpus-Based:
The corpus-based approach have objective of providing
dictionaries related to a specific domain. These dictionaries are
generated from a set of seed opinion terms that grows through
the search of related words by means of the use of either
statistical or semantic techniques.
Methods based on statistics: Latent Semantic
Analysis (LSA).
Methods based on semantic such as the use of
synonyms and antonyms or relationships from
thesaurus like WordNet may also represent an
interesting solution.
According to the performance measures like precision and
recall, we provide a comparative study of existing techniques
for opinion mining, including machine learning, lexicon-based
Fig.2 Sentiment Classification Based On Emoticons approaches, cross domain and cross-lingual approaches, etc., as
shown in Table 2.
With respect to supervised techniques, support vector machines
(SVM), Naive Bayes, Maximum Entropy are some of the most
Table 2. Performance Comparison Of Sentiment Analysis
common techniques used.
Methods
Whereas semi-supervised and unsupervised techniques are
Method Data Set Acc. Author
proposed when it is not possible to have an initial set of labeled
documents/opinions to classify the rest of items
Machine SVM Movie 86.40% Pang,
3.2 Lexicon-Based Approaches Learning reviews Lee[23]
Lexicon based method [20] uses sentiment dictionary with
opinion words and match them with the data to determine CoTraining Twitter 82.52% Liu[14]
polarity. They assigns sentiment scores to the opinion SVM
words describing how Positive, Negative and Objective the Stanford
words contained in the dictionary are. Deep Sentimen 80.70% Richard[18]
learning t
Lexicon-based approaches mainly rely on a sentiment Treebank
lexicon, i.e., a collection of known and precompiled sentiment Lexical Product Turkey
terms, phrases and even idioms, developed for traditional based Corpus reviews 74.00%
genres of communication, such as the Opinion Finder lexicon;
Amazon‟ --- Taboada[20]
Dictionary s
Mechani
cal Turk
Ensemble Amazon 81.00% Wan,X[16]
Cross-
lingual Co-Train Amazon, 81.30% Wan,X.[16]
ITI68
IMDb >90% Abbasi,A.
EWGA movie
review
CLMM MPQA,N 83.02% Mengi
TCIR,ISI
Active Book, 80% Li, S
Cross- Learning DVD, (avg)
domain Electroni Bollegala[22
Fig 3.Lexicon-Based Model cs,
Thesaurus ]
There are Two sub classifications for this approach: SFA Kitchen Pan S J[15]
3.2.1.Dictionary-based:
It is based on the usage of terms (seeds) that are usually 4. SENTIMENT ANALYSIS TASKS
collected and annotated manually. This set grows by searching Sentiment analysis is a challenging interdisciplinary task
the synonyms and antonyms of a dictionary. An example of which includes natural language processing, web mining and
that dictionary is WordNet, which is used to develop a machine learning. It is a complex task and can be decomposed
thesaurus called SentiWordNet. into following tasks, viz:
Drawback : Can‟t deal with domain and context specific
orientations. Subjectivity Classification
Sentiment Classification
9
International Journal of Computer Applications (0975 – 8887)
Volume 139 – No.11, April 2016
Complimentary Tasks
5.1 Document level
o ObjectHolderExtraction It deals with tagging individual documents with their
o Object/Feature Extraction sentiment. In Document level the whole document is classify
eitherinto positive or negative class.
General Approach:
Find the sentiment polarities of individual sentences or words
and combine them together to find the polarity of the
document.
Other approaches:
Complex linguistic phenomena like co-reference resolution,
pragmatics, etc.
Various Tasks involved in this are:
10
International Journal of Computer Applications (0975 – 8887)
Volume 139 – No.11, April 2016
11
International Journal of Computer Applications (0975 – 8887)
Volume 139 – No.11, April 2016
12
International Journal of Computer Applications (0975 – 8887)
Volume 139 – No.11, April 2016
Table 8. Accuracy of Naïve Bayes Algorithm accuracy consistently in-between NaiveBayes and SVM.
Also it runs iteratively and takes a large amount of time to
Algorithm Accuracy run. Hence MaxEnt was not used for all the feature
Naïve Bayes (unigram) 74.56 combinations.
Naïve Bayes (bigram) 76.44
Naïve Bayes (trigram) 75.41 Table 11. Summary Of Results For Unigram
Method Accuracy(Unigram)
C. Support Vector Machine (SVM): Baseline 73.65
Effect using unigram
Naïve Bayes 74.56
Following table shows the accuracy obtained at different sizes
SVM 76.68
for the SVM algorithm with unigram model.
Maximum Entropy 74.93
Table 9. Accuracy of SVM Algorithm (Unigram)
As the table shows, when the processing, analysis was done on
Dataset Accuracy the bigger dataset, the accuracy scaled upto a great extent.
10 0.525450571021 NaiveBayes baseline scaled upto 76.44 and SVM scaled upto
50 0.550521948608 77.73percent.The best result tested thus far, was obtained
100 0.569726980728 when SVM was used on a feature set of a combination of
500 0.6261375803 Unigram, Bigram with stopwords removal, gave an accuracy of
1000 0.660421127766 77.73. MaxEnt also performed well and gave an accuracy of
5000 0.726222341185 74.93when stopwords was removed.
10000 0.739806388294
15000 0.748973947181
20000 0.75426034975
25000 0.758096895075
30000 0.76130888651
35000 0.762847965739
40000 0.76556923626
45000 0.766862955032
13
International Journal of Computer Applications (0975 – 8887)
Volume 139 – No.11, April 2016
6. Order dependence: It has been observed that people nowadays tend to look upon
Discourse Structure analysis is essential for Sentiment reviews of products which are available online before they buy
Analysis/Opinion Mining. them. And for many businesses, the online opinion decides the
Example: success or failure of their product. Thus, Sentiment Analysis
A is better than B, conveys the exact opposite opinion from, B plays an important role in businesses. Businesses also wish to
is better than A. extract sentiment from the online reviews in order to improve
their products and in turn their reputation and help in customer
7. Entity Recognition: satisfaction .
There is a need to separate out the text about a specific entity 4. Applications across Domains:
and then analyze sentiment towards it.
Recentresearches in sociology and other fields like medical,
Example: sports have also been benefitted by Sentiment Analysis that
“I hate Microsoft, but I like Linux”. show trends in human emotions especially on social media.
14
International Journal of Computer Applications (0975 – 8887)
Volume 139 – No.11, April 2016
accuracy as compared to other models. We can focus on the [12] J. Kamps, M. Marx, R. J. Mokken, and M. De Rijke,
study of combining machine learning method into opinion “Using wordnet to measure semantic orientations of
lexicon method in order to improve the accuracy of sentiment adjectives,” 2004.
classification and adaptive capacity to variety of domains and
different languages. [13] R. Xia, C. Zong, and S. Li, “Ensemble of feature sets and
classification algorithms for sentiment classification,”
11. REFERENCES Information Sciences: an International Journal, vol. 181,
[1] A.Pak and P. Paroubek. „Twitter as a Corpus for Sentiment no. 6, pp. 1138–1152, 2011.
Analysis and Opinion Mining". In Proceedings of the [14] ZhunchenLuo, Miles Osborne, TingWang, An effective
Seventh Conference on International Language Resources approachto tweets opinion retrieval", Springer Journal
and Evaluation, 2010, pp.1320-1326 onWorldWideWeb,Dec 2013, DOI: 10.1007/s11280-013-
[2] R. Parikh and M. Movassate, “Sentiment Analysis of 0268-7.
User- GeneratedTwitter Updates using Various [15] Liu, S., Li, F., Li, F., Cheng, X., &Shen, H.. Adaptive co-
Classi_cation Techniques",CS224N Final Report, 2009 training SVM for sentiment classification on tweets. In
[3] Go, R. Bhayani, L.Huang. “Twitter Sentiment Proceedings of the 22nd ACMinternational conference on
ClassificationUsing Distant Supervision". Stanford Conference on information & knowledgemanagement (pp.
University, Technical Paper,2009 2079-2088). ACM,2013.
[4] L. Barbosa, J. Feng. “Robust Sentiment Detection on [16] Pan S J, Ni X, Sun J T, et al. “Cross-domain sentiment
Twitterfrom Biased and Noisy Data". COLING 2010: classification viaspectral feature alignment”. Proceedings
Poster Volume,pp. 36-44. of the 19th internationalconference on World wide web.
ACM, 2010: 751-760.
[5] Bifet and E. Frank, "Sentiment Knowledge Discovery
inTwitter Streaming Data", In Proceedings of the 13th [17] Wan, X..“A Comparative Study of Cross-Lingual
InternationalConference on Discovery Science, Berlin, SentimentClassification”. In Proceedings of the The 2012
Germany: Springer,2010, pp. 1-15. IEEE/WIC/ACMInternational Joint Conferences on Web
Intelligence and IntelligentAgent Technology-Volume 01
[6] Agarwal, B. Xie, I. Vovsha, O. Rambow, R. Passonneau, (pp. 24-31).IEEE Computer Society.2012
“Sentiment Analysis of Twitter Data", In Proceedings of
the ACL 2011Workshop on Languages in Social [18] Socher, Richard, et al. "Recursive deep models for
Media,2011 , pp. 30-38 semanticcompositionality over a sentiment Treebank."
Proceedings of theConference on Empirical Methods in
[7] Dmitry Davidov, Ari Rappoport." Enhanced Sentiment Natural Language Processing(EMNLP). 2013.
Learning Using Twitter Hashtags and Smileys". Coling
2010: Poster Volumepages 241{249, Beijing, August [19] Meng, Xinfan, et al. "Cross-lingual mixture model for
2010 sentimentclassification." Proceedings of the 50th Annual
Meeting of theAssociation for Computational Linguistics
[8] Po-Wei Liang, Bi-Ru Dai, “Opinion Mining on Social Volume 1,2012
MediaData", IEEE 14th International Conference on
Mobile Data Management,Milan, Italy, June 3 - 6, 2013, [20] Taboada, M., Brooke, J., Tofiloski, M., Voll, K., &Stede,
pp 91-96, ISBN: 978-1-494673-6068-5, M..“Lexicon basedmethods for sentiment analysis”.
http://doi.ieeecomputersociety.org/10.1109/MDM.2013. Computational linguistics, 2011:37(2), 267-307.
[9] Pablo Gamallo, Marcos Garcia, “Citius: A Naive-Bayes [21] Li, S., Xue, Y., Wang, Z., & Zhou, G..“Active learning for
Strategyfor Sentiment Analysis on English Tweets", 8th cross-domainsentiment classification”. In Proceedings of
InternationalWorkshop on Semantic Evaluation (SemEval the Twenty-Thirdinternational joint conference on
2014), Dublin, Ireland,Aug 23-24 2014, pp 171-175. Artificial Intelligence (pp. 2127-2133).AAAI Press,2013
[10] Neethu M,S and Rajashree R,” Sentiment Analysis in [22] Bollegala, D., Weir, D., & Carroll, J.. Cross-Domain
Twitter using Machine Learning Techniques” 4th SentimentClassification using a Sentiment Sensitive
ICCCNT 2013,at Tiruchengode, India. IEEE – 31661 Thesaurus. Knowledge andData Engineering, IEEE
Transactions on, 25(8), 1719-1731,2013
[11] P. D. Turney, “Thumbs up or thumbs down?: semantic
orientation applied to unsupervised classification of [23] Pang, B.and Lee, L. “A sentimental education: Sentiment
reviews,” in Proceedings of the 40th annual meeting on analysis using subjectivity summarization based on
association for computational linguistics, pp. 417–424, minimum cuts”. 42nd Meeting of the Association for
Association for Computational Linguistics, 2002. Computational Linguistics[C] (ACL-04). 2004, 271-278.
[24] V. M. K. Peddinti and P. Chintalapoodi, “Domain
adaptation in sentiment analysis of twitter,” in Analyzing
Microtext Workshop, AAAI, 2011.
IJCATM : www.ijcaonline.org 15