Cross-Platform Hate Speech Detection Using an Attention-Enhanced BiLSTM Model

Authors

  • Muzammil Hussain Department of Software Engineering, Faculty of Information Technology, Al-Ahliyya Amman University, Amman, Jordan
  • Waqas Sharif Department of Computer Science, The Islamia University of Bahawalpur, Bahawalpur, Pakistan
  • Muhammad Rehan Faheem Fakulti Kecerdasan Buatan dan Keselamatan Siber, Universiti Teknikal Malaysia Melaka, 76100 Melaka, Malaysia
  • Yazeed Alsarhan Faculty of Information Technology, Al-Ahliyya Amman University, Amman, Jordan
  • Hany A. Elsalamony Department of Computer Science, Faculty of Information Technology, Al-Ahliyya Amman University, Amman, Jordan | Department of Mathematics, Faculty of Science, Helwan University, Cairo, Egypt
Volume: 15 | Issue: 6 | Pages: 29779-29786 | December 2025 | https://doi.org/10.48084/etasr.13249

Abstract

Hate speech is rapidly spreading across digital platforms, appearing in diverse forms driven by regional, cultural, and linguistic differences. This growing trend presents serious challenges to social harmony and online safety. Existing hate speech detection models often fall short because they rely on limited and homogeneous datasets, making them less effective in real-world, culturally diverse settings. Handling large-scale, diverse datasets adds notable complexity to capturing contextual nuances, as different populations and cultures demonstrate unique language patterns and expressions. This study addresses the necessity for a more universal solution by proposing a deep learning model trained on an extensive and diverse dataset comprising 842,000 samples collected from various digital platforms. The approach combines a Bidirectional Long Short-Term Memory (BiLSTM) model with a self-attention mechanism to capture contextual depth. Various data embedding techniques were used to assess their impact, along with data resampling and standard Natural Language Processing (NLP) pre-processing steps. The proposed model achieved 93% accuracy with an F1-score of 0.92, outperforming several baseline and state-of-the-art models. This work provides a comprehensive and scalable framework for the detection of hate speech across various online platforms.

Keywords:

hate speech detection, NLP, deep learning, BiLSTM, SMOTE

Downloads

Download data is not yet available.

References

U. Nations. "What is hate speech?" https://www.un.org/en/hate-speech/understanding-hate-speech/what-is-hate-speech.

"Global social media statistics research summary" https://www.smartinsights.com/social-media-marketing/social-media-strategy/new-global-social-media-research/.

E. A. Vogels. "The State of Online Harassment," Pew Research Center, Jan. 13, 2021. https://www.pewresearch.org/internet/2021/01/13/the-state-of-online-harassment.

J. H. Tien, M. C. Eisenberg, S. T. Cherng, and M. A. Porter, "Online reactions to the 2017 ‘Unite the right’ rally in Charlottesville: measuring polarization in Twitter networks using media followership," Applied Network Science, vol. 5, no. 1, pp. 1–27, Dec. 2020. DOI: https://doi.org/10.1007/s41109-019-0223-3

W. Sharif, S. Abdullah, S. Iftikhar, D. Al-Madani, and S. Mumtaz, "Enhancing Hate Speech Detection in the Digital Age: A Novel Model Fusion Approach Leveraging a Comprehensive Dataset," IEEE Access, vol. 12, pp. 27225–27236, 2024. DOI: https://doi.org/10.1109/ACCESS.2024.3367281

K. A. Qureshi and M. Sabih, "Un-Compromised Credibility: Social Media Based Multi-Class Hate Speech Classification for Text," IEEE Access, vol. 9, pp. 109465–109477, 2021. DOI: https://doi.org/10.1109/ACCESS.2021.3101977

C. Baydogan and B. Alatas, "Metaheuristic Ant Lion and Moth Flame Optimization-Based Novel Approach for Automatic Detection of Hate Speech in Online Social Networks," IEEE Access, vol. 9, pp. 110047–110062, 2021. DOI: https://doi.org/10.1109/ACCESS.2021.3102277

