Religious Hate Speech Detection Using Naïve Bayes for Religious Moderation on Social Media X
DOI:
https://doi.org/10.55537/cosie.v5i4.1978Keywords:
Hate Speech, Naïve Bayes, Natural Language Processing, Religious Moderation, TF-IDFAbstract
The escalation of religious hate speech on social media X threatens social cohesion and demands transparent automated text screening methods. This study evaluates the performance of the Multinomial Naïve Bayes algorithm combined with unigram-bigram Term Frequency-Inverse Document Frequency (TF-IDF) feature weighting for preliminary screening of religious discourse on X. A corpus of 604 Indonesian-language tweets was collected using targeted keywords between 2022 and 2026, filtered from 1,500 raw entries. Data were annotated into religious hate speech (29.30%) and moderate/neutral discourse (70.70%) through rule-based supervision combined with independent human validation (Cohen's Kappa = 0.84). Following text preprocessing, 3,000 discriminative features utilizing sublinear TF scaling were fitted exclusively on the training set to prevent data leakage. Evaluation using a 90:10 stratified split (seed 42) achieved an overall accuracy of 83.61% across 61 test samples. The hate speech class reached 83.33% precision, 55.56% recall, and a 66.67% F1-score, while the moderate class recorded 83.67% precision, 95.35% recall, and an 89.13% F1-score. Given the constrained single-platform corpus and moderate recall sensitivity, this model is positioned as an interpretable preliminary screening aid to support human verifiers in digital religious moderation.
Downloads
References
[1] A. Rafiq, "Dampak Media Sosial Terhadap Komunikasi dan Interaksi Sosial Masyarakat," Jurnal Komunikasi Massa, vol. 8, no. 1, pp. 18–29, 2021.
[2] U. Surapati and A. Y. Zulkarnain, "Implementation of the Naïve Bayes Method to Detect Hate Speech on Twitter," INTECOMS: Journal of Information Technology and Computer Science, vol. 6, no. 2, pp. 451–460, 2023.
[3] F. Poletto, V. Basile, M. Sanguinetti, C. Bosco, and V. Patti, "Resources and benchmark corpora for hate speech detection: A systematic review," Data Mining and Knowledge Discovery, vol. 35, no. 6, pp. 2480–2536, 2021, doi: 10.1007/s10618-021-00787-8.
[4] A. Ramponi, B. Testa, S. Tonelli, and E. Jezek, "Addressing religious hate online: From taxonomy creation to automated detection," PeerJ Computer Science, vol. 8, p. e720, 2022, doi: 10.7717/peerj-cs.720.
[5] I. D. Yudhanata and E. Sudarmilah, "Analisis Sentimen Terhadap Isu Islamofobia pada Platform Twitter Menggunakan Metode Klasifikasi Naïve Bayes," Jurnal Emitor: Jurnal Ilmiah Bidang Teknik Elektro, vol. 24, no. 1, pp. 1–13, 2024.
[6] I. Afdhal, R. Kurniawan, I. Iskandar, and R. Salambue, "Penerapan Algoritma Random Forest Untuk Analisis Sentimen Komentar di Youtube Tentang Islamofobia," Jurnal Nasional Komputasi dan Teknologi Informasi (JNKTI), vol. 5, no. 1, pp. 122–130, 2022, doi: 10.32672/jnkti.v5i1.4012.
[7] T. Saputra, K. Aeni, and N. M. Saraswati, "Indonesia Hate Speech Text Classification Using Improved K-Nearest Neighbor with TF-IDF-ICSpF," Scientific Journal of Informatics, vol. 11, no. 1, pp. 21–30, 2024, doi: 10.15294/sji.v11i1.48085.
[8] C. C. Aggarwal and C. Zhai, Mining Text Data. Boston, MA: Springer Science & Business Media, 2012.
[9] D. Jurafsky and J. H. Martin, Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition, 3rd ed. Upper Saddle River, NJ: Prentice Hall, 2024.
[10] B. Liu, Sentiment Analysis and Opinion Mining. San Rafael, CA: Morgan & Claypool Publishers, 2012.
[11] A. W. Nasution, "Hate Speech Detection Using Long Short-Term Memory and Naïve Bayes: A Comparative Study," Journal of Applied Information Technology and Computer Science, vol. 3, no. 2, pp. 88–97, 2023.
[12] K. Kowsari, K. Jafari Meimandi, M. Heidarysafa, S. Mendu, L. Barnes, and D. Brown, "Text Classification Algorithms: A Survey," Information, vol. 10, no. 4, p. 150, 2019, doi: 10.3390/info10040150.
[13] D. C. Asogwa, C. I. Chukwuneke, C. C. Ngene, and G. N. Anigbogu, "Hate Speech Classification Using SVM and Naïve Bayes," IOSR Journal of Computer Engineering, vol. 24, no. 1, pp. 27–34, 2022, doi: 10.9790/0050-09012734.
[14] H. A. Santoso, E. H. Rachmawanto, dan D. R. I. M. Setiadi, "Sentiment Analysis and Text Classification on Social Media Using Supervised Naïve Bayes Models," Jurnal Teknik Informatika (Jutif), vol. 4, no. 3, pp. 512–520, 2023, doi: 10.52436/1.jutif.2023.4.3.982.
[15] N. T. Dayanto, "Application of Naïve Bayes Algorithm for Hate Speech Detection in Indonesian Social Media Text," Journal of Information Technology and Computer Science, vol. 9, no. 1, pp. 55–64, 2024.
[16] Y. HaCohen-Kerner, D. Miller, and Y. Yigal, "The influence of preprocessing on text classification using a bag-of-words representation," PLOS ONE, vol. 15, no. 5, p. e0232525, 2020, doi: 10.1371/journal.pone.0232525.
[17] R. Farhan, R. Pohan, D. E. Ratnawati, and I. Arwani, "Implementasi Algoritma Support Vector Machine dan Model Bag-of-Words dalam Analisis Sentimen Mengenai Pilkada 2020 pada Twitter," Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 6, no. 10, pp. 4872–4879, 2022.
[18] N. Yusliani, S. A. Q. Aruda, M. D. Marieska, D. M. Saputra, and Abdiansyah, "The Effect of Chi-Square Feature Selection on Question Classification using Multinomial Naïve Bayes," Sinkron: Jurnal dan Penelitian Teknik Informatika, vol. 7, no. 4, pp. 2430–2436, 2022, doi: 10.33395/sinkron.v7i4.11788.
[19] L. Mayasari and D. Indarti, "Klasifikasi Topik Tweet Mengenai Covid Menggunakan Metode Multinomial Naïve Bayes dengan Pembobotan TF-IDF," Jurnal Ilmiah Informatika Komputer, vol. 27, no. 1, pp. 43–53, 2022, doi: 10.35760/ik.2022.v27i1.6184.
[20] R. Maulana, A. Voutama, and T. Ridwan, "Analisis Sentimen Ulasan Aplikasi MyPertamina pada Google Play Store Menggunakan Algoritma NBC," Jurnal Teknologi Terpadu, vol. 9, no. 1, pp. 42–48, 2023, doi: 10.54914/jtt.v9i1.609.
[21] N. Meilani, M. Furqan, and Suhardi, "Analisis Sentimen Pengguna Aplikasi BSI Mobile Akibat Ransomware Menggunakan Algoritma Support Vector Machine," Jurnal Informatika dan Teknologi (INFOTECH), vol. 5, no. 1, pp. 42–51, 2024, doi: 10.37373/infotech.v5i1.1102.
[22] S. A. S. Mola, N. D. Rumlaklak, and D. P. N. Polly, Analisis Sentimen dengan Metode Random Forest. Kupang: Kaizen Media Publishing, 2024.
[23] M. Al-Emran, S. I. Malik, and M. N. Al-Kabi, "A systematic review of development environments and tools for data science," IEEE Access, vol. 8, pp. 142100–142115, 2020, doi: 10.1109/ACCESS.2020.3013898.
[24] J. M. Perkel, "Reactive, reproducible, collaborative: Computational notebooks transform data science," Nature, vol. 593, no. 7857, pp. 156–157, 2021, doi: 10.1038/d41586-021-01174-w.
[25] K. Gallaba, H. Hata, and K. Matsumoto, "Characterizing the extension ecosystem of Visual Studio Code," Empirical Software Engineering, vol. 27, no. 6, p. 138, 2022, doi: 10.1007/s10664-022-10183-8.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Aidil Halim Lubis, Ismail Ismail, Dodyk Fahlome, Dio Ananda

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



