Implementation of LTRANS for Classifying Hate Speech on Social Media

Authors

  • Riza Kartina Prabumulih University
  • Hermizahadiwidastra Hermizahadiwidastra Prabumulih University
  • Arman Arman Prabumulih University
  • Avionika Ramdan Iswani Prabumulih University

DOI:

https://doi.org/10.26418/jp.v12i1.105128

Keywords:

Hate-Speech, Multilabel, Binary-Relevance, LSTM, Transformer

Abstract

Hate speech can have significant social impacts, necessitating automatic classification using deep learning. One of the most widely used models is the Transformer. The Transformer is an effective model for capturing global context in text, but it has limitations in processing time-series data. LSTM is a model capable of processing time-series data using a gate mechanism. This study proposes the LTrans model, a combination of the LSTM and Transformer models. The LSTM model is placed at the beginning to preserve the temporal order of the data, while the Transformer is placed at the end to process the data globally. Thus, it is expected that the data sequence remains intact, the meaning of the sentences does not change, and no information is lost. The research methods include text preprocessing and data augmentation. Text preprocessing is used to clean the data of irrelevant words, normalize it, and reduce noise so that the model can learn more effectively. Data augmentation is performed using Back Translation to translate text into other languages, and BERT Augmentation to enrich data variations without altering the meaning of the sentences. This study aims to classify hate speech using 9 labels with the LTrans model. Evaluation of the LTrans model’s performance yielded an accuracy of 95.89%, a precision of 97.8%, a recall of 95.89%, and an F1 score of 97.8%, indicating balanced performance. Overall, this study demonstrates that LTrans is capable of improving classification quality, accurately detecting hate speech, and effectively handling various targets.

Author Biographies

Riza Kartina, Prabumulih University

Department of Informatics, Faculty of Computer Science

Hermizahadiwidastra Hermizahadiwidastra, Prabumulih University

Department of Informatics, Faculty of Computer Science

Arman Arman, Prabumulih University

Department of Informatics, Faculty of Computer Science

Avionika Ramdan Iswani, Prabumulih University

Department of Informatics, Faculty of Computer Science

References

Prasetyo, R. A., Sidarta, D. D., Borman, M. S., and Subekti. (2024). Karakteristik Tindak Ujaran Kebencian Melalui Media Sosial. Journal Soc. Sci. Res., 4(4), 9013–9025.

Rizky Pratama Putra Karo Karo. (2023) Hate Speech: Penyimpangan terhadap UU ITE, Kebebasan Berpendapat dan Nilai-Nilai Keadilan Bermartabat. Journal Lemhannas RI, 10(4), 52–65.

Ramos, G., Batista, F., Ribeiro, R., Fialho, P., Moro, S., Fonseca, A., Guerra, R., Carvalho, P., Marques, C., & Silva, C. (2024). A comprehensive review on automatic hate speech detection in the age of the transformer. Social Network Analysis and Mining, 14(1), 1–25.

Mishra, S., Prasad, and Mishra, S. (2021). Exploring multi-task multi-lingual learning of transformer models for hate speech and offensive speech identification in social media. SN Comput. Sci., 2(2).72.

Desiani, A., M., Kresnawati, E. S. Ermatita, Akbar, M., dan Hasibuan, M.S. (2023). Back Translation-EDA and Transformer for Hate Speech Classification in Indonesian. International Conference on Informatics, Multimedia, Cyber and Informations System (ICIMCIS), 611–616.

Mutanga, R. T., Naicker, N., and Olugbara, O. O. (2020). Hate speech detection in twitter using transformer methods,” International Journal Adv. Computer Appl., 11(9), 614–620.

Zhao, L., Feng, X., Zhong, W., Xu, D., Yang, Q., Liu, H., Qin, B., dan Liu, T. (2024). Length extrapolation of transformers: A survey from the perspective of positional encoding. EMNLP 2024 - 2024 Conference on Empirical Methods in Natural Language Processing, Findings of EMNLP 2024, 9959–9977.

