Analisis Sentimen Calon Gubernur Jawa Tengah 2024 Menggunakan Metode Naïve Bayes

Authors

  • Martin Nuh Hanan Universitas Muhammadiyah Purworejo
  • Hamid Muhammad Jumasa Universitas Muhammadiyah Purworejo
  • Ike Yunia Pasa Universitas Muhammadiyah Purworejo

DOI:

https://doi.org/10.37859/jf.v15i3.10184
Keywords: analisis sentimen, pemilihan gubernur, media sosial x, naïve bayes, tweet-harvest

Abstract

Social media platform X (formerly Twitter) has become a public space where people can freely express their opinions, including in the context of regional elections. These opinions can be processed into useful information for decision-makers, especially in political contexts. This study aims to analyze public sentiment toward the candidates for Governor of Central Java for the 2024–2029 period using the Naïve Bayes method.

The data was collected through a crawling process on X using Tweet-Harvest and relevant keywords. The raw data then underwent preprocessing, including cleaning, case folding, normalization, stopword removal, tokenization, and stemming. Sentiment labeling was performed automatically using the TextBlob library, which classified tweets into positive, negative, or neutral categories. Naïve Bayes was chosen for its effectiveness and efficiency in text classification tasks.

The results showed model accuracy of 90.28% for Andika Perkasa and 84.51% for Ahmad Luthfi, using a 90:10 training-to-testing data ratio. Out of 452 total tweets, Andika Perkasa received 350 positive sentiments, slightly more than Ahmad Luthfi, who received 336. These findings indicate that public perception toward both candidates is generally positive, with a slight edge for Andika Perkasa.

Downloads

Download data is not yet available.

References

A. Rizal, “Pemilukada Serentak 2024: Dinamika, Urgensi dan Tantangan,” Proc. 1st Conf. Soc. Polit. Cult. 2022, vol. 1, pp. 136–140, 2022.

D. Permatasari, K. A. Nasution, M. R. Khairi, and F. F. Tambunan, “Opini Publik dalam Sistem Demokrasi,” vol. 7482, pp. 41–46, 2025.

M. Zaskya, A. Boham, and L. J. H. Lotulung, “Twitter Sebagai Media Mengungkapkan Diri Pada Kalangan Milenial Twitter as a Media for Self-Disclosure Among Millennials,” pp. 1–8, 2020.

D. D. Ayani, H. S. Pratiwi, and H. Muhardi, “Implementasi Web Scraping untuk Pengambilan Data pada Situs Marketplace,” vol. 7, no. 4, pp. 257–262, 2019.

F. Liantoni and H. Nugroho, “Klasifikasi Daun Herbal Menggunakan Metode Naïve Bayes Classifier dan K- Nearest Neighbor,” vol. 5, no. 1, pp. 9–16, 2015.

Y. Sunardhi, “Propaganda di Media Sosial,” pp. 1–11, 2025, [Online]. Available: https://www.yosephsunardhi.com/2025/01/propaganda-di-media-sosial.html

S. A. F. Syifa Khairunnisa, Adiwijaya, “Pengaruh Text Preprocessing terhadap Analisis Sentimen Komentar Masyarakat pada Media Sosial Twitter ( Studi Kasus Pandemi,” vol. 5, no. April, pp. 406–414, 2021, doi: 10.30865/mib.v5i2.2835.

R. Vindua and A. U. Zailani, “Analisis Sentimen Pemilu Indonesia Tahun 2024 Dari Media Sosial Twitter Menggunakan Python,” JURIKOM (Jurnal Ris. Komputer), vol. 10, no. 2, p. 479, 2023, doi: 10.30865/jurikom.v10i2.5945.

T. Ridwansyah, “Implementasi Text Mining Terhadap Analisis Sentimen Masyarakat Dunia Di Twitter Terhadap Kota Medan Menggunakan K-Fold Cross Validation Dan Naïve Bayes Classifier,” KLIK Kaji. Ilm. Inform. dan Komput., vol. 2, no. 5, pp. 178–185, 2022, doi: 10.30865/klik.v2i5.362.

N. Saputra, T. B. Adji, and A. E. Permanasari, “Analisis Sentimen Data Presiden Jokowi Dengan Preprocessing Normalisasi Dan Stemming Menggunakan Metode Naive Bayes Dan Svm,” J. Din. Inform., vol. 5, no. November, pp. 1–13, 2015.

A. F. Hidayatullah, “PENGARUH STOPWORD TERHADAP PERFORMA KLASIFIKASI TWEET BERBAHASA INDONESIA,” vol. 1, no. 1, pp. 1–4, 2016.

S. Ramadhani, D. Azzahra, U. I. Negeri, and S. S. Kasim, “Comparison of K-Means and K-Medoids Algorithms in Text Mining based on Davies Bouldin Index Testing for Classification of Student ’s Thesis,” vol. x, no. x, pp. 24–33, 2022.

M. U. Albab, Y. K. P, and M. N. Fawaiq, “Optimization of the Stemming Technique on Text preprocessing President 3 Periods Topic,” vol. 20, no. 2, pp. 1–10, 2023.

M. Faruqziddan, E. H. S. Aulia, S. D. Azzahra, and P. B. Utomo, “Perbandingan Skenario Balancing Oversampling dan Undersampling dalam Klasifikasi Resiko Kambuh Kanker Tiroid menggunakan Algoritma SVM Linear,” JAMI J. Ahli Muda Indones., vol. 5, no. 2, pp. 172–182, 2024, doi: 10.46510/jami.v5i2.320.

M. A. Hasan, “Ensemble Language Models for Multilingual Sentiment Analysis,” pp. 1–9, 2024, [Online]. Available: http://arxiv.org/abs/2403.06060

A. Lavanya, W. Ali, D. J. Lloret, S. D. Vidya Sagar, and C. Bharadwaj, “A Real-time Visualization of Global Sentiment Analysis on Declaration of Pandemic,” International Journal of Computer Engineering in Research Trends, vol. 9, no. 6. pp. 104–113, 2022. doi: 10.22362/ijcert/2022/v9/i06/v9i0602.

S. Puad, G. Garno, and A. Susilo Yuda Irawan, “Analisis Sentimen Masyarakat Pada Twitter Terhadap Pemilihan Umum 2024 Menggunakan Algoritma Naïve Bayes,” JATI (Jurnal Mhs. Tek. Inform., vol. 7, no. 3, pp. 1560–1566, 2023, doi: 10.36040/jati.v7i3.6920.

M. K. Khatami, “Analisis Sentimen Twitter Menggunakan Naive Bayes dan Support Vector Machine Terhadap KPU Pada Pemilihan Umum Presiden 2024,” 2024.

M. Galih Pradana, “Penggunaan Fitur Wordcloud Dan Document Term Matrix Dalam Text Mining,” J. Ilm. Infromatika, vol. 08, no. 01, pp. 38–43, 2020.

Downloads

Published

2025-12-31