N. D. Gitari, Z. Zuping, D. Hanyurwimfura, and J. Long, "A lexicon-based approach for hate speech detection," International Journal of Multimedia and Ubiquitous Engineering, vol. 10, no. 4, pp. 215–230, 2015. DOI: https://doi.org/10.14257/ijmue.2015.10.4.21

N. Vashistha and A. Zubiaga, "Online Multilingual Hate Speech Detection: Experimenting with Hindi and English Social Media," Information, vol. 12, no. 1, Dec. 2020, Art. no. 5. DOI: https://doi.org/10.3390/info12010005

G. L. De la Peña Sarracén and P. Rosso, "Unsupervised embeddings with graph auto-encoders for multi-domain and multilingual hate speech detection," in Proceedings of the 13th Conference on Language Resources and Evaluation (LREC 2022), Marseille, France, 2022, pp. 2196–2204.

C. Duong, L. Zhang, and C.-T. Lu, "HateNet: A Graph Convolutional Network Approach to Hate Speech Detection," in 2022 IEEE International Conference on Big Data (Big Data), Dec. 2022, pp. 5698–5707. DOI: https://doi.org/10.1109/BigData55660.2022.10020510

Y. Zhou, Y. Yang, H. Liu, X. Liu, and N. Savage, "Deep Learning Based Fusion Approach for Hate Speech Detection," IEEE Access, vol. 8, pp. 128923–128929, 2020. DOI: https://doi.org/10.1109/ACCESS.2020.3009244

M. Gaikwad, S. Ahirrao, K. Kotecha, and A. Abraham, "Multi-Ideology Multi-Class Extremism Classification Using Deep Learning Techniques," IEEE Access, vol. 10, pp. 104829–104843, 2022. DOI: https://doi.org/10.1109/ACCESS.2022.3205744

J. Lu et al., "Hate Speech Detection via Dual Contrastive Learning," IEEE/ACM Transactions on Audio, Speech, and Language Processing, vol. 31, pp. 2787–2795, 2023. DOI: https://doi.org/10.1109/TASLP.2023.3294715

M. R. Awal, R. K.-W. Lee, E. Tanwar, T. Garg, and T. Chakraborty, "Model-Agnostic Meta-Learning for Multilingual Hate Speech Detection," IEEE Transactions on Computational Social Systems, vol. 11, no. 1, pp. 1086–1095, Feb. 2024. DOI: https://doi.org/10.1109/TCSS.2023.3252401

A. R. Jafari, G. Li, P. Rajapaksha, R. Farahbakhsh, and N. Crespi, "Fine-Grained Emotions Influence on Implicit Hate Speech Detection," IEEE Access, vol. 11, pp. 105330–105343, 2023. DOI: https://doi.org/10.1109/ACCESS.2023.3318863

X. Fan, J. Liu, J. Liu, P. Tuerxun, W. Deng, and W. Li, "Identifying Hate Speech Through Syntax Dependency Graph Convolution and Sentiment Knowledge Transfer," IEEE Access, vol. 12, pp. 2730–2741, 2024. DOI: https://doi.org/10.1109/ACCESS.2023.3347591

A. Kamal, T. Anwar, V. K. Sejwal, and M. Fazil, "BiCapsHate: Attention to the Linguistic Context of Hate via Bidirectional Capsules and Hatebase," IEEE Transactions on Computational Social Systems, vol. 11, no. 2, pp. 1781–1792, Apr. 2024. DOI: https://doi.org/10.1109/TCSS.2023.3236527

A. Toktarova et al., "Hate Speech Detection in Social Networks using Machine Learning and Deep Learning Methods," International Journal of Advanced Computer Science and Applications (IJACSA), vol. 14, no. 5, pp. 396-406, May 2023. DOI: https://doi.org/10.14569/IJACSA.2023.0140542

R. Raut and F. Spezzano, "Enhancing hate speech detection with user characteristics," International Journal of Data Science and Analytics, vol. 18, no. 4, pp. 445–455, Oct. 2024. DOI: https://doi.org/10.1007/s41060-023-00437-1

