Analysis of Public Sentiment on Election Results using Naïve Bayes in Social Media X

Ahmad Syakir Muliana, Dinda Lestarini, Sarifah Putri Raflesia

Abstract


The objective of the research is to examine the public opinion regarding the 2024 Indonesian election results by applying Naïve Bayes to social media data obtained from platform X of Twitter. A dataset comprising 2,500 election-related tweets was obtained by web scraping and then subjected to tokenization, stopword elimination, stemming, and TF-IDF weighting for preprocessing. The application of the Synthetic Minority Oversampling Technique (SMOTE) was attempted to mitigate class imbalance. The performance of the Naïve Bayes model was assessed using Stratified K-Fold Cross-Validation. The model achieved an average accuracy of 66.90% on the test set and 80% during cross-validation. The results demonstrate successful categorization of positive sentiment, although the model encountered difficulties in precisely detection of negative and neutral sentiments. The results underscore significant consequences for policymakers and political parties in formulating effective communication strategies. Further study is advised to investigate sophisticated algorithms to improve the accuracy of sentiment classification, namely in detecting neutral sentiments.

Full Text:

PDF

References


A. R. Abdillah and F. N. Hasan, “Analisis Sentimen Terhadap Kandidat Calon Presiden Berdasarkan Tweets Di Sosial Media Menggunakan Naive Bayes Classifier,” SMATIKA J., vol. 13, no. 01, pp. 117–130, Jul. 2023, doi: 10.32664/smatika.v13i01.750.

Nehal, D. Jeet, V. Sharma, S. Mishra, C. Iwendi, and J. Osamor, “Twitter Sentiment Analysis and Emotion Detection Using NLTK and TextBlob,” 2023 4th Int. Conf. Comput. Autom. Knowl. Manag. ICCAKM 2023, 2023, doi: 10.1109/ICCAKM58659.2023.10449540.

J. Sihombing, “Klasifikasi Data Antroprometri Individu Menggunakan Algoritma Naïve Bayes Classifier,” BIOS J. Teknol. Inf. dan Rekayasa Komput., vol. 2, no. 1, pp. 1–10, Mar. 2021, doi: 10.37148/bios.v2i1.15.

A. Risma Alifvia, U. Saprudin, S. Dharma Wacana Metro, J. Kenanga No, K. Metro Barat, and K. Metro, “Analisis Sentimen Review Data Twitter Komisi Pemilihan Umum (Kpu) Menggunakan Metode Naïve Bayes,” J. Inf. dan Komput., vol. 11, no. 1, p. 2023, 2023.

H. Yuliansyah, S. A. Mulasari, S. Sulistyawati, F. A. Ghozali, and B. Sudarsono, “Sentiment Analysis of the Waste Problem based on YouTube comments using VADER and Deep Translator,” J. Media Inform. Budidarma, vol. 8, pp. 663–673, 2024, doi: 10.30865/mib.v8i1.6918.

M. D. Purbolaksono, F. D. Reskyadita, and A. A. Suryani, “Indonesian-text-classification-using-back-propagation-and-sastrawi-stemming-analysis-with-information-gain-for-selection-feature2020International-Journal-on-Advanced-Science-Engineering-and-Information-TechnologyOp.pdf,” vol. 10, no. 1, pp. 234–238, 2020.

Z. N. Maharani, A. Luthfiarta, and N. Z. Farsya, “Sentiment Analysis of the 2024 Indonesian Presidential Dispute Trial Election using SVM and Naïve Bayes on Platform X,” vol. 6, no. 1, pp. 440–449, 2024, doi: 10.47065/bits.v6i1.5380.

P. Meilina, “Penerapan Data Mining Dengan Metode Kalsifikasi Menggunakan,” Teknologi, vol. 7, no. March, pp. 10–20, 2022, [Online]. Available: http://jurnal.mdp.ac.id

J. Homepage et al., “Comparison of Sentiment Analysis Algorithms with SMOTE Oversampling and TF-IDF Implementation on Google Reviews for Public Health Centers,” MALCOM Indones. J. Mach. Learn. Comput. Sci., vol. 4, no. 3, pp. 1077–1086, 2024, [Online]. Available: https://journal.irpi.or.id/index.php/malcom/article/view/1459

