Anatomy of Sentiment Analysis of Tweets Using Machine Learning Approach

Anatomy of Sentiment Analysis of Tweets


  • Misbah Iram University Institute of Information Technology, University of Arid Agriculture, Rawalpindi, Pakistan
  • Saif Ur Rehman University Institute of Information Technology, University of Arid Agriculture, Rawalpindi, Pakistan
  • Shafaq Shahid University Institute of Information Technology, University of Arid Agriculture, Rawalpindi, Pakistan
  • Sayeda Ambreen Mehmood University Institute of Information Technology, University of Arid Agriculture, Rawalpindi, Pakistan



Sentiment analysis, Opinion Mining, Social Media, Social Network Analysis, Sentiment Aspects Extraction, Twitter, Machine Learning


Sentiment Analysis (SA) is an efficient way of determining people’s opinions from a piece of text. SA using different social media sites such as Twitter has achieved tremendous results. Twitter is an online social media platform that contains a massive amount of data. The platform is known as an information channel corresponding to different sites and categories. Tweets are most often publicly accessible with very few limitations and security options available. Twitter also has powerful tools to enhance the utility of Twitter and a powerful search system to make publicly accessible the recently posted tweets by keyword. As popular social media, Twitter has the potential for interconnectivity of information, reviews, updates, and all of which are important to engage the targeted population. In this work, numerous methods that perform a classification of tweet sentiment on Twitter have been discussed. There has been an extensive research studies in the field of SA of Twitter data. This study provides a comprehensive analysis of the most standard and widely applicable opinion mining techniques based on machine learning and lexicon-based along with their metrics. The proposed work is helpful in informaiton analysis in the tweets where opinions are found heterogeneous, unstructured, polarised negative, positive, or neutral. In order to validate the supremacy of the suggested approach, we have executed a series of experiments on the real-world Twitter dataset that alters to show the effectiveness of the proposed framework. This research effort also highlighted the recent challenges in the SA field and the proposed work’s future scope. 


K. Moilanen and S. Pulman. Sentiment Composition. In Proceedings of Recent Advances in Natural Language Processing, p. 378-382 (2007).

D. Antonakaki, P. Fragopoulou and S. Ioannidis. A survey of Twitter research: Data model, graph structure, sentiment analysis and attacks. Expert Systems with Applications, 114006, 164 (2021).

A. Nawaz, T. Ali, Y. Hafeez, & Rashid, M. R. Mining public opinion: sentiment-based forecasting for democratic elections of Pakistan. Spatial Information Research, 169-181, 30(1) (2022).

B. Liu. Sentiment analysis and opinion mining. Synthesis lectures on human language technologies, 5(1), p. 1-167 (2012).

A. Alsaeedi and M. Z. Khan. A study on sentiment analysis techniques of Twitter data. International Journal of Advanced Computer Science and Applications, 10(2), p. 361-374 (2019).

A. Mensikova and C. A. Mattmann. Ensemble sentiment analysis to identify human trafficking in web data. In Proceedings of ACM workshop on graph techniques for adversarial activity analytics (GTA32018), p. 0-5(2018).

R. L. Cilibrasi and P. M. Vitanyi. The google similarity distance. IEEE Transactions on knowledge and data engineering, 19(3), p. 370-383 (2007).

E. Cambria, H. Wang, and B. White. Guest editorial: Big social data analysis. Knowledge-based systems, 69(1), p. 1-2(2014).

S. Rehman, A. Nawaz, T. Ali, and N. Amin. g-Sum: a graph summarisation approach for a single large social network. EAI Endorsed Transactions on Scalable Information Systems, p. 1-11. e2 (2021).

S. U. Rehman and S. Asghar. Online social network trend discovery using frequent subgraph mining. Social Network Analysis and Mining, 10(1), p. 1-13 (2020).

J. S. Deshmukh and A. K. Tripathy. Entropy based classifier for cross-domain opinion mining. Applied Computing and Informatics, p. 55-64 (2018).

D. E. Allen, M. McAleer, and A. K. Singh. An entropy-based analysis of the relationship between the DOW JONES Index and the TRNA Sentiment series, Applied Economics, p. 677-692 (2017).

