Skip to main content

A novel sentiment analysis of social networks using supervised learning


Online microblog-based social networks have been used for expressing public opinions through short messages. Among popular microblogs, Twitter has attracted the attention of several researchers in areas like predicting the consumer brands, democratic electoral events, movie box office, popularity of celebrities, the stock market, etc. Sentiment analysis over a Twitter-based social network offers a fast and efficient way of monitoring the public sentiment. This paper studies the sentiment prediction task over Twitter using machine-learning techniques, with the consideration of Twitter-specific social network structure such as retweet. We also concentrate on finding both direct and extended terms related to the event and thereby understanding its effect. We employed supervised machine-learning techniques such as support vector machines (SVM), Naive Bayes, maximum entropy and artificial neural networks to classify the Twitter data using unigram, bigram and unigram + bigram (hybrid) feature extraction model for the case study of US Presidential Elections 2012 and Karnataka State Assembly Elections (India) 2013. Further, we combined the results of sentiment analysis with the influence factor generated from the retweet count to improve the prediction accuracy of the task. Experimental results demonstrate that SVM outperforms all other classifiers with maximum accuracy of 88 % in predicting the outcome of US Elections 2012, and 68 % for Indian State Assembly Elections 2013.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9











  • Aragón P et al (2013) Communication dynamics in Twitter during political campaigns: the case of the 2011 Spanish national election. Policy & Internet 5(2):183–206. doi:10.1002/1944-2866.POI327

  • Berger AL, Della Pietra VJ, Della Pietra SA (1996) A maximum entropy approach to natural language processing. J Comput Linguist 22(1):39–71

    Google Scholar 

  • Asur S, Huberman B (2010) Predicting the future with social media. In: WI-IAT’10 Proceedings of the 2010 IEEE/WIC/ACM International Conference on web intelligence and intelligent agent technology, vol 01, pp 492–499

  • Boutet A et al (2013) What’s in your tweet: I know who you supported in the UK 2010 general elections. In: Association for the Advancement of Artificial Intelligence

  • Bakliwal A (2013) Sentiment analysis of political tweets: towards an accurate classifier. In: Proceedings of the Workshop on language in social media (LASM 2013), Atlanta, Georgia, pp 49–58

  • Barbosa L, Feng J (2010) Robust sentiment detection on Twitter from biased and noisy data. In: Proceedings of COLING

  • Bermingham A, Smeaton AF (2011) On using Twitter to monitor political sentiment and predict election results. In: Proceedings of the Workshop on sentiment analysis where AI meets psychology (SAAIP), IJCNLP 2011, Chiang Mai, Thailand, pp 2–10

  • Bollen J, Pepe A, Mao H (2011) Modeling public mood and emotion: Twitter sentiment and socioeconomic phenomena. In: Proceedings of the Fifth International AAAI Conference on weblogs and social media (ICWSM 2011), Barcelona, Spain

  • Chen LS, Liu CH, Chiu HJ (2011) A neural network based approach for sentiment classification in the Blogosphere. Elseveir J Inf 5:313–322

    Article  Google Scholar 

  • Cozma R, Chen K (2011) Congressional candidates “use of Twitter during the 2010 Midterm Elections: a wasted opportunity?”. In: 61st Annual Conference of the International communication association

  • Cristianini N, Shawe-Taylor J (2000) An introduction to support vector machines and other kernel-based learning methods. Cambridge University Press, Cambridge

    Book  Google Scholar 

  • Davidiv D, Tsur O, Rappoport A (2010) Enhanced sentiment learning using Twitter hashtags and smileys. In: Proceedings of the 23rd international conference on computational linguistics, 2010, pp 241–249

  • Doshi L (2008) Using sentiment and social network analyses to predict opening-movie box-office success in fulfilment of Master’s degree proceedings at Department of Electrical and Computer Engineering, Massachusetts Institute of Technology

  • Gayo-Avello D, Metaxas PT, Mustafaraj E (2011) Limits of electoral predictions using Twitter. In: International conference on weblogs and social media. IAAA, Barcelona, Spain

  • Go A et al (2010a) Sentiment analysis of Twitter posts about news. Natural language processing. Stanford University

  • Go A et al (2010b) Twitter sentiment classification using distant supervision. Natural language processing. Stanford University

  • Hastie T, Tibshirani R, Friedman J (2001) The elements of statistical learning. Springer, New York

    Book  MATH  Google Scholar 

  • Jiang L et al (2011) Target-dependent Twitter sentiment classification. In: Proceedings of the 49th Annual Meeting of the association for computational linguistics

  • Katakis I et al (2013) Social voting advice applications—definitions, challenges, datasets and evaluation. In: IEEE Transactions on cybernetics

  • Kibriya A et al (2005) Multinomial Naive Bayes for text categorization revisited—AI 2004. Adv Artif Intell Lect Notes Computer Sci 3339:488–499

    MathSciNet  Google Scholar 

  • Livne A, Simmons MP, Adar E, Adamic LA (2011) The party is over here: structure and content in the 2010 election. In: International conference on weblogs and social media. IAAA, Barcelona, Spain

  • Meeyoung C et al (2010) Measuring user influence in Twitter: the million follower fallacy. In: Fourth International AAAI Conference on weblogs and social media

  • Mejova Y, Srinivasan P, Boynton B (2013) GOP primary season on Twitter: “popular” political sentiment in social media. WSDM’13, February 4–8, 2012, Rome, Italy

  • Moraes R, Valiati JF (2013) Document-level sentiment classification: an empirical comparison between SVM and ANN. Elseveir Trans Expert Syst Appl 40:621–633

    Article  Google Scholar 

  • Nigam K, Laverty J, Mccallum A (1999) Using maximum entropy for text classification. In: IJCAI-99 Workshop on MACHINE learning for information filtering, pp 61–67

  • Nooralahzadeh F, Arunachalam V, Chiru C (2013) 2012 Presidential Elections on Twitter—an analysis of how the US and French Election were reflected in Tweets. In: CSCS '13 Proceedings of the 19th International Conference on Control Systems and Computer Science, 2013, pp 240–246. doi:10.1109/CSCS.2013.72

  • O’Connor B, Balasubramanyan R et al (2010) From tweets to polls: linking text sentiment to public opinion time series. In: Proceedings of the International AAAI Conference on weblogs and social media, Washington, DC

  • Pak A, Paroubek P (2010) Twitter as a corpus for sentiment analysis and opinion mining. In: Proceedings of the Seventh International Conference on language resources and evaluation (LREC’10)

  • Pang B, Lee L (2002a) Seeing stars: exploiting class relationships for sentiment categorization with respect to rating scales. In: Proceedings of ACL '05 Proceedings of the 43rd Annual Meeting on Association for Computational Linguistics, pp 115–124. doi:10.3115/1219840.1219855

  • Pang B, Lee L (2002b) Sentiment classification using machine learning techniques. In: Proceedings of the Conference on empirical methods in natural language processing (EMNLP), Philadelphia

  • Parikh R and Movassate M (2009) Sentiment analysis of user-generated Twitter updates using various classification techniques. Stanford University, Stanford

  • Pew Research Center (2010) Parsing Election Day media: how the midterms message varied by platform. Pew

  • Romero DM, Meeder B, Kleinberg J (2011) Differences in the mechanics of information diffusion across topics: idioms, political hashtags, and complex contagion on Twitter. In: Proceedings of the 20th International Conference on World Wide Web (WWW). doi:10.1145/1963405.1963503

  • Rosenman Evan TR (2011) Retweets but not just retweets. Submitted to Applied Mathematics in partial fulllment of the honors requirements for the degree of Bachelor of Arts, Harvard College, Cambridge, Massachusetts March 30, 2012.

  • Sakaki T, Okazaki M, Matsuo Y (2010) Earthquake shakes Twitter users: real-time event detection by social sensors. In: Proceedings of the 19th international conference on World wide web 2010, ACM, pp 851–860. doi:10.1145/1772690.1772777

  • Skoric M, Poor N, Achananuparp P, Lim E, Jiang J et al (2012) Tweets and votes: a study of the 2011 Singapore general election. In: Proceedings at 2012 45th Hawaii International Conference on system sciences

  • Song M, Kim Chul M (2013) RT2M: real-time Twitter trend mining system. In: 2013 International Conference on social intelligence and technology. doi:10.1109/SOCIETY.2013.19

  • Stieglitz S, Dang-Xuan L (2012) Political communication and influence through microblogging: an empirical analysis of sentiment in Twitter messages and retweet behavior. In: 2012 45th Hawaii International Conference on system sciences. doi:10.1109/HICSS.2012.476

  • Tan et al (2011) User-level sentiment analysis incorporating social networks. In: Proceedings of the Sixteenth ACM SIGKDD International conference on knowledge discovery and data mining

  • Turney PD (2002) Thumbs up or thumbs down? Semantic orientation applied to unsupervised classification of reviews. In: Proceedings of ACL

  • Zhou X, Tao X, Yong J, Yang Z (2013) Sentiment analysis on tweets for social events. In: Proceedings of the 2013 IEEE 17th international conference on computer supported cooperative work in design, CSCWD 2013, pp 557–562.

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to Malhar Anjaria.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Anjaria, M., Guddeti, R.M.R. A novel sentiment analysis of social networks using supervised learning. Soc. Netw. Anal. Min. 4, 181 (2014).

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI:


  • Electoral prediction
  • Microblogs
  • Opinion mining
  • Sentiment analysis
  • Social intelligence
  • Social network analysis
  • Supervised machine learning
  • Twitter
  • Twitter analytics