Transfer Learning Methods for Hate Speech Detection in Bahasa Indonesia
DOI:
https://doi.org/10.25126/jitecs.2025101542Abstract
Communication is becoming more accessible with the growth and emergence of social media platforms. However, this can be misused, such as for spreading hate speech. Building an efficient hate speech detection model requires sufficient annotated data to train the model. However, this is difficult as it requires more data for low-resource languages like Bahasa Indonesia. To address this issue, we study whether the transfer learning method can yield improved results. This study performs extensive experiments to show that transfer learning methods are suitable for low-resource hate speech prediction. Our experimental results show that transferring knowledge using a multilingual pre-trained language model and translating hate speech datasets as additional data can improve the performance of detecting hate speech in Bahasa Indonesia. By using the XLM-RoBERTa-based hate speech model for transfer learning improved the F1-score for hate speech detection in Bahasa Indonesia by 78%. Meanwhile, translating the data from English as additional data for training and using the BERT model to detect hate speech in Bahasa Indonesia improved the F1-score from 60% to 69%. These results were statistically proven by the McNemar test and evaluated using the ROC-AUC score.
Downloads
References
1. MacAvaney, S., Yao, H. R., Yang, E., Russell, K., Goharian, N., & Frieder, O. (2019). Hate speech detection: Challenges and solutions. PloS one, 14(8), e0221152. https://doi.org/10.1371/journal.pone.0221152
2. UNDANG-UNDANG REPUBLIK INDONESIA NOMOR 11 TAHUN 2008 TENTANG INFORMASI DAN TRANSAKSI ELEKTRONIK (2008).
3. B. Vidgen and L. Derczynski, “Directions in abusive language training data, a systematic review: Garbage in, garbage out,” PLOS ONE, vol. 15, no. 12, 2020.
4. I. Alfina, R. Mulia, M. I. Fanany, and Y. Ekanata, “Hate speech detection in the Indonesian language: A dataset and preliminary study,” in 2017 International Conference on Advanced Computer Science and Information Systems (ICACSIS), 2017.
5. N. I. Pratiwi, I. Budi, and I. Alfina, “Hate speech detection on Indonesian Instagram comments using FastText approach,” in 2018 International Conference on Advanced Computer Science and Information Systems (ICACSIS), 2018.
6. M. O. Ibrohim and I. Budi, “Multi-label hate speech and abusive language detection in Indonesian Twitter,” in Proceedings of the Third Workshop on Abusive Language Online, pp. 46–57, 2019.
7. Z. Waseem and D. Hovy, “Hateful symbols or hateful people? predictive features for hate speech detection on Twitter,” in Proceedings of the NAACL Student Research Workshop, pp. 88–93, 2016.
8. T. Davidson, D. Warmsley, M. Macy, and I. Weber, “Automated hate speech detection and the problem of offensive language,” in Proceedings of the International AAAI Conference on Web and Social Media, vol. 11, no. 1, pp. 512–515, 2017. doi:10.1609/icwsm.v11i1.14955
9. C. J. Kennedy, G. Bacon, A. Sahn, and C. von Vacano, “Constructing interval variables via faceted Rasch measurement and multitask deep learning: a hate speech application,” arXiv preprint arXiv:2009.10277, 2020.
10. A. M. Founta, C. Djouvas, D. Chatzakou, I. Leontiadis, J. Blackburn, G. Stringhini, A. Vakali, M. Sirivianos, and N. Kourtellis, “Large scale crowdsourcing and characterization of Twitter abusive behavior,” in Proceedings of the International AAAI Conference on Web and Social Media, vol. 12, no. 1, pp. 491–500, 2018.
11. R. Gomez, J. Gibert, L. Gomez, and D. Karatzas, “Exploring hate speech detection in Multimodal Publications,” in 2020 IEEE Winter Conference on Applications of Computer Vision (WACV), 2020. doi:10.1109/wacv45572.2020.9093414
12. L. Torrey and J. Shavlik, “Transfer learning,” Handbook of Research on Machine Learning Applications and Trends, pp. 242–264, 2010.
13. A. Allhorn, “Transfer Learning for Hate Speech Detection,” M.S. thesis, Berliner Hochschule für Technik, Berlin, 2020.
14. V. Jain, V. Kumar, V. Pal, and D. K. Vishwakarma, “Detection of cyberbullying on social media using machine learning,” in 2021 5th International Conference on Computing Methodologies and Communication (ICCMC), 2021.
15. A. Briliani, B. Irawan, and C. Setianingsih, “Hate speech detection in Indonesian language on Instagram comment section using K-nearest neighbor classification method,” in 2019 IEEE International Conference on Internet of Things and Intelligence System (IoTaIS), pp. 98–104, 2019.
16. C. Raj, A. Agarwal, G. Bharathy, B. Narayan, and M. Prasad, “Cyberbullying detection: Hybrid models based on machine learning and Natural Language Processing Techniques,” Electronics, vol. 10, no. 22, p. 2810, 2021.
17. R. A. Ilma, S. Hadi, and A. Helen, “Twitter’s hate speech multi-label classification using bidirectional long short-term memory (BiLSTM) method,” in 2021 International Conference on Artificial Intelligence and Big Data Analytics, pp. 93–99, 2021. doi:10.1109/icaibda53487.2021.9689767
18. H. Saleh, A. Alhothali, and K. Moria, “Detection of Hate Speech using BERT and Hate Speech Word Embedding with Deep Model,” arXiv, 2021.
19. S. Madichetty and S. M., “A stacked convolutional neural network for detecting the resource tweets during a disaster,” Multimedia Tools and Applications, vol. 80, no. 3, pp. 3927–3949, 2020.
20. C. Leclercq, L. Braeckman, P. Firket, A. Babic, and I. Hansez, “Interest of a joint use of two diagnostic tools of burnout: Comparison between the Oldenburg Burnout Inventory and the Early Detection Tool of burnout completed by physicians,” International Journal of Environmental Research and Public Health, vol. 18, no. 19, pp. 10544–10563, 2021.
21. J. Devlin, M. W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding,” arXiv preprint arXiv:1810.04805, 2018.
22. V. Sanh, L. Debut, J. Chaumond, and T. Wolf, “DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter,” in 5th Workshop on Energy Efficient Machine Learning and Cognitive Computing - NeurIPS 2019, 2019.
23. S. Ravichandiran, Getting Started with Google BERT: Build and train state-of-the-art natural language processing models using BERT. Packt Publishing, 2021.
24. Y. Liu et al., “RoBERTa: A Robustly Optimized BERT Pretraining Approach,” arXiv preprint arXiv:1907.11692, 2019.
25. S. Goldman, “Precision vs. recall: What’s the difference?,” History-Computer, https://history-computer.com/precision-vs-recall-whats-the-difference/ (accessed Jul. 5, 2023).
26. D. Purwitasari, A. F. Abdillah, S. Juanita, and M. H. Purnomo, “Transfer learning approaches for Indonesian biomedical entity recognition,” in 2021 13th International Conference on Information & Communication Technology and System (ICTS), pp. 348–353, 2021.
27. M. Das, S. Banerjee, P. Saha, and A. Mukherjee, “Hate Speech and Offensive Language Detection in Bengali,” arXiv preprint arXiv:2210.03479, 2022.
28. D. Rodriguez and D. Saynova, “Machine Learning for Detecting Hate Speech in Low Resource Languages,” M.S. thesis, University of Gothenburg, Gothenburg, 2020.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Journal of Information Technology and Computer Science

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Creative Common Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).