S. Jain, S. Shukla, and R. Wadhvani. Dynamic selection of normalisation techniques using data complexity measures, Expert Systems with Applications, p. 252-262(2018).

A. Asghar, A. Zaman, A, and S. U. Rehman. Decision Support System for Measuring the User Sentiment towards Different COVID-19 Vaccines. Foundation University Journal of Engineering and Applied Sciences (HEC Recognized Y Category, ISSN 2706-7351), 2(2) (2021).

AD Kramer, An unobtrusive behavioral model of gross national happiness. In Proceedings of the SIGCHI conference on human factors in computing systems, ACM, p 287–290 (2018).

A. Upadhyay, S. Rai, and S. Shukla. Sentiment Analysis of Zomato and Swiggy Food Delivery Management System. In Second International Conference on Sustainable Technologies for Computational Intelligence, p. 39-46(2022).

A. Gupta and J. Pruthi. Sentiment analysis of tweets using machine learning approach. International Journal of Computer Science and Mobile Computing, 6(4), 444-458 (2017).

L. P. Morency. Towards multimodal sentiment analysis: Harvesting opinions from the online. In Proceedings of the 13th international conference on multimodal interfaces, p. 169-176(2011).

E. Kouloumpis, T. Wilson, and J. Moore. Twitter sentiment analysis: The good the bad and the OMG!. In Fifth International AAAI Conference on weblogs and social media, p. 538-541(2011).

A. Kumar and T. Mary. Sentiment Analysis on Twitter. IJCSI International Journal of Computer Science Issues, 4(3), p. 372-378(2015).

Moore M.T. Constructing a sentiment analysis model for LibQUAL+ comments. Performance Measurement and Metrics, 18(1), p. 78-87(2017).

A. Dridi and D. R. Recupero. Leveraging semantics for sentiment polarity detection in social media. International Journal of Machine Learning and Cybernetics, 10(8), p.1-11 (2017).

A. Mensikova, and C. A. Mattmann. Ensemble sentiment analysis to identify human trafficking in web data. In Proceedings of ACM workshop on graph techniques for adversarial activity analytics, p.0-5(2018).

M. Soleymani, S. Asghari-Esfeden S, Analysis of EEG signals and facial expressions for continuous emotion detection. IEEE Transactions on Affective Computing, 7(1), p.17–28(2018).

M. Elhawaryand M. Elfeky, Mining Arabic business reviews. In Data Mining Workshops (ICDMW), p.1108-1113(2010).

C. Messaoudi, Z. Guessoum, and L. Ben Romdhane.. Opinion mining in online social media: a survey. Social Network Analysis and Mining, 12(1), p. 1-18(2022).

A. Ortigosa, J. M. Martín, an R. M. Carro. Sentiment analysis in Facebook and its application to e-learning. Computers in Human Behavior, 31, p. 527-541(2014).

J. Bollen, M. Mao, and X. Zeng. Twitter mood predicts the stock market. Journal of computational science, 2(1), p. 1-8(2011).

Q. Su, K. Xiang, H. Wang, B. Sun, and S. Yu. Using pointwise mutual information to identify implicit features incustomer reviews. In Computer Processing of Oriental Languages.Beyond the Orient: The Research Challenges Ahead, Springer Berlin, Heidelberg, p. 22-30(2006).

G. Paltoglou. Twitter, MySpace, Digg: Unsupervised Sentiment Analysis in Social Media. ACM Transactions on Intelligent Systems and Technology (TIST), 3(4), p. 1-19(2016).

E. Cambria, H. Wang and B. White. Guest editorial: Big social data analysis, Knowledge Based System, 2014.

M. Hu, and B. Liu. Mining opinion features in customer reviews. American Association for Artificial Intelligence, 4, p. 755–760(2004).

J. Wiebe and T. Wilson, Annotating expressions of opinions and emotions in language. Language resources and evaluation, 39(2), p. 165-210(2015)

T. A. Wilson. Fine-grained subjectivity and sentiment analysis: recognising the intensity, polarity, and attitudes of personal states. ProQuest, University of Pittsburgh, 2013

H. Fu and Z. Niu. ASELM: adaptive semi- supervised ELM with application in question subjectivity identification. Neurocomputing, 207, p. 599–609(2016).

