Opinion Severity Prediction about Covid-19 Vaccination using Twitter Sentiments Analysis
Article Information
Abstract
Public opinion on COVID-19 vaccines strongly affects vaccination uptake. This study analyzes the sentiment of tweets about COVID-19 vaccines. Tweets from December 2021 were collected with the Twitter API, stored in a CSV file, and preprocessed with natural language processing techniques. A Naïve Bayes (NB) classifier was used for supervised classification and reached an accuracy of 90%. The study has three objectives: 1) data extraction and preprocessing, 2) sentiment analysis of people's views, and 3) evaluation of the NB classifier. Of the tweets, 36.82% are positive, 12.97% are negative, and 50.21% are neutral. The large neutral share suggests that many people may still be uncertain about vaccination and points to the need for targeted awareness programs. In addition, k-means clustering was used to determine severity levels, which produced high-positive, low-positive, high-negative, and low-negative clusters. On the same dataset, the NB classifier outperformed SVM, multinomial NB, random forest, and gradient boosting in accuracy. The findings can help authorities and public health initiatives address prevailing doubts and encourage vaccination, and they can support the control and prevention of future pandemics.
Graphical Abstract
Keywords
Data Availability Statement
Funding
Conflicts of Interest
AI Use Statement
Ethical Approval and Consent to Participate
References
- Jalil, Z., Abbasi, A., Javed, A. R., Badruddin Khan, M., Abul Hasanat, M. H., Malik, K. M., & Saudagar, A. K. J. (2022). COVID-19 related sentiment analysis using state-of-the-art machine learning and deep learning techniques. Frontiers in public health, 9, 812735.
[CrossRef] [Google Scholar] - Muric, G., Wu, Y., & Ferrara, E. (2021). COVID-19 vaccine hesitancy on social media: Building a public Twitter data set of antivaccine content, vaccine misinformation, and conspiracies. JMIR Public Health and Surveillance, 7(11), e30642.
[CrossRef] [Google Scholar] - Abd-Alrazaq, A., Alhuwail, D., Househ, M., Hamdi, M., & Shah, Z. (2020). Top concerns of tweeters during the COVID-19 pandemic: Infoveillance study. Journal of Medical Internet Research, 22(4), e19016.
[CrossRef] [Google Scholar] - Xue, J., Chen, J., Hu, R., Chen, C., Zheng, C., Su, Y., & Zhu, T. (2020). Twitter discussions and emotions about the COVID-19 pandemic: Machine learning approach. Journal of medical Internet research, 22(11), e20550.
[CrossRef] [Google Scholar] - Mahyoob, M., Algaraady, J., Alrahiali, M., & Alblwi, A. (2022). Sentiment analysis of public tweets towards the emergence of SARS-CoV-2 Omicron variant: A social media analytics framework. Engineering, Technology & Applied Science Research, 12(3), 8525–8531.
[CrossRef] [Google Scholar] - Sattar, N. S., & Arifuzzaman, S. (2021). COVID-19 vaccination awareness and aftermath: Public sentiment analysis on Twitter data and vaccinated population prediction in the USA. Applied Sciences, 11(13), 6128.
[CrossRef] [Google Scholar] - Yousefinaghani, S., Dara, R., Mubareka, S., Papadopoulos, A., & Sharif, S. (2021). An analysis of COVID-19 vaccine sentiments and opinions on Twitter. International Journal of Infectious Diseases, 108, 256–262.
[CrossRef] [Google Scholar] - Amjad, A., Qaiser, S., Anwar, A., & Ali, R. (2021, September). Analysing public sentiments regarding COVID-19 vaccines: a sentiment analysis approach. In 2021 IEEE international smart cities conference (ISC2) (pp. 1-7). IEEE.
[CrossRef] [Google Scholar] - Pristiyono, Ritonga, M., Ihsan, M. A. A., Anjar, A., & Rambe, F. H. (2021, February). Sentiment analysis of COVID-19 vaccine in Indonesia using Naïve Bayes Algorithm. In IOP Conference Series: Materials Science and Engineering (Vol. 1088, No. 1, p. 012045). IOP Publishing.
[CrossRef] [Google Scholar] - Villavicencio, C., Macrohon, J. J., Inbaraj, X. A., Jeng, J. H., & Hsieh, J. G. (2021). Twitter sentiment analysis towards covid-19 vaccines in the Philippines using naïve bayes. Information, 12(5), 204.
[CrossRef] [Google Scholar] - Barkur, G., Vibha, & Kamath, G. B. (2020). Sentiment analysis of nationwide lockdown due to COVID 19 outbreak: Evidence from India. Asian Journal of Psychiatry, 51, 102089.
[CrossRef] [Google Scholar] - Chakraborty, K., Bhatia, S., Bhattacharyya, S., Platos, J., Bag, R., & Hassanien, A. E. (2020). Sentiment analysis of COVID-19 tweets by deep learning classifiers—A study to show how popularity is affecting accuracy in social media. Applied Soft Computing, 97, 106754.
[CrossRef] [Google Scholar] - Piedrahita-Valdés, H., Piedrahita-Castillo, D., Bermejo-Higuera, J., Guillem-Saiz, P., Bermejo-Higuera, J. R., Guillem-Saiz, J., Sicilia-Montalvo, J. A., & Machío-Regidor, F. (2021). Vaccine hesitancy on social media: Sentiment analysis from June 2011 to April 2019. Vaccines, 9(1), 28.
[CrossRef] [Google Scholar] - Imran, A. S., Daudpota, S. M., Kastrati, Z., & Batra, R. (2020). Cross-cultural polarity and emotion detection using sentiment analysis and deep learning on COVID-19 related tweets. IEEE Access, 8, 181074–181090.
[CrossRef] [Google Scholar] - Devika, M. D., Sunitha, C., & Ganesh, A. (2016). Sentiment analysis: A comparative study on different approaches. Procedia Computer Science, 87, 44–49.
[CrossRef] [Google Scholar] - Dang, N. C., Moreno-García, M. N., & De la Prieta, F. (2020). Sentiment analysis based on deep learning: A comparative study. Electronics, 9(3), 483.
[CrossRef] [Google Scholar] - Ansari, M. T. J., & Khan, N. A. (2021). Worldwide COVID-19 vaccines sentiment analysis through Twitter content. Electronic Journal of General Medicine, 18(6), em329.
[CrossRef] [Google Scholar] - Salathé, M., & Khandelwal, S. (2011). Assessing vaccination sentiments with online social media: Implications for infectious disease dynamics and control. PLoS Computational Biology, 7(10), e1002199.
[CrossRef] [Google Scholar] - Marcec, R., & Likic, R. (2022). Using Twitter for sentiment analysis towards AstraZeneca/Oxford, Pfizer/BioNTech and Moderna COVID-19 vaccines. Postgraduate Medical Journal, 98(1161), 544–550.
[CrossRef] [Google Scholar] - Lyu, J. C., Han, E. L., & Luli, G. K. (2021). COVID-19 vaccine-related discussion on Twitter: Topic modeling and sentiment analysis. Journal of Medical Internet Research, 23(6), e24435.
[CrossRef] [Google Scholar] - Xue, J., Chen, J., Chen, C., Zheng, C., Li, S., & Zhu, T. (2020). Public discourse and sentiment during the COVID 19 pandemic: Using Latent Dirichlet Allocation for topic modeling on Twitter. PLoS ONE, 15(9), e0239441.
[CrossRef] [Google Scholar] - Hung, M., Lauren, E., Hon, E. S., Birmingham, W. C., Xu, J., Su, S., ... & Lipsky, M. S. (2020). Social network analysis of COVID-19 sentiments: Application of artificial intelligence. Journal of Medical Internet Research, 22(8), e22590.
[CrossRef] [Google Scholar] - Samuel, J., Ali, G. G. M. N., Rahman, M. M., Esawi, E., & Samuel, Y. (2020). COVID-19 public sentiment insights and machine learning for tweets classification. Information, 11(6), 314.
[CrossRef] [Google Scholar] - Kaur, H., Ul Ahsaan, S., Alankar, B., & Chang, V. (2021). A proposed sentiment analysis deep learning algorithm for analyzing COVID-19 tweets. Information Systems Frontiers, 23(6), 1417–1429.
[CrossRef] [Google Scholar] - Pokharel, B. P. (2020). Twitter sentiment analysis during COVID-19 outbreak in Nepal. SSRN Electronic Journal.
[CrossRef] [Google Scholar] - Dubey, A. D. (2020). Twitter sentiment analysis during COVID-19 outbreak. SSRN Electronic Journal.
[CrossRef] [Google Scholar] - Loria, S. (n.d.). TextBlob: Simplified text processing [Software documentation]. Retrieved from https://textblob.readthedocs.io/
[Google Scholar] - Haddi, E., Liu, X., & Shi, Y. (2013). The role of text pre-processing in sentiment analysis. Procedia Computer Science, 17, 26–32.
[CrossRef] [Google Scholar] - Jianqiang, Z., & Xiaolin, G. (2017). Comparison research on text pre-processing methods on Twitter sentiment analysis. IEEE Access, 5, 2870–2879.
[CrossRef] [Google Scholar] - Palomino, M. A., & Aider, F. (2022). Evaluating the effectiveness of text pre-processing in sentiment analysis. Applied Sciences, 12(17), 8765.
[CrossRef] [Google Scholar]
Cite This Article
TY - JOUR AU - Khan, Maaz AU - Khan, Inayat PY - 2026 DA - 2026/11/23 TI - Opinion Severity Prediction about Covid-19 Vaccination using Twitter Sentiments Analysis JO - ICCK Transactions on Advanced Computing and Systems T2 - ICCK Transactions on Advanced Computing and Systems JF - ICCK Transactions on Advanced Computing and Systems VL - 2 IS - 4 SP - 291 EP - 299 DO - 10.62762/TACS.2025.224386 UR - https://www.icck.org/article/abs/tacs.2025.224386 KW - COVID-19 vaccines KW - Tweets KW - sentiment analysis (SA) KW - Naïve Bayes (NB) KW - natural language processing (NLP) KW - k-means clustering AB - Public opinion on COVID-19 vaccines strongly affects vaccination uptake. This study analyzes the sentiment of tweets about COVID-19 vaccines. Tweets from December 2021 were collected with the Twitter API, stored in a CSV file, and preprocessed with natural language processing techniques. A Naïve Bayes (NB) classifier was used for supervised classification and reached an accuracy of 90%. The study has three objectives: 1) data extraction and preprocessing, 2) sentiment analysis of people's views, and 3) evaluation of the NB classifier. Of the tweets, 36.82% are positive, 12.97% are negative, and 50.21% are neutral. The large neutral share suggests that many people may still be uncertain about vaccination and points to the need for targeted awareness programs. In addition, k-means clustering was used to determine severity levels, which produced high-positive, low-positive, high-negative, and low-negative clusters. On the same dataset, the NB classifier outperformed SVM, multinomial NB, random forest, and gradient boosting in accuracy. The findings can help authorities and public health initiatives address prevailing doubts and encourage vaccination, and they can support the control and prevention of future pandemics. SN - 3068-7969 PB - Institute of Central Computation and Knowledge LA - English ER -
@article{Khan2026Opinion,
author = {Maaz Khan and Inayat Khan},
title = {Opinion Severity Prediction about Covid-19 Vaccination using Twitter Sentiments Analysis},
journal = {ICCK Transactions on Advanced Computing and Systems},
year = {2026},
volume = {2},
number = {4},
pages = {291-299},
doi = {10.62762/TACS.2025.224386},
url = {https://www.icck.org/article/abs/tacs.2025.224386},
abstract = {Public opinion on COVID-19 vaccines strongly affects vaccination uptake. This study analyzes the sentiment of tweets about COVID-19 vaccines. Tweets from December 2021 were collected with the Twitter API, stored in a CSV file, and preprocessed with natural language processing techniques. A Naïve Bayes (NB) classifier was used for supervised classification and reached an accuracy of 90\%. The study has three objectives: 1) data extraction and preprocessing, 2) sentiment analysis of people's views, and 3) evaluation of the NB classifier. Of the tweets, 36.82\% are positive, 12.97\% are negative, and 50.21\% are neutral. The large neutral share suggests that many people may still be uncertain about vaccination and points to the need for targeted awareness programs. In addition, k-means clustering was used to determine severity levels, which produced high-positive, low-positive, high-negative, and low-negative clusters. On the same dataset, the NB classifier outperformed SVM, multinomial NB, random forest, and gradient boosting in accuracy. The findings can help authorities and public health initiatives address prevailing doubts and encourage vaccination, and they can support the control and prevention of future pandemics.},
keywords = {COVID-19 vaccines, Tweets, sentiment analysis (SA), Naïve Bayes (NB), natural language processing (NLP), k-means clustering},
issn = {3068-7969},
publisher = {Institute of Central Computation and Knowledge}
}
Article Metrics
Publisher's Note
ICCK stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and Permissions
Copyright © 2026 by the Author(s). Published by Institute of Central Computation and Knowledge. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made.
Portico