H. H. Limbong, “Optimasi Analisis Sentimen Ulasan Aplikasi Amikom One Menggunakan SMOTE pada Algoritma Artificial Neural Network Optimization of Sentiment Analysis for Amikom One Application Reviews Using SMOTE with Artificial Neural Network Algorithm,” vol. 13, pp. 2048–2059, 2024.

J. Kimani, A. Karanjah, and P. Kihara, “Sentiment Classification of Safaricom PLC Social Media Sentiments on X(Formerly Twitter),” Asian J. Probab. Stat., vol. 26, no. 6, pp. 31–40, 2024, doi: 10.9734/ajpas/2024/v26i6622.

D. Lestarini, T. Rusdy, S. Iriyani, and S. P. Raflesia, “Detection of Indonesian wildlife sales and promotion through social media using machine learning approach,” Bull. Electr. Eng. Informatics, vol. 12, no. 6, pp. 3798–3804, 2023, doi: 10.11591/eei.v12i6.5418.

M. I. Syafii, “Sentimen analisis Pada Media Sosial Twitter Menggunakan Metode Naive Bayes Classifier (NBC),” J. Teknol. Pint., vol. 2, no. 7, pp. 1–11, 2022, [Online]. Available: http://teknologipintar.org/index.php/teknologipintar/article/view/207%0Ahttp://teknologipintar.org/index.php/teknologipintar/article/download/207/197

S. Prusty, S. Patnaik, and S. K. Dash, “SKCV: Stratified K-fold cross-validation on ML classifiers for predicting cervical cancer,” Front. Nanotechnol., vol. 4, no. August, pp. 1–12, 2022, doi: 10.3389/fnano.2022.972421.

G. Popoola, K. K. Abdullah, G. S. Fuhnwi, and J. Agbaje, “Sentiment Analysis of Financial News Data using TF-IDF and Machine Learning Algorithms,” 2024 IEEE 3rd Int. Conf. AI Cybersecurity, ICAIC 2024, no. February, 2024, doi: 10.1109/ICAIC60265.2024.10433843.

A. Apriani, H. Zakiyudin, and K. Marzuki, “Penerapan Algoritma Cosine Similarity dan Pembobotan TF-IDF System Penerimaan Mahasiswa Baru pada Kampus Swasta,” J. Bumigora Inf. Technol., vol. 3, no. 1, pp. 19–27, Jul. 2021, doi: 10.30812/bite.v3i1.1110.

Y. A. Singgalen, “KLIK: Kajian Ilmiah Informatika dan Komputer Comparative Analysis of DT and SVM Model Performance with SMOTE in Sentiment Classification,” Media Online, vol. 4, no. 5, pp. 2485–2494, 2024, doi: 10.30865/klik.v4i5.1828.

Y. Liu et al., “RoBERTa: A Robustly Optimized BERT Pretraining Approach,” no. 1, 2019, [Online]. Available: http://arxiv.org/abs/1907.11692

A. Deolika, K. Kusrini, and E. T. Luthfi, “Analisis Pembobotan Kata Pada Klasifikasi Text Mining,” J. Teknol. Inf., vol. 3, no. 2, p. 179, 2019, doi: 10.36294/jurti.v3i2.1077.

L. He, T. Yin, and K. Zheng, “They May Not Work! An evaluation of eleven sentiment analysis tools on seven social media datasets,” J. Biomed. Inform., vol. 132, no. February, 2022, doi: 10.1016/j.jbi.2022.104142.

M. Iqbal, A. Karim, and F. Kamiran, “Balancing prediction errors for robust sentiment classification,” ACM Trans. Knowl. Discov. Data, vol. 13, no. 3, 2019, doi: 10.1145/3328795.




DOI: https://doi.org/10.32520/stmsi.v13i6.4592

Article Metrics

Abstract view : 42 times
PDF - 27 times

Refbacks

  • There are currently no refbacks.


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.