Skip to main content

Machine Learning Models for Sentiment Analysis of Tweets: Comparisons and Evaluations

  • Chapter
  • First Online:
Transforming Management with AI, Big-Data, and IoT

Abstract

Presently, the use of Twitter is increasing, and occurrences of large number of tweets are one of the important sources of personal thoughts and opinions. In social media, sentiment analysis is a significant type for analysis of text to make choice to find out the negative and positive thoughts of the users. In this chapter, we have analysed sentiment analysis of tweets using two machine learning models (Logistic Regression and Decision Tree) to identify the best machine learning algorithms for tweet data analysis. Further, data pre-processing (tokenization and stemming) and data visualization are performed. Data engineering principles are applied to measure the performances and improve the results. Data engineering displays the statistics with different labels, hash tags and word frequency tables. Finally, the performance of both the machine learning algorithms is evaluated using F-1 score. Results demonstrate 4% increase in model performance if Logistic Regression with a particular feature is used.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 149.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 199.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 199.99
Price excludes VAT (USA)
  • Durable hardcover 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

References

  1. Dhaoui, C., Webster, C. M., & Tan, L. P. (2017). Social media sentiment analysis: Lexicon versus machine learning. Journal of Consumer Marketing, 34, 480–488.

    Article  Google Scholar 

  2. Nguyen, T. H., Shirai, K., & Velcin, J. (2015). Sentiment analysis on social media for stock movement prediction. Expert Systems with Applications, 42, 9603–9611.

    Article  Google Scholar 

  3. Yoo, S., Song, J., & Jeong, O. (2018). Social media contents based sentiment analysis and prediction system. Expert Systems with Applications, 105, 102–111.

    Article  Google Scholar 

  4. Nguyen, T. H., & Shirai, K. (2015). Topic modeling based sentiment analysis on social media for stock market prediction. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing. 1, 1354–1364.

    Google Scholar 

  5. Shaukat, Z., Zulfiqar, A. A., Xiao, C., Azeem, M., & Mahmood, T. (2020). Sentiment analysis on IMDB using lexicon and neural networks. SN Applied Sciences, 2, 1–10.

    Article  Google Scholar 

  6. Gaspar, R., Pedro, C., Panagiotopoulos, P., & Seibt, B. (2016). Beyond positive or negative: Qualitative sentiment analysis of social media reactions to unexpected stressful events. Computers in Human Behavior, 56, 179–191.

    Article  Google Scholar 

  7. Mathapati, S., Nafeesa, A., Tanuja, R., Manjula, S. H., & Venugopal, K. R. (2019). Semi-supervised domain adaptation and collaborative deep learning for dual sentiment analysis. SN Applied Sciences, 1, 907.

    Article  Google Scholar 

  8. Haselmayer, M., & Jenny, M. (2017). Sentiment analysis of political communication: Combining a dictionary approach with crowdcoding. Quality and Quantity, 51, 2623–2646.

    Article  Google Scholar 

  9. Eldefrawi, M. M., Elzanfaly, D. S., Farhan, M. S., & Eldin, A. S. (2019). Sentiment analysis of Arabic comparative opinions. SN Applied Sciences, 1, 411.

    Article  Google Scholar 

  10. Vilares, D., Thelwall, M., & Alonso, M. A. (2015). The megaphone of the people? Spanish SentiStrength for real-time analysis of political tweets. Journal of Information Science, 41, 799–813.

    Article  Google Scholar 

  11. Palomino, M., Taylor, T., Göker, A., Isaacs, J., & Warber, S. (2016). The online dissemination of nature–health concepts: Lessons from sentiment analysis of social media relating to “nature-deficit disorder”. International Journal of Environmental Research and Public Health, 13, 142.

    Article  Google Scholar 

  12. Gill, S. S., Tuli, S., Xu, M., Singh, I., Singh, K. V., Lindsay, D., et al. (2019). Transformative effects of IoT, blockchain and artificial intelligence on cloud computing: Evolution, vision, trends and open challenges. Internet of Things, 8, 100118.

    Article  Google Scholar 

  13. Wang, Y., & Li, B. (2015). Sentiment analysis for social media images. In IEEE International Conference on Data Mining Workshop (ICDMW), 1584–1591.

    Google Scholar 

  14. Muhammad, A., Wiratunga, N., & Lothian, R. (2016). Contextual sentiment analysis for social media genres. Knowledge-Based Systems, 108, 92–101.

    Article  Google Scholar 

  15. Yue, L., Chen, W., Li, X., Zuo, W., & Yin, M. (2019). A survey of sentiment analysis in social media. Knowledge and Information Systems, 60, 1–47.

    Article  Google Scholar 

  16. Vashishtha, S., & Susan, S. (2019). Fuzzy rule based unsupervised sentiment analysis from social media posts. Expert Systems with Applications, 138, 112834.

    Article  Google Scholar 

  17. Etter, M., Colleoni, E., Illia, L., Meggiorin, K., & D’Eugenio, A. (2018). Measuring organizational legitimacy in social media: Assessing citizens’ judgments with sentiment analysis. Business & Society, 57, 60–97.

    Article  Google Scholar 

  18. Beigi, G., Hu, X., Maciejewski, R., & Liu, H. (2016). An overview of sentiment analysis in social media and its applications in disaster relief. In W. Pedrycz & S. M. Chen (Eds.), Sentiment analysis and ontology engineering (Vol. 639, pp. 313–340). Springer.

    Chapter  Google Scholar 

  19. Islam, M. R., & Zibran, M. F. (2018). SentiStrength-SE: Exploiting domain specificity for improved sentiment analysis in software engineering text. Journal of Systems and Software, 145, 125–146.

    Article  Google Scholar 

  20. Pagolu, V. S., Reddy, K. N., Panda, G., & Majhi, B. (2016). Sentiment analysis of Twitter data for predicting stock market movements. In IEEE international conference on signal processing, communication, power and embedded system (SCOPES), 1345–1350.

    Google Scholar 

  21. Ceron, A., Curini, L., & Iacus, S. M. (2016). iSA: A fast, scalable and accurate algorithm for sentiment analysis of social media content. Information Sciences, 367, 105–124.

    Article  Google Scholar 

  22. Xia, R., Jiang, J., & He, H. (2017). Distantly supervised lifelong learning for large-scale social media sentiment analysis. IEEE Transactions on Affective Computing, 8, 480–491.

    Article  Google Scholar 

  23. Younis, E. M. (2015). Sentiment analysis and text mining for social media microblogs using open source tools: An empirical study. International Journal of Computer Applications, 112, 44–48.

    Google Scholar 

  24. Thakor, P., & Sasi, S. (2015). Ontology-based sentiment analysis process for social media content. In INNS Conference on Big Data, 199–207.

    Google Scholar 

  25. Agarwal, A., Xie, B., Vovsha, I., Rambow, O., & Passonneau, R. J. (2011). Sentiment analysis of twitter data. In Proceedings of the workshop on language in social media, 30–38.

    Google Scholar 

  26. Sahayak, V., Shete, V., & Pathan, A. (2015). Sentiment analysis on twitter data. International Journal of Innovative Research in Advanced Engineering (IJIRAE), 2, 178–183.

    Google Scholar 

  27. Twitter sentiment analysis, Online Available: https://www.kaggle.com/arkhoshghalb/twitter-sentiment-analysis-hatred-speech. Accessed 16 10 2020.

  28. Tuli, S., Tuli, S., Tuli, R., & Gill, S. S. (2020). Predicting the growth and trend of COVID-19 pandemic using machine learning and cloud computing. Internet of Things, 100222.

    Google Scholar 

  29. Kumar, A., Sharma, K., Singh, H., Naugriya, S. G., Gill, S. S., & Buyya, R. (2021). A drone-based networked system and methods for combating coronavirus disease (COVID-19) pandemic. Future Generation Computer Systems, 115, 1–19.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sukhpal Singh Gill .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Vanga, L.K.R., Kumar, A., Kaur, K., Singh, M., Stankovski, V., Gill, S.S. (2022). Machine Learning Models for Sentiment Analysis of Tweets: Comparisons and Evaluations. In: Al-Turjman, F., Yadav, S.P., Kumar, M., Yadav, V., Stephan, T. (eds) Transforming Management with AI, Big-Data, and IoT. Springer, Cham. https://doi.org/10.1007/978-3-030-86749-2_16

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-86749-2_16

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-86748-5

  • Online ISBN: 978-3-030-86749-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics