Analisis Pengaruh Preprocessing Regex dan Cosine Similarity terhadap Performa IndoBERT dalam Klasifikasi Berita Hoaks Berbahasa Indonesia

Authors

  • Minggar P. D. Ramadhan Universitas Islam Negeri Maulana Malik Ibrahim, Malang
  • Zainal Abidin Universitas Islam Negeri Maulana Malik Ibrahim, Malang
  • Mochamad Imamudin Universitas Islam Negeri Maulana Malik Ibrahim, Malang

DOI:

https://doi.org/10.30865/jurikom.v13i3.9730

Keywords:

Text Preprocessing, Regex, Cosine Similarity, IndoBERT, Classification

Abstract

The rapid growth of online media has significantly improved access to information, but it has also accelerated the spread of misinformation and hoax news. In hoax detection research, datasets are commonly derived from fact-checking platforms, which typically contain structured components such as claims, narratives, and clarification statements explicitly indicating that certain information is false. The presence of such clarification sentences has the potential to cause bias, a condition in which the model learns text patterns that explicitly indicate the label, thereby reducing the model's ability to fully understand the content of the news. This study aims to analyze the impact of preprocessing techniques based on regular expression (regex) and cosine similarity on the performance of the IndoBERT model for Indonesian hoax news classification. Both approaches are employed to identify and handle clarification sentences, enabling the model to focus more on contextual and semantic understanding of the news content. Experimental results show that the cosine similarity-based preprocessing outperforms the regex-based approach, achieving accuracy, precision, recall, and F1-score of 92.8%. In comparison, the regex-based method obtains an accuracy of 90.7%, precision of 91.3%, recall of 90.7%, and F1-score of 90.6%. These findings indicate that the semantic-based approach is more effective in handling linguistic variability and reducing potential bias caused by explicit clarification patterns. Overall, this study highlights the importance of appropriate preprocessing strategies in improving classification performance and provides insights into the impact of clarification statements in fact-checking datasets on transformer-based hoax detection models

References

[1] F. L. Gaol, A. Maulana, and T. Matsuo, “News consumption patterns on Twitter: fragmentation study on the online news media network,” Heliyon, vol. 6, no. 10, Oct. 2020, doi: 10.1016/j.heliyon.2020.e05169.

[2] D. Gaozhao, “Flagging fake news on social media: An experimental study of media consumers’ identification of fake news,” Gov. Inf. Q., vol. 38, no. 3, p. 101591, Jul. 2021, doi: 10.1016/j.giq.2021.101591.

[3] S. Chen, L. Xiao, and A. Kumar, “Spread of misinformation on social media: What contributes to it and how to combat it,” Comput. Human Behav., vol. 141, p. 107643, Apr. 2023, doi: 10.1016/j.chb.2022.107643.

[4] S. A. Althubiti, F. Alenezi, and R. F. Mansour, “Natural Language Processing with Optimal Deep Learning Based Fake News Classification,” Computers, Materials and Continua, vol. 73, no. 2, pp. 3529–3544, 2022, doi: 10.32604/cmc.2022.028981.

[5] A. Tabassum and R. R. Patil, “A Survey on Text Pre-Processing & Feature Extraction Techniques in Natural Language Processing,” International Research Journal of Engineering and Technology, 2020, [Online]. Available: www.irjet.net

[6] F. Gereme, W. Zhu, T. Ayall, and D. Alemu, “Combating fake news in ‘low-resource’ languages: Amharic fake news detection accompanied by resource crafting,” Information (Switzerland), vol. 12, no. 1, pp. 1–9, Jan. 2021, doi: 10.3390/info12010020.

[7] A. Pardamean and H. F. Pardede, “Tuned bidirectional encoder representations from transformers for fake news detection,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 22, no. 3, pp. 1667–1671, Jun. 2021, doi: 10.11591/ijeecs.v22.i3.pp1667-1671.

[8] M. Y. Ridho and E. Yulianti, “From Text to Truth: Leveraging IndoBERT and Machine Learning Models for Hoax Detection in Indonesian News,” Jurnal Ilmiah Teknik Elektro Komputer dan Informatika, vol. 10, no. 3, pp. 544–555, Sep. 2024, doi: 10.26555/jiteki.v10i3.29450.

[9] S. M. Isa, G. Nico, and M. Permana, “IndoBERT for Indonesian Fake News Detection,” ICIC Express Letters, vol. 16, no. 3, pp. 289–297, Mar. 2022, doi: 10.24507/icicel.16.03.289.

[10] C. Jocelynne, L. Tobing, I. Lanang Wijayakusuma, L. Putu, and I. Harini, “Detection of Political Hoax News Using Fine-Tuning IndoBERT,” 2025. [Online]. Available: http://jurnal.polibatam.ac.id/index.php/JAIC

[11] L. A. Pekandi, R. G. Widjaja, A. Ananta, J. Harefa, and K. Jingga, “Evaluating IndoBERT for Indonesian Hoax News Detection: A Comparative Study with Ensemble and CNN-LSTM Models,” in Procedia Computer Science, Elsevier B.V., 2025, pp. 1625–1633. doi: 10.1016/j.procs.2025.09.105.

[12] Syarifah Ema Rahmaniah, Septiaji Eko Nugroho, Rupita, and Nikodemus Niko, “The Disinfodemic Mitigation Strategy of MAFINDO in Indonesia,” International Journal of Social Science, vol. 1, no. 6, pp. 879–888, Apr. 2022, doi: 10.53625/ijss.v1i6.1903.

[13] D. Rahmawan, I. Garnesia, and R. Hartanto, “Content Analysis of MAFINDO’s Fact Check articles during the 2015-2020 period: Classification of Themes, Channels, and Content Types,” Jurnal ASPIKOM, vol. 8, no. 2, Jul. 2023, doi: 10.24329/aspikom.v8i2.1267.

[14] F. Al-Quayed, D. Javed, N. Z. Jhanjhi, M. Humayun, and T. S. Alnusairi, “A Hybrid Transformer-Based Model for Optimizing Fake News Detection,” IEEE Access, vol. 12, pp. 160822–160834, 2024, doi: 10.1109/ACCESS.2024.3476432.

[15] A. Kunaefi, Z. Abidin, and R. Kusumawati, “Klasifikasi Berita Hoaks Bahasa Indonesia Menggunakan IndoBERT Fine-Tuning dengan Pendekatan Focal Loss pada Data Tidak Seimbang,” JIPI (Jurnal Ilmiah Penelitian dan Pembelajaran Informatika), vol. 10, no. 2, pp. 1706–1714, May 2025, doi: 10.29100/jipi.v10i2.7811.

[16] Z. Nagy, Regex Quick Syntax Reference. Berkeley, CA: Apress, 2018. doi: 10.1007/978-1-4842-3876-9.

[17] Q. Chen, A. Banerjee, Ç. Demiralp, G. Durrett, and I. Dillig, “Data Extraction via Semantic Regular Expression Synthesis,” Proceedings of the ACM on Programming Languages, vol. 7, no. OOPSLA2, Oct. 2023, doi: 10.1145/3622863.

[18] Z. H. Amur, Y. Kwang Hooi, H. Bhanbhro, K. Dahri, and G. M. Soomro, “Short-Text Semantic Similarity (STSS): Techniques, Challenges and Future Perspectives,” Mar. 01, 2023, MDPI. doi: 10.3390/app13063911.

[19] D. Iskandar and A. Kurniawati, “Analisis Perbandingan Teknik Word2vec dan Doc2vec dalam Mengukur Kemiripan Dokumen Menggunakan Cosine Similarity,” Jurnal Teknologi Informasi dan Ilmu Komputer, vol. 12, no. 1, pp. 133–144, Feb. 2025, doi: 10.25126/jtiik.2025129143.

[20] K. M. Kahloot and P. Ekler, “Algorithmic Splitting: A Method for Dataset Preparation,” IEEE Access, vol. 9, pp. 125229–125237, 2021, doi: 10.1109/ACCESS.2021.3110745.

[21] H. Ahmadian, T. F. Abidin, H. Riza, and K. Muchtar, “Hybrid Models for Emotion Classification and Sentiment Analysis in Indonesian Language,” Applied Computational Intelligence and Soft Computing, vol. 2024, 2024, doi: 10.1155/2024/2826773.

[22] L. F. Simanjuntak, R. Mahendra, and E. Yulianti, “We Know You Are Living in Bali: Location Prediction of Twitter Users Using BERT Language Model,” Big Data and Cognitive Computing, vol. 6, no. 3, Sep. 2022, doi: 10.3390/bdcc6030077.

[23] F.-E. Lagrari and Y. Elkettani, “Customized BERT with Convolution Model A New Heuristic Enabled Encoder for Twitter Sentiment Analysis,” IJACSA) International Journal of Advanced Computer Science and Applications, vol. 11, no. 10, 2020, [Online]. Available: www.ijacsa.thesai.org

[24] O. Rainio, J. Teuho, and R. Klén, “Evaluation metrics and statistical tests for machine learning,” Sci. Rep., vol. 14, no. 1, Dec. 2024, doi: 10.1038/s41598-024-56706-x.

[25] A. J. Keya, Md. A. H. Wadud, M. F. Mridha, M. Alatiyyah, and Md. A. Hamid, “AugFake-BERT: Handling Imbalance through Augmentation of Fake News Using BERT to Enhance the Performance of Fake News Classification,” Applied Sciences, vol. 12, no. 17, p. 8398, Aug. 2022, doi: 10.3390/app12178398.

[26] Z. Abidin, R. Munir, S. Akbar, R. Mandala, and D. H. Widyantoro, “Storychart: A Character Interaction Chart for Visualizing the Activities Flow,” INTERNATIONAL JOURNAL ON INFORMATICS VISUALIZATION, Dec. 2023, [Online]. Available: www.joiv.org/index.php/joiv

Additional Files

Published

2026-06-30

How to Cite

Ramadhan, M. P. D., Abidin, Z., & Imamudin, M. (2026). Analisis Pengaruh Preprocessing Regex dan Cosine Similarity terhadap Performa IndoBERT dalam Klasifikasi Berita Hoaks Berbahasa Indonesia. JURIKOM (Jurnal Riset Komputer), 13(3), 823–835. https://doi.org/10.30865/jurikom.v13i3.9730

Issue

Section

Articles