G. Ansari, P. Kaur, and C. Saxena, "Data Augmentation for Improving Explainability of Hate Speech Detection," Arabian Journal for Science and Engineering, vol. 49, no. 3, pp. 3609–3621, Mar. 2024. DOI: https://doi.org/10.1007/s13369-023-08100-4

D. Mody, Y. Huang, and T. E. Alves de Oliveira, "A curated dataset for hate speech detection on social media text," Data in Brief, vol. 46, Feb. 2023, Art. no. 108832. DOI: https://doi.org/10.1016/j.dib.2022.108832

T. Mandl et al., "Overview of the HASOC track at FIRE 2019: Hate speech and offensive content identification in Indo-European languages," in Proceedings of the 11th Annual Meeting of the Forum for Information Retrieval Evaluation (FIRE ’19), Kolkata, India, 2019, pp. 14–17. DOI: https://doi.org/10.1145/3368567.3368584

T. Davidson, D. Warmsley, M. Macy, and I. Weber, "Automated hate speech detection and the problem of offensive language," in Proceedings of the Eleventh International AAAI Conference on Web and Social Media (ICWSM 2017), Montreal, QC, Canada, 2017, pp. 512–515. DOI: https://doi.org/10.1609/icwsm.v11i1.14955

V. Basile et al., "SemEval-2019 Task 5: Multilingual detection of hate speech against immigrants and women in Twitter," in Proceedings of the 13th International Workshop on Semantic Evaluation (SemEval-2019), Minneapolis, MN, USA, 2019. DOI: https://doi.org/10.18653/v1/S19-2007

M. ElSherief, S. Nilizadeh, D. Nguyen, G. Vigna, and E. Belding, “Peer to peer hate: Hate speech instigators and their targets,” in Proceedings of the Twelfth International AAAI Conference on Web and Social Media (ICWSM 2018), Stanford, CA, USA, 2018, pp. 52-61. DOI: https://doi.org/10.1609/icwsm.v12i1.15038

N. Ousidhoum, Z. Lin, H. Zhang, Y. Song, and D.-Y. Yeung, "Multilingual and multi-aspect hate speech analysis," in Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, China, 2019, pp. 4675–4684. DOI: https://doi.org/10.18653/v1/D19-1474

P. Mathur, R. Sawhney, M. Ayyar, and R. Shah, "Did you offend me? Classification of offensive tweets in Hinglish language," in Proceedings of the 2nd Workshop on Abusive Language Online (ALW2), Brussels, Belgium, 2018, pp. 138–148. DOI: https://doi.org/10.18653/v1/W18-5118

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, San Diego, CA, USA, 2016, pp. 88–93. DOI: https://doi.org/10.18653/v1/N16-2013

A. Founta et al., "Large scale crowdsourcing and characterization of Twitter abusive behavior," in Proceedings of the Twelfth International AAAI Conference on Web and Social Media (ICWSM 2018), Stanford, CA, USA, 2018, pp. 491–500. DOI: https://doi.org/10.1609/icwsm.v12i1.14991

N. Bölücü and P. Canbay, "Hate speech and offensive content identification with graph convolutional networks," in Proceedings of the 13th Annual Meeting of the Forum for Information Retrieval Evaluation (FIRE ’21), India, 2021, pp. 44-51.

S. Dowlagar and R. Mamidi, "HASOCOne@FIRE-HASOC2020: Using BERT and Multilingual BERT models for Hate Speech Detection." arXiv, Jan. 22, 2021.

T. Mandl, S. Modha, A. Kumar M, and B. R. Chakravarthi, "Overview of the HASOC Track at FIRE 2020: Hate Speech and Offensive Language Identification in Tamil, Malayalam, Hindi, English and German," in Proceedings of the 12th Annual Meeting of the Forum for Information Retrieval Evaluation, New York, NY, USA, Jan. 2021, pp. 29–32. DOI: https://doi.org/10.1145/3441501.3441517

W. Yu, B. Boenninghoff, and D. Kolossa, "Hybrid representation fusion for Twitter hate speech identification," in Proceedings of the 13th Annual Meeting of the Forum for Information Retrieval Evaluation (FIRE ’21), India, 2021, pp. 319-329.