Landi, F., Baraldi, L., Cornia, M., dan Cucchiara, R. (2021). Working memory connections for LSTM. Neural Networks, 144, 334–341.

M. W. S. Utomo, H. W. Murti, A. W. I. Sujatmoko, and A. P. Sari. (2024). Deteksi Spam Email Menggunakan Metode Lstm (Long Short Term Memory). JATI (Jurnal Mahasiswa Teknologi Informasi 8(6), 11406–11411.

Yotenka, R., dan El Huda, F.F. (2020). Implementasi long short-term memory pada harga saham perusahaan perkebunan di indonesia. Unisda Journal of Mathematics and Computer Science (UJMC), 6(1), 9–18.

Jansen, D., Handhayani, T., and Hendry, J. (2023). Penerapan Metode Long Short-Term Memory Dalam Memprediksi Data Meteorologi Di Kalimantan Timur. Simtek: Jurnal Sistem Informasi dan Teknik Komputer, 8(2), 348-352.

Wati, N. P. S. and Pramartha, C. (2022). Penerapan Long Short Term Memory dalam Mengklasifikasi Jenis Ujaran Kebencian pada Tweet Bahasa Indonesia. Jurnal Nasional Teknologi Informasi dan Aplikasinya (JNATIA), 1(1), 755-762.

Hayaty, M., Laksito, A.D., and Adi, S. (2023). Hate speech detection on Indonesian text using word embedding method-global vector. IAES International Journal of Artificial Intelligence, 12(4), 1928–1937.

Al-Hussaeni, K., Sameer, M., and Karamitsos, I. (2023). The impact of data pre-processing on hate speech detection in a mix of English and Hindi--English (code-mixed) tweets. Applied Sciences (Switzerland), 13(19). 2194-5365

Atliha, V., and Šešok, D. (2020). Text augmentation using BERT for image captioning. Appl. Sci., 10(17).

Keya, A. J., Wadud, M. A. H., Mridha, M. F., Alatiyyah, M., and Hamid, M. A. (2022). AugFake-BERT: Handling imbalance through augmentation of fake news using BERT to enhance the performance of fake news classification. Applied Sciences (Switzerland), 12(17). 8398.

Ozolins, U., Hale, S., Cheng, X., Hyatt, A., and Schofield, P. (2020). Translation and back-translation methodology in health research—a critique. Expert Rev Pharmacoecon Outcomes Res. 20(1): 69-77.

Kholifatullah, B. A. H., and Prihanto, A. (2023). Penerapan metode long short term memory untuk klasifikasi pada hate speech. Journal of Informatics and Computer Science (JINACS), 4, 292–297.

Islam, S., Elmekki, H., Elsebai, A., Bentahar, J., Drawel, N., Rjoub, G., & Pedrycz, W. (2024). A comprehensive survey on applications of transformers for deep learning tasks. Expert Systems with Applications, 241, 1–48.

Arbaatun, C. N., Nurjanah, D., and Nurrahmi, H. (2022). Hate speech detection on Twitter through Natural Language Processing using LSTM model. Build. Informatics, Technol. 4(3).

Powers, D. M. W. (2020). Evaluation: from precision, recall and F-measure to ROC, informedness, markedness and correlation. Expert Review of Pharmacoeconomics and Outcomes Research, 20(1), 69–77.

Ridwan, M., and Muzakir, A. (2022). Model Klasifikasi Ujaran Kebencian pada Data Twitter dengan Menggunakan CNN-LSTM. Teknomatika, 12(2). 209–218.

Zahra, E. A. A., Sibaroni, Y., and Prasetyowati, S. S. (2023). Classification of Multi-Label of Hate Speech on Twitter Indonesia using LSTM and BiLSTM Method. JINAV Journal Inf. Vis., 4(2), 170–178.

Downloads

Published

2026-04-06