Predicting Handling Covid-19 Opinion using Naive Bayes and TF-IDF for Polarity Detection

  • Supangat Supangat Universitas 17 Agustus 1945, Surabaya, Indonesia
  • Mohd Zainuri Bin Saringat Universiti Tun Hussein Onn Malaysia, Johor, Malaysia
  • Mochamad Yovi Fatchur Rochman Universitas 17 Agustus 1945, Surabaya, Indonesia
Keywords: Covid-19, Naïve bayes, Predicting, Public opinion, TF-IDF, Twitter


There are many public responses about implementing government policies related to Covid-19. Some have positive and negative opinions, especially on the official social media portal of the government. Twitter is one social media where people are free to express their opinions. This study aims to find out the opinion of sentiment analysis on Twitter in implementing government policies related to Covid-19 to classify public opinion. Several stages in analyzing public sentiment are taken from the tweet data. The first step is data mining to get the tweets that will be analyzed later. Furthermore, cleaning tweet data and equalizing tweet data into lowercase. After that, perform the tweet's basic word search process and calculate its appearance frequency. Then calculate using the Naïve Bayes method and determine the sentiment classification of the tweet. The results showed that Indonesia's public sentiment about covid-19 prevention is neutral. The performance of the application shows an Accuracy value of 76.7%.  In conclusion this means that the Indonesian government needs to evaluate the policies taken to deal with COVID-19 to create positive opinions to create solid cooperation between the government and the government. Residents in tackling the COVID-19 outbreak.


Download data is not yet available.


