Skip to main content

Advertisement

Log in

Determining Twitter Trending Hashtags and Sentiments Associated via Machine Learning Approaches

  • Original Research
  • Published:
SN Computer Science Aims and scope Submit manuscript

Abstract

Social media platforms such as Twitter serve as a powerful tool for real-time information dissemination and worldwide communication, shaping public opinions and providing a platform for diverse voices to be heard. The current study proposes methods to identify trending hashtags on Twitter over a six-month period (June to October 2021) and analyze the sentiment dynamics linked to these hashtags. In order to carry out trend analysis three classification algorithms—Naive Bayes, Gradient Boosting Decision Tree, and Random Forest—were evaluated. The results indicate that the Random Forest model outperformed the other two algorithms in accurately identifying trending hashtags. In addition to this, a comprehensive sentiment analysis was conducted using both rule-based and lexicon-based approaches. The VADER sentiment analysis was utilized as the foundation for the Support Vector Machine classifier which achieved an accuracy of 91.84%, while the TextBlob library provided additional sentiment insights. The majority of research results, leaned towards neutrality, indicating challenges in capturing sentiment complexities present in Twitter conversations. The findings highlight the effectiveness of machine learning approaches, while also recognizing the potential for deep learning techniques to enhance sentiment analysis in future research.

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

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Explore related subjects

Discover the latest articles, news and stories from top researchers in related subjects.

Data Availability

No extra data needs to be declared, already available data has been used.

References

  1. Li C, Sun A, Datta A (2012) Twevent: segment-based event detection from tweets. In: Proceedings of the 21st ACM international conference on information and knowledge management, pp 155–164

  2. Lehmann J, Gonçalves B, Ramasco JJ, Cattuto C (2012) Dynamical classes of collective attention in twitter. In: Proceedings of the 21st international conference on World Wide Web, pp 251–260

  3. Wang X, Wei F, Liu X, Zhou M, Zhang M (2011) Topic sentiment analysis in twitter: a graph-based hashtag sentiment classification approach. In: Proceedings of the 20th ACM international conference on information and knowledge management, pp 1031–1040

  4. Efron M (2010) Hashtag retrieval in a microblogging environment. In: Proceedings of the 33rd international ACM SIGIR conference on research and development in information retrieval, pp 787–788

  5. Yang L, Sun T, Zhang M, Mei Q (2012) We know what@ you# tag: does the dual role affect hashtag adoption?. In: Proceedings of the 21st international conference on World Wide Web, pp 261–270

  6. Motlagh M, Shahhoseini H, Fatehi N. A reliable sentiment analysis for classification of tweets in social networks. Soc Netw Anal Min. 2022;13(1):7.

    Article  Google Scholar 

  7. Ma Z, Sun A, Cong G. On predicting the popularity of newly emerging hashtags in twitter. J Am Soc Inform Sci Technol. 2013;64(7):1399–410.

    Article  Google Scholar 

  8. Helmy A, Nassar R, Ramdan N. Depression detection for twitter users using sentiment analysis in English and Arabic tweets. Artif Intell Med. 2024;147: 102716.

    Article  Google Scholar 

  9. Khan HU, Nasir S, Nasim K, Shabbir D, Mahmood A. Twitter trends: a ranking algorithm analysis on real time data. Expert Syst Appl. 2021;164: 113990.

    Article  Google Scholar 

  10. Petersen K, Gerken JM. # Covid-19: an exploratory investigation of hashtag usage on Twitter. Health Policy. 2021;125(4):541–7.

    Article  Google Scholar 

  11. Khanday AMUD, Rabani ST, Khan QR, Malik SH. Detecting twitter hate speech in COVID-19 era using machine learning and ensemble learning techniques. Int J Inf Manag Data Insights. 2022;2(2): 100120.

    Google Scholar 

  12. Tripathy A, Agrawal A, Rath SK. Classification of sentimental reviews using machine learning techniques. Procedia Comput Sci. 2015;57:821–9.

    Article  Google Scholar 

  13. Aqlan A, Manjula B, Naik RL (2019) A study of sentiment analysis: concepts, techniques, and challenges

  14. Sahayak V, Shete V, Pathan A. Sentiment analysis on twitter data. Int J Innov Res Adv Eng (IJIRAE). 2015;2(1):178–83.

    Google Scholar 

  15. Kaur C, Sharma A (2020) Twitter sentiment analysis on coronavirus using textblob. In: EasyChair, pp 2516–2314

  16. Sharma R (2021) Twitter: trending Tweets per week (updated weekly) . Kaggle. https://doi.org/10.34740/KAGGLE/DSV/2670667. Accessed 23 Sep 2023

Download references

Funding

The authors declare that no funding was received for this research.

Author information

Authors and Affiliations

Authors

Contributions

MS and TB prepared the manuscript under the guidance of SS. MS and TB wrote the manuscript and prepared all the images and tables in the text. The manuscript was reviewed by all the authors.

Corresponding author

Correspondence to Tanvi Bisht.

Ethics declarations

Conflict of interest

On behalf of all authors, the corresponding author states that there is no conflict of interest.

Research involving human and/or animals

Not applicable.

Informed consent

None required.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Bisht, T., Singh, M. & Singhal, S. Determining Twitter Trending Hashtags and Sentiments Associated via Machine Learning Approaches. SN COMPUT. SCI. 5, 1002 (2024). https://doi.org/10.1007/s42979-024-03387-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s42979-024-03387-y

Keywords

Navigation