X. Fu, W. Liu, Combine HowNet lexicon to coach phrase recursive autoencoder for sentence-level sentiment analysis. Neurocomputing, 241, p. 18-27 (2017).

X. Fu, W. Liu, and T. Wang. Long short-term memory network over rhetorical structure theory for sentence-level sentiment analysis. In Asian conference on machine learning, p. 17-32(2016).

A. Giachanou, F. Crestani. Prefer it or not: a survey of Twitter sentiment analysis methods. ACM Computing Surveys (CSUR), 49(2), p. 1-41(2016).

O. Appel, F. Chiclana, J. Carter, and H. Fujita. A hybrid approach to the sentiment analysis problem at the sentence level. Knowledge-Based Systems, 108, p. 110-124(2016).

E. Cambria, N. Howard, and A. Hussain. Sentic blending: Scalable multimodal fusion for the continuous interpretation of semantics and sentics. In 2013 IEEE symposium on computational intelligence for human-like intelligence (CIHLI), p. 108-117(2013).

K. Khan, and A. Khan. Identifying product features from customer reviews using hybrid patterns. International Arab Journal of Information Technology, 11(3), p. 281-286(2014).

B. Liu. Sentiment analysis and subjectivity. Handbook of natural language processing, 2(2010), p. 627-666(2010).

Y. Hu, Interactive topic modeling. Machine learning 2014, pp. 423-469.

Z. Chen and B. Liu. mining topics in documents: standing on the shoulders of big data. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, p. 1116- 1125(2014).

T. Hofmann, Probabilistic latent semantic indexing. In Proceedings of the 22nd annual international ACM SIGIR conference on Research and development in information retrieval, pp. 50-57 (1999).

B. Hegde, and M. Prakash. Sentiment analysis of Twitter data: A machine learning approach to analyse demonetisation tweets. International Research Journal of Engineering and Technology, (2018)

D. Hussein. A survey on sentiment analysis challenges. Journal of King Saud University- Engineering Sciences, 30(4), p. 330-338(2018).

R. K. Jha, and S. Khurana, Sentiment analysis in Twitter. (2013).

Sheela, L. J. (2016). A review of sentiment analysis in twitter data using Hadoop. International Journal of Database Theory and Application, 9(1), 77-86.

S. Goyal Sentimental analysis of twitter data using text mining and hybrid classification approach. International Journal of Advance Research, Ideas and Innovations in Technology, 2(5), p. 1-9(2016).

A. Surnar, and S. Sonawane. Review for Twitter Sentiment Analysis Using Various Methods. International Journal of Advanced Research in Computer Engineering & Technology, p. 586-588, 6(5), (2017).

K. Jindal and R. Aron. A systematic study of sentiment analysis for social media data. Materials today: proceedings (2021).

M. Umer,I. Ashraf, A. Mehmood, S. Kumari, S. Ullah and G. Sang Choi. Sentiment analysis of tweets using a unified convolutional neural network‐long short‐term memory network model. Computational Intelligence, pp.409-434,37(1) (2021).

Sandaka, G. K., & Gaekwade, B. N. (2021). Sentiment Analysis and Time-series Analysis for the COVID-19 vaccine Tweets.

Elbagir, S., & Yang, J. (2018, December). Sentiment analysis of twitter data using machine learning techniques and scikit-learn. In Proceedings of the 2018 International Conference on Algorithms, Computing and Artificial Intelligence (pp. 1-5).

Ilyas, S. H. W., Soomro, Z. T., Anwar, A., Shahzad, H., & Yaqub, U. (2020, June). Analysing Brexit’s impact using sentiment analysis and topic modeling on Twitter discussion. In The 21st Annual International Conference on Digital Government Research (pp. 1-6).

Bhowmik, N. R., Arifuzzaman, M., & Mondal, M. R. H. (2022). Sentiment analysis on Bangla text using extended lexicon dictionary and deep learning algorithms. Array, 100123.




How to Cite

Iram, M. ., Rehman, S. U., Shahid, S. ., & Mehmood , S. A. . (2022). Anatomy of Sentiment Analysis of Tweets Using Machine Learning Approach : Anatomy of Sentiment Analysis of Tweets. Proceedings of the Pakistan Academy of Sciences: A. Physical and Computational Sciences, 59(2), 61–73.