[1] A. L. Fairuz, R. D. Ramadhani, and N. A. F. Tanjung, “Analisis Sentimen Masyarakat Terhadap COVID-19 Pada Media Sosial Twitter,” JURNAL DINDA, vol. 1, no. 1, pp. 42–51, 2021.
[2] S. Supangat and M. Bin Saringat, “Development of E-Learning System Using Felder and Silverman’s Index of Learning Styles Model,” International Journal of Advanced Trends in Computer Science and Engineering, vol. 9, no. 5, pp. 8554–8561, 2020, doi: 10.30534/ijatcse/2020/236952020.
[3] M. Ardan, F. F. Rahman, and G. B. Geroda, “The influence of physical distance to student anxiety on COVID-19, Indonesia,” Journal of Critical Reviews, vol. 7, no. 17, pp. 1126–1132, 2020, doi: 10.31838/jcr.07.17.141.
[4] A. Faesal, A. Muslim, A. H. Ruger, and K. Kusrini, “Sentimen Analisis Terhadap Komentar Konsumen Terhadap Produk Penjualan Toko Online Menggunakan Metode K-Means,” MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer, vol. 19, no. 2, pp. 207–213, May 2020, doi: 10.30812/matrik.v19i2.640.
[5] H. H. Hidayat, A. Ardiansyah, P. Arsil, and L. I. Rahmawati, “Pemetaan Kata Kunci dan Polaritas Sentimen Pengguna Twitter Terhadap Kehalalan Produk,” MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer, vol. 21, no. 1, pp. 1–10, Nov. 2021, doi: 10.30812/matrik.v21i1.1162.
[6] H. AlSalman, “An Improved Approach for Sentiment Analysis of Arabic Tweets in Twitter Social Media,” in 2020 3rd International Conference on Computer Applications & Information Security (ICCAIS), Mar. 2020, pp. 1–4, doi: 10.1109/ICCAIS48893.2020.9096850.
[7] J. Samuel, G. G. M. N. Ali, M. M. Rahman, E. Esawi, and Y. Samuel, “COVID-19 public sentiment insights and machine learning for tweets classification,” Information (Switzerland), vol. 11, no. 6, pp. 1–22, 2020, doi: 10.3390/info11060314.
[8] M. Alshaikh and M. Zohdy, “Sentiment Analysis for Smartphone Operating System: Privacy and Security on Twitter Data,” in 2020 IEEE International Conference on Electro Information Technology (EIT), Jul. 2020, pp. 366–369, doi: 10.1109/EIT48999.2020.9208303.
[9] I. C. Sari and Y. Ruldeviyani, “Sentiment Analysis of the Covid-19 Virus Infection in Indonesian Public Transportation on Twitter Data: A Case Study of Commuter Line Passengers,” in 2020 International Workshop on Big Data and Information Security (IWBIS), Oct. 2020, pp. 23–28, doi: 10.1109/IWBIS50925.2020.9255531.
[10] L. Mandloi and R. Patel, “Twitter Sentiments Analysis Using Machine Learninig Methods,” in 2020 International Conference for Emerging Technology (INCET), Jun. 2020, pp. 1–5, doi: 10.1109/INCET49848.2020.9154183.
[11] Kowsari, Jafari Meimandi, Heidarysafa, Mendu, Barnes, and Brown, “Text Classification Algorithms: A Survey,” Information, vol. 10, no. 4, pp. 1–68, Apr. 2019, doi: 10.3390/info10040150.
[12] A. H. Alamoodi et al., “Sentiment analysis and its applications in fighting COVID-19 and infectious diseases: A systematic review,” Expert Systems with Applications, vol. 167, no. April, pp. 1–13, Apr. 2021, doi: 10.1016/j.eswa.2020.114155.
[13] J. Samuel, M. M. Rahman, G. G. M. N. Ali, Y. Samuel, and A. Pelaez, “Feeling Like it is Time to Reopen Now? COVID-19 New Normal Scenarios Based on Reopening Sentiment Analytics,” SSRN Electronic Journal, no. May, 2020, doi: 10.2139/ssrn.3604802.
[14] E. D. Sri Mulyani, D. Rohpandi, and F. A. Rahman, “Analysis Of Twitter Sentiment Using The Classification Of Naive Bayes Method About Television In Indonesia,” in 2019 1st International Conference on Cybernetics and Intelligent System (ICORIS), Aug. 2019, pp. 89–93, doi: 10.1109/ICORIS.2019.8874896.
[15] V. L. Nguyen, D. Kim, V. P. Ho, and Y. Lim, “A new recognition method for visualizing music emotion,” International Journal of Electrical and Computer Engineering, vol. 7, no. 3, pp. 1246–1254, 2017, doi: 10.11591/ijece.v7i3.pp1246-1254.
[16] M. A. Iftikar and Y. Sibaroni, “Analisis Sentimen Twitter: Penanganan Pandemi Covid-19 Menggunakan Metode Hybrid Naïve Bayes, Decision Tree, dan Support Vector Machine,” in e-Proceeding of Engineering, 2022, pp. 1809–1816.
[17] F. Sidik, I. Suhada, A. H. Anwar, and F. N. Hasan, “Analisis Sentimen Terhadap Pembelajaran Daring dengan Algoritma Naïve Bayes Classifier,” Jurnal Linguistik Komputasional, vol. 5, no. 1, pp. 34–43, 2022.
[18] F. Al-Ishafani and R. Mubarok, “Analisis Sentimen Pengguna Twitter Terhadap Kebijakan Pemberlakuan Pembatasan Sosial Berskala Besar (Psbb) Dengan Metode Naïve Bayes,” Jurnal Siliwangi, vol. 7, no. 1, pp. 19–24, 2021.
[19] S. Hadianti et al., “Analisis Sentiment Covid-19 Di Twitter Menggunakan Metode Naive Bayes Dan SVM,” Jurnal Teknologi Informasi, vol. 6, no. 1, pp. 58–63, 2022.
[20] M. Syarifuddinn, “Analisis Sentimen Opini Publik Mengenai Covid-19 Pada Twitter Menggunakan Metode Naïve Bayes Dan Knn,” INTI Nusa Mandiri, vol. 15, no. 1, pp. 23–28, Aug. 2020, doi: 10.33480/inti.v15i1.1347.
[21] S. Efendi and P. Sihombing, “Sentiment Analysis of Food Order Tweets to Find Out Demographic Customer Profile Using SVM,” MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer, vol. 21, no. 3, pp. 583–594, Jul. 2022, doi: 10.30812/matrik.v21i3.1898.
How to Cite
Supangat, S., Saringat, M., & Rochman, M. (2023). Predicting Handling Covid-19 Opinion using Naive Bayes and TF-IDF for Polarity Detection. MATRIK : Jurnal Manajemen, Teknik Informatika Dan Rekayasa Komputer, 22(2), 173-184.