M. Zampieri et al., "SemEval-2020 Task 12: Multilingual offensive language identification in social media (OffensEval 2020)," in Proceedings of the Fourteenth Workshop on Semantic Evaluation (SemEval-2020), Barcelona, Spain (online), 2020, pp. 1425–1447. DOI: https://doi.org/10.18653/v1/2020.semeval-1.188

C. Bosco, F. Dell’Orletta, F. Poletto, M. Sanguinetti, and M. Tesconi, "Overview of the EVALITA 2018 hate speech detection task," in Proceedings of the Sixth Evaluation Campaign of Natural Language Processing and Speech Tools for Italian (EVALITA 2018), Turin, Italy, 2018. DOI: https://doi.org/10.4000/books.aaccademia.4503

M. Zampieri, S. Malmasi, P. Nakov, S. Rosenthal, N. Farra, and R. Kumar, "Predicting the Type and Target of Offensive Posts in Social Media," in Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), Minneapolis, Minnesota, Mar. 2019, pp. 1415–1420. DOI: https://doi.org/10.18653/v1/N19-1144

R. Agarwal. "Twitter hate speech." https://www.kaggle.com/datasets/vkrahul/twitter-hate-speech.

L. Gao and R. Huang, "Detecting Online Hate Speech Using Context Aware Models," in Proceedings of the International Conference Recent Advances in Natural Language Processing, RANLP 2017, Varna, Bulgaria, June 2017, pp. 260–266. DOI: https://doi.org/10.26615/978-954-452-049-6_036

B. Mathew, P. Saha, S. M. Yimam, C. Biemann, P. Goyal, and A. Mukherjee, "HateXplain: A Benchmark Dataset for Explainable Hate Speech Detection," in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 35, no. 17, pp. 14867–14875, May 2021. DOI: https://doi.org/10.1609/aaai.v35i17.17745

M. Xia, A. Field, and Y. Tsvetkov, "Demoting Racial Bias in Hate Speech Detection," in Proceedings of the Eighth International Workshop on Natural Language Processing for Social Media, Online, Apr. 2020, pp. 7–14. DOI: https://doi.org/10.18653/v1/2020.socialnlp-1.2

B. He, C. Ziems, S. Soni, N. Ramakrishnan, D. Yang, and S. Kumar, "Racism is a virus: anti-asian hate and counterspeech in social media during the COVID-19 crisis," in Proceedings of the 2021 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining, New York, NY, USA, Jan. 2022, pp. 90–94. DOI: https://doi.org/10.1145/3487351.3488324

J. Malik, A. Akhunzada, A. S. Al-Shamayleh, S. Zeadally, and A. Almogren, "Hybrid deep learning based threat intelligence framework for Industrial IoT systems," Journal of Industrial Information Integration, vol. 45, May 2025, Art. no. 100846. DOI: https://doi.org/10.1016/j.jii.2025.100846

T. M. Ghazal et al., "Federated Learning With Small and Large Models With Privacy-Preserving Data Space for Holographic Internet of Things in Consumer Electronics," IEEE Transactions on Consumer Electronics, vol. 71, no. 2, pp. 5259–5274, Feb. 2025. DOI: https://doi.org/10.1109/TCE.2025.3573033

M. Maaz, G. Ahmed, A. Sami Al-Shamayleh, A. Akhunzada, S. Siddiqui, and A. Hussein Al-Ghushami, "Empowering IoT Resilience: Hybrid Deep Learning Techniques for Enhanced Security," IEEE Access, vol. 12, pp. 180597–180618, 2024. DOI: https://doi.org/10.1109/ACCESS.2024.3482005

Downloads

How to Cite

[1]
M. Hussain, W. Sharif, M. R. Faheem, Y. Alsarhan, and H. A. Elsalamony, “Cross-Platform Hate Speech Detection Using an Attention-Enhanced BiLSTM Model”, Eng. Technol. Appl. Sci. Res., vol. 15, no. 6, pp. 29779–29786, Dec. 2025.

Metrics

Abstract Views: 481
PDF Downloads: 372

Metrics Information