Sentiment Analysis Related To Covid-19 Vaccination On Social Media Using The K-Nearest Neighbor (K-NN) Method
Abstract
Coronavirus 19 (COVID-19) has become a topic of great concern in the past two years. To anticipate the spread of the virus, the government has made various efforts, one of which is by procuring a COVID-19 vaccination to increase the body's immunity. In carrying out the program, the government urges the public to use social media as a means of disseminating information regarding the COVID-19 vaccination. Facebook is one of the most popular social media and is chosen by agencies as a medium of information. Information regarding the vaccination is shared by the Ministry of Health of the Republic of Indonesia through its Facebook Page and the public can provide opinions in the form of comments. Given that the comments are numerous and lengthy if you have to read the manual, it is difficult to classify which one corresponds to the positive, negative or neutral opinion class, so a system is needed to analyze them. This sentiment analysis system uses the K-Nearest Neighbor (K-NN) method to classify positive, negative and neutral opinions. This study uses 750 comments obtained from posts in November 2021 with the keywords 'vaccination' and 'vaccine', with the distribution of 700 training data and 50 test data. Furthermore, the comments are pre-processed with the stages of case folding, filtering, tokenizing, normalization, stopwords and stemming, then weighted using the TF-IDF feature. System testing is carried out using the K-Nearest Neighbor (K-NN) method with a value of k = 1, k = 3, k = 5, k = 7 and k = 9 . 1 and f-measure of 0.71428571428571. Meanwhile, the lowest accuracy value is at the value of k = 7 and k = 9 with an accuracy of 0.66 and an error rate of 0.34.
Downloads
References
F.F. Rachman and S. Pramana, "Analysis of Pro and Contra Sentiment of Indonesian Society regarding COVID-19 Vaccination on Twitter Social Media," Indonesian Of Health Information Management Journal, pp. 100-109, 2019.
L. Patria and K. Yulianto, "Utilization of Facebook to Support Independent Online Teaching and Learning Activities," National Seminar FMIPA – UT,2011.
Tempo.Co, https://tekno.tempo.co/, accessed on November 6, 2021 at 17:17 WIB.
I. Kurniasari, Kusrini and H. Al-Fatta, "Facebook Comment Sentiment Analysis Based on Lexicon and Support Vector Machine, " Journal of Science and Technology (SAINTEKBU),pp.40-44, 2020.
K. Permana, et al., "Hotel Visitor Sentiment Analysis Using K-Nearest Neighbor Case Study of Pop! Hotel Surabaya," Journal of Computer Science and Business (JIKB), pp.159-166, 2021.
A. Salam, et al., "Sentiment Analysis of Facebook Social Media Comment Data with K-Nearest Neighbor (Case Study on J&T Ekspress Indonesia Freight Forwarding Service Account)," Proceedings of SINTAK 2018, pp.480-486, 2018.
N. Febriyanti, et al., "The Relationship between Knowledge Level and Willingness for COVID-19 Vaccination in Residents of Dukuh Menanggal Village, Surabaya City," 3rd National Seminar on Research and Community Service Results (SNHRP-III 2021), pp.36-42, 2021.
Sampang Regional Hospital, http://rsud.sampangkab.go.id/berita/detail/pentingnya-vaksinasi-dimasa-pandemi-covid19 , accessed on November 6, 2021 at 19:20 WIB.
R.N Rahayu dan Sensusiyati, "COVID-19 Vaccine in Indonesia: Analysis of Hoax News," Intelektiva: Journal of Economics, Social & Humanities, pp. 39-49, 2021.
A. Herdhianto. "Sentiment Analysis Using Naive Bayes Classifier (NBC) on Tweets About Zakat," Thesis: Syarif Hidayatullah State Islamic University, 2020.
R. Feldman and J. Sanger, "The Text Mining Handbook Advanced Approaches in Analyzing Unstructured Data," New York: Cambridge University Press, 2007.
N.K Sahputra, "Classifying Cyberbullying from Twitter Social Media Using the K-Nearest Neighbor Classification Algorithm and Lexicon Approach, " Thesis: Sanata Dharma University, 2020.
M. Furqan, et al., "Sentiment Analysis Using Context Based Fuzzy Linguistic Hedges," Proceedings of the International Conference of Computer, Environment, Social Science, Engineering and Technology (ICEST), pp.160-162, 2016.
B. Liu, "Sentiment Analysis and Opinion Mining," Chicago: Graeme Hirst Morgan & Claypool Publishers, 2016.
M.I. Aditama, et al., "Analysis of Sentiment Classification of Twitter Social Media Users Regarding the Procurement of the COVID-19 Vaccine," Journal of Information Engineering and Educational Technology, pp. 90-92, 2020.
A. Masruroh, et al., "Comparison of the Performance of the Naive Bayes Algorithm and the K-NN Lexicon Approach on Sentiment Analysis on Twitter Media," National Seminar on Physics, University of Riau IV (SNFUR-4), pp.1-6, 2019.
A. Indriani, "Classification of Forum Data Using the Naive Bayes Classifier Method," National Seminar on Information Technology Applications (SNATI), pp. 5-10, 2014.
A. Deviyanto and M.D Wahyudi, "Application of Sentiment Analysis on Twitter Users Using the K-Nearest Neighbor Method, " JISKa (Sunan Kalijaga Informatics Journal), pp. 1-14, 2018.
A. Kurniawan, et al., "Implementation of the K-Nearest Neighbor Algorithm on Restaurant Review Sentiment Analysis with Indonesian Language Text," National Seminar on nformation Technology Applications (SNATi), pp. 27-32, 2019.
B. Liu, "Sentiment Analysis and Subjectivity," USA: Graeme Hirst Morgan & Claypool Publishers, 2012.
F. Rahmat, et al.,"Comparison of User Generated Text Data Extraction Tools," Journal of Social Sciences and Humanities Universiti Kebangsaan Malaysia (e-Bangi), pp. 57-70, 2020.
M.M. Rizki, "Sentiment Analysis of Automotive Products from Twitter Using a Combination of the K-Nearest Neighbor Algorithm and the Lexicon Approach (Case Study: Toyota Cars)," Thesis: Syarif Hidayatullah State Islamic University, 2019.
B. Santosa," Data Mining: Data Utilization Techniques for Business Need, " Graha Ilmu, 2007.
R. Sari, "Sentiment Analysis on Dunia Fantasi Tourist Attraction Reviews Using the K-Nearest Neighbor (K-NN) Algorithm, " Evolution: Journal of Science and Management, pp. 10-17, 2020.
D.B. Tambunan, "Sentiment Analysis of MLM Company Consultant Satisfaction Using the Support Vector Machine (SVM) Method, " Medan: USU Thesis Repository, 2021.
Copyright (c) 2025 Amanda Novrianty, Mhd. Furqan, Sriani Sriani

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
This is an open-access article distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License which permits unrestricted use, distribution, and reproduction in any medium. Users are allowed to read, download, copy, distribute, search, or link to full-text articles in this journal without asking by giving appropriate credit, provide a link to the license, and indicate if changes were made. All of the remix, transform, or build upon the material must distribute the contributions under the same license as the original.