Transformer-Based Sentiment Analysis of Mpox Discourse on Twitter for Digital Epidemiology
Main Article Content
Abstract
The Mpox outbreak has sparked extensive public discourse on social media platforms like Twitter (X), where users express emotions ranging from worry and suspicion to support. Understanding these emotions can be of great help to public health authorities attempting to communicate and respond while preparing for outbreaks like this one. However, conventional sentiment analysis approaches often fall short, as prior algorithms have failed to recognise syntactic categories in informal, almost carefree social media text. The study was carried out to evaluate the efficacy of transferrable transformer-based technologies in sentiment analysis of Twitter texts concerning the Mpox crisis. The researchers gathered 6,377 tweets using Apify scraping software from the Web and further filtered them to 5,142 English-language tweets after removing duplicates and non-English tweets. Sentences were classified using the VADER tool, then used to train a transformer-based classification model with AutoGluon's MultiModalPredictor, employing the pre-trained ELECTRA architecture. The model was then trained and tested with an 80:20 training-testing split and achieved an overall accuracy of 83.92%, with macro-averages of 79.78%, 79.67%, and 79.57% for precision, recall, and F1-Score, respectively. The comparison between the transformer and the VADER baseline was based on the transformer's significant leap in sentiment classification; it exhibited clear improvements. To demonstrate the practical applicability of the models, the trained model was deployed via an integrable Streamlit dashboard, where users could upload tweet datasets for the classifier to generate sentiment predictions. Some evaluations of sentiment trends were also conducted. The study also sheds light on how businesses based on transformer models have been capitalised to investigate large-scale social discourse and, in turn, to support digital epidemiology and public health monitoring during infectious disease outbreaks.
Article Details

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
References
[2] A. Ganesan et al., “Mpox treatment evolution: past milestones, present advances, and future directions,” Naunyn. Schmiedebergs. Arch. Pharmacol., vol. 398, no. 2, pp. 1057–1080, 2025, doi: 10.1007/s00210-024-03385-0.
[3] K. K. Mohbey, G. Meena, S. Kumar, and K. Lokesh, “A CNN-LSTM-Based Hybrid Deep Learning Approach for Sentiment Analysis on Monkeypox Tweets,” New Gener. Comput., vol. 42, no. 1, pp. 89–107, 2024, doi: 10.1007/s00354-023-00227-0.
[4] R. Olusegun, T. Oladunni, H. Audu, Y. A. O. Houkpati, and S. Bengesi, “Text Mining and Emotion Classification on Monkeypox Twitter Dataset: A Deep Learning-Natural Language Processing (NLP) Approach,” IEEE Access, vol. 11, no. May, pp. 49882–49894, 2023, doi: 10.1109/ACCESS.2023.3277868.
[5] T. Alqurashi, “Arabic Sentiment Analysis for Twitter Data: A Systematic Literature Review,” Eng. Technol. Appl. Sci. Res., vol. 13, no. 2, pp. 10292–10300, 2023, doi: 10.48084/etasr.5662.
[6] Y. Wang, “Sentiment Analysis in Analyzing Monkeypox-Related Tweets Based on Deep Learning,” in Proceedings ofthe 1st International Conference on Engineering Management, Information Technology and Intelligence, 2024, pp. 215–220. doi: 10.5220/0012923200004508.
[7] A. Yazdani, M. Shamloo, M. Khaki, and A. Nahvijou, “Use of sentiment analysis for capturing hospitalized cancer patients’ experience from free-text comments in the Persian language,” BMC Med. Inform. Decis. Mak., vol. 23, no. 1, pp. 1–14, 2023, doi: 10.1186/s12911-023-02358-2.
[8] N. Thakur, “MonkeyPox2022Tweets: A Large-Scale Twitter Dataset on the 2022 Monkeypox Outbreak, Findings from Analysis of Tweets, and Open Research Questions,” Infect. Dis. Rep., vol. 14, no. 6, pp. 855–883, 2022, doi: 10.3390/idr14060087.
[9] K. Jahanbin, M. Jokar, and V. Rahmanian, “Using twitter and web news mining to predict the monkeypox outbreak,” Asian Pac. J. Trop. Med., vol. 15, no. 5, pp. 236–238, 2022, doi: 10.4103/1995-7645.346083.
[10] N. Thakur, “Sentiment Analysis and Text Analysis of the Public Discourse on Twitter about COVID-19 and MPox,” Big Data Cogn. Comput., vol. 7, no. 2, 2023, doi: 10.3390/bdcc7020116.
[11] J. Mantik et al., “Analysis of twitter user sentiment on the monkeypox virus issue using the nrc lexicon,” J. Mantik, vol. 6, no. 4, pp. 2685–4236, 2023.
[12] V. S. Dsouza et al., “A sentiment and content analysis of tweets on monkeypox stigma among the LGBTQ+ community: A cue to risk communication plan,” Dialogues Heal., vol. 2, no. December 2022, p. 100095, 2023, doi: 10.1016/j.dialog.2022.100095.
[13] H. Dia and N. Pettersson, “Evaluating the Accuracy of Sentiment Analysis Models when Applied to Social Media Texts,” 2024, KTH Royal Institute of Technology.
[14] P. Rajkhowa et al., “Factors Influencing Monkeypox Vaccination: A Cue to Policy Implementation,” J. Epidemiol. Glob. Health, vol. 13, no. 2, pp. 226–238, 2023, doi: 10.1007/s44197-023-00100-9.
[15] K. K. Agustiningsih, E. Utami, and H. Al Fatta, “Sentiment Analysis of COVID-19 Vaccine on Twitter Social Media: Systematic Literature Review,” Proc. - 2021 IEEE 5th Int. Conf. Inf. Technol. Inf. Syst. Electr. Eng. Appl. Data Sci. Artif. Intell. Technol. Glob. Challenges Dur. Pandemic Era, ICITISEE 2021, pp. 121–126, 2021, doi: 10.1109/ICITISEE53823.2021.9655960.
[16] J. Na et al., “Sentiment analysis of online reviews of energy-saving products based on transfer learning and LBBA model,” J. Environ. Manage., vol. 360, no. May, p. 121083, 2024, doi: 10.1016/j.jenvman.2024.121083.
[17] A. Ghorbanali, M. K. Sohrabi, and F. Yaghmaee, “Ensemble transfer learning-based multimodal sentiment analysis using weighted convolutional neural networks,” Inf. Process. Manag., vol. 59, no. 3, p. 102929, 2022, doi: 10.1016/j.ipm.2022.102929.
[18] A. G. A. and V. V., “Sentiment analysis on a low-resource language dataset using multimodal representation learning and cross-lingual transfer learning,” Appl. Soft Comput., vol. 157, no. April 2023, p. 111553, 2024, doi: 10.1016/j.asoc.2024.111553.
[19] A. De Arriba, M. Oriol, and X. Franch, “Applying Transfer Learning to Sentiment Analysis in Social Media,” Proc. IEEE Int. Conf. Requir. Eng., vol. 2021-September, pp. 342–348, 2021, doi: 10.1109/REW53955.2021.00060.
[20] H. Chamboko, K. Maguraushe, and B. Ndlovu, “Twitter (X) Sentiment Analysis on Monkeypox: A Systematic Literature Review,” IJID (International J. Informatics Dev., vol. 14, no. 2, pp. 629–639, 2025, doi: 10.14421/ijid.2025.5196.
[21] A. Khumaidi, “Data Mining for Predicting the Amount of Coffee Production Using Crisp-Dm Method,” J. Techno Nusa Mandiri, vol. 17, no. 1, pp. 1–8, 2020, doi: 10.33480/techno.v17i1.1240.
[22] Y. A. Singgalen, “Analyzing an Interest in GPT 4o through Sentiment Analysis using CRISP-DM,” J. Inf. Syst. Informatics, vol. 6, no. 2, pp. 882–898, 2024, doi: 10.51519/journalisi.v6i2.740.
[23] N. Omojunikanbi, “Public relations and effective communication during a global health crisis: Combating disinformation, misinformation, and fake news on Covid-19,” J. Commun. Media Res., vol. 14, no. 1, pp. 64–71, 2022, [Online]. Available: https://www.researchgate.net/publication/374328549