Main Article Content


COVID-19 or Coronavirus disease 2019 is currently a pandemic that is spreading very quickly throughout the world, including Indonesia. Various handling and policies have been carried out, one of which is called “PPKM” policy or what can also be called the Enforcement of Restrictions on Community Activities issued by the Indonesian government. “PPKM” is currently one of the topics that is often discussed by the public, one of which is on the Twitter social media platform. The existence of opinions given by the community, it is necessary to have a sentiment analysis. Sentiment analysis is an analytical process obtained from various social media platforms and the internet. The aim is to find out how the public's sentiment towards the implementation of “PPKM” policies in Indonesia is through tweets and comments on the Twitter social media platform. In this study, the process of analyzing public opinion regarding the “PPKM” policy will be carried out by classifying opinions into 3 sentiments, namely positive, negative or neutral. Classification is done using the K-Nearest Neighbor algorithm. The K-Nearest Neighbor (K-NN) algorithm is a classification method for a set of data based on previously classified data learning. Included in supervised learning, where the results of the new query instance are classified based on the majority of the distance proximity of the categories in K-NN. The results of data preprocessing and sentiment classification, in the first test positive sentiment 37.6% of 261 data, negative sentiment 65.9% of 636 data and neutral sentiment 9.


Sentiment Analysis, K-Nearest Neighbor, PPKM, Covid-19

Article Details

How to Cite
Khoirunnita, A., & Kusnawi. (2021). Analysis of Indonesian Public Opinion Sentiment on Policy on Twitter Social Media “PPKM” Using K-Nearest Neighbor. TEPIAN, 2(4), 156-160.


  1. Abrar, M. F., Arefin, M. S., & Hossain, M. S. (2019, February). A framework for analyzing real-time tweets to detect terrorist activities. In 2019 International Conference on Electrical, Computer and Communication Engineering (ECCE) (pp. 1-6). IEEE.
  2. Alasadi, S. A., & Bhaya, W. S. (2017). Review of data preprocessing techniques in data mining. Journal of Engineering and Applied Sciences, 12(16), 4102-4107.
  3. Ali, M., Jung, L. T., Abdel-Aty, A. H., Abubakar, M. Y., Elhoseny, M., & Ali, I. (2020). Semantic-k-NN algorithm: an enhanced version of traditional k-NN algorithm. Expert Systems with Applications, 151, 113374.
  4. Astari, NMAJ, Dewa Gede Hendra Divayana, & Gede Indrawan. (2020). Sentiment Analysis of Twitter Documents Regarding the Impact of the Corona Virus Using the Naive Bayes Classifier Method. Journal of Systems and Informatics (JSI), 15(1), 27–29.
  5. Bošnjak, M., Oliveira, E., Martins, J., Mendes Rodrigues, E., & Sarmento, L. (2012, April). Twitterecho: a distributed focused crawler to support open research with twitter data. In Proceedings of the 21st international conference on World Wide Web (pp. 1233-1240).
  6. Chikh, M. A., Saidi, M., & Settouti, N. (2012). Diagnosis of diabetes diseases using an Artificial Immune Recognition System2 (AIRS2) with fuzzy K-nearest neighbor. Journal of medical systems, 36(5), 2721-2729.
  7. Gabielkov, M., Ramachandran, A., Chaintreau, A., & Legout, A. (2016, June). Social clicks: What and who gets read on Twitter?. In Proceedings of the 2016 ACM SIGMETRICS international conference on measurement and modeling of computer science (pp. 179-192).
  8. Imam, Z. (2021). Strategy Analysis UKM of Government Policy in Implementing Restrictions of Community Activities (PPKM) to Handle the Covid-19 Pandemic. Budapest International Research and Critics Institute (BIRCI-Journal): Humanities and Social Sciences, 4(3), 6151-6160.
  9. Miharja, M., Salim, E., Nachrawi, G., Putranto, R. D., & Hendrawan, A. (2021). Implementation of Emergency Public Activity Restrictions (PPKM) in Accordance With Human Rights and Pancasila Principles. Budapest International Research and Critics Institute (BIRCI-Journal): Humanities and Social Sciences, 4(3), 6855-6866.
  10. Mukhtadi, M., Prayitno, A., & El Harryy, P. S. F. (2021). Management strategy of the government of Indonesia in handling the Covid-19 pandemic. Technium Social Sciences Journal, 22, 455-462.
  11. Napitu, U., Corry, & Matondang, MKD (2021). Socialization of restrictions on the implementation of micro community activities “PPKM” in the bah Kapul sub-district. Community Development Journal, 2(2), 232–241.
  12. Nayak, A. S., Kanive, A. P., Chandavekar, N., & Balasubramani, R. (2016). Survey on pre-processing techniques for text mining. International Journal of Engineering and Computer Science, 5(6), 16875-16879.
  13. Nurjanah, WE, Perdana, RS, & Fauzi, MA (2017). Sentiment Analysis of Television Shows Based on Public Opinion on Twitter Social Media using the K-Nearest Neighbor Method and Weighting the Number of Retweets. Journal of Information Technology and Computer Science Development (J-PTIIK) Universitas Brawijaya, 1(12), 1750–1757.
  14. Pratama, B., Saputra, D. D., Novianti, D., Purnamasari, E. P., Kuntoro, A. Y., Gata, W., ... & Budilaksono, S. (2019, May). Sentiment Analysis of the Indonesian Police Mobile Brigade Corps Based on Twitter Posts Using the SVM and NB Methods. In Journal of Physics: Conference Series (Vol. 1201, No. 1, p. 012038). IOP Publishing.
  15. Regulation of the Ministry of Home Affairs (Permendagri). (2020). Regulation of the Ministry of Home Affairs (Permendagri) concerning Amendments to Regulation of the Minister of Home Affairs Number 54 of 2019 concerning Funding for the Election of Governors, Regents, and Mayors Sourced from Regional Revenue and Expenditure Budgets.
  16. Salim, J. N., Trisnawarman, D., & Imam, M. C. (2020, July). Twitter users opinion classification of smart farming in Indonesia. In IOP Conference Series: Materials Science and Engineering (Vol. 852, No. 1, p. 012165). IOP Publishing.
  17. Sari, R. (2020). Sentiment Analysis in the Review of Fantasy World Tourism Objects Using the K-Nearest Neighbor (K-Nn) Algorithm. EVOLUTION: Journal of Science and Management, 8(1), 10–17.
  18. Son, J., Lee, H. K., Jin, S., & Lee, J. (2019). Content features of tweets for effective communication during disasters: A media synchronicity theory perspective. International Journal of Information Management, 45, 56-68.
  19. Toharudin, T., Pontoh, R. S., Caraka, R. E., Zahroh, S., Kendogo, P., Sijabat, N., ... & Pardamean, B. (2021). National Vaccination and Local Intervention Impacts on COVID-19 Cases. Sustainability, 13(15), 8282.
  20. Zheng, Q., Wu, Z., Cheng, X., Jiang, L., & Liu, J. (2013). Learning to crawl deep web. Information Systems, 38(6), 801-819.