Evaluation of Neural Networks for the Identification of Hate Speech in Spanish Using Stylometric Features
DOI:
https://doi.org/10.46480/esj.10.2.295Keywords:
Artificial intelligence, Neural networks, Stylometry, Hate speech, Text classificationAbstract
Context: This research focuses on analyzing the effectiveness of neural networks in detecting hate speech in Spanish, using stylometric features and taking into account Ecuador's linguistic diversity. The main objective was to evaluate and analyze the accuracy of different neural network models in this specific text classification task. Method: Four neural network architectures were implemented and compared: Convolutional Neural Network (CNN), Recurrent Neural Network (RNN), Long Short-Term Memory (LSTM), and Transformer, applying the CRISP-DM methodology to structure the necessary tasks in each phase and their interrelationships. Results: The results revealed significant differences in the performance of the four models. The Transformer model stands out as the most efficient alternative, achieving a higher weighted F1 score (0.88) and an AUC of 0.92, indicating an optimal balance. Both CNN and RNN reached an overall accuracy of 87%, while the LSTM obtained the lowest accuracy at 86%. Conclusions: Consequently, the adoption of the Transformer model is recommended for automatic hate speech detection in Spanish texts, employing stylometric features and considering Ecuador's linguistic diversity. Furthermore, it is suggested to continue evaluating the model in a production environment to identify potential biases and make necessary adjustments. Future research includes incorporating texts in multiple languages and developing educational programs aimed at students, thereby fostering greater awareness of hate speech and its potential impact.
Downloads
References
Alghazzawi, D., Ullah, H., Tabassum, N., Badri, S. K., & Asghar, M. Z. (2025). Explainable AI-based suicidal and non-suicidal ideations detection from social media text with enhanced ensemble technique. *Scientific Reports, 15*(1). https://doi.org/10.1038/s41598-024-84275-6
Álvarez-Benjumea, A. (2025). Social norms and the expression of prejudice: How the norm changes. *Current Opinion in Psychology, 62*. https://doi.org/10.1016/j.copsyc.2024.101974
Asudani, D. S., Nagwani, N. K., & Singh, P. (2023). Impact of word embedding models on text analytics in deep learning environment: a review. *Artificial Intelligence Review, 56*(9), 10345–10425. https://doi.org/10.1007/s10462-022-10419-7
Assimakopoulos, S., & Serafis, D. (2025). Why soft hate speech matters: argumentativity and the dispersion of hatred towards minorities. *Critical Discourse Studies*. https://doi.org/10.1080/17405904.2024.2440869
Benítez-Andrades, J. A., González-Jiménez, Á., López-Brea, Á., Aveleira-Mata, J., Alija-Pérez, J.-M., & García-Ordás, M. T. (2022). Detecting racism and xenophobia using deep learning models on Twitter data: CNN, LSTM and BERT. *PeerJ Computer Science, 8*, e906. https://doi.org/10.7717/peerj-cs.906
Esteve Bañón, Z. (2020). *Análisis de las características ambientales del ciberlugar para la detección y prevención de la comunicación violenta y el discurso de odio* [Tesis doctoral, Universidad Miguel Hernández de Elche].
Fernández Rosauro, C. (2023). *Detección de discurso de odio contra la comunidad LGTBI+ mexicana mediante el uso de arquitecturas transformer* [Tesis de maestría, Universitat Oberta de Catalunya].
Fu, L., Zhang, X., Liao, C., Xiong, P., Song, N., & Chen, K. (2025). Microtia and social media: can patients find reliable information in TikTok? *European Journal of Plastic Surgery, 48*(1). https://doi.org/10.1007/s00238-024-02264-4
Gonçalves, M., Salgado, C., de Sousa, A., & Teixeira, L. (2025). Data Storytelling and Decision-Making in Seaport Operations: A New Approach Based on Business Intelligence. *Sustainability, 17*(1). https://doi.org/10.3390/su17010337
Hassan, M. M., Orebi, H. A., Salama, B., & Kabbash, I. A. (2025). The association of social media use and other social factors with symptoms of attention-deficit/hyperactivity disorder in Egyptian university students. *BMC Psychiatry, 25*(1). https://doi.org/10.1186/s12888-024-05988-6
Jiménez-Díaz, O., & Del Rey, R. (2025). Cyberhate in adolescents and youths: A systematic review of labels and associated factors. *Aggression and Violent Behavior, 81*. https://doi.org/10.1016/j.avb.2024.102023
Miró Llinares, F. (2016). Taxonomía de la comunicación violenta y el discurso del odio en Internet. *IDP. Revista de Internet, Derecho y Política, 22*. https://doi.org/10.7238/idp.v0i22.2975
Moosa, W. H., & Najiba. (2022). *Multi-lingual HateSpeech Dataset* [Conjunto de datos]. Kaggle. https://doi.org/10.34740/KAGGLE/DS/2260058
Moro, S., Laureano, R., & Cortez, P. (2011). Using data mining for bank direct marketing: An application of the CRISP-DM methodology. En *Proceedings of the European Simulation and Modelling Conference (ESM)*.
Park, J. R., Poole, E., & Li, J. (2024). Stylometric features in librarian's responses to user queries: implications for user interaction in digital information services. *Global Knowledge, Memory and Communication, 73*(3), 375–390. https://doi.org/10.1108/GKMC-03-2022-0055
Patel, D., Pramanik, P. K. D., Suryawanshi, C., & Pareek, P. (2025a). Detecting toxic comments on social media: an extensive evaluation of machine learning techniques. *Journal of Computational Social Science, 8*(1). https://doi.org/10.1007/s42001-024-00349-5
Patel, D., Pramanik, P. K. D., Suryawanshi, C., & Pareek, P. (2025b). Machine learning techniques for hate speech detection: a comprehensive evaluation. *Journal of Computational Social Science, 8*(1). https://doi.org/10.1007/s42001-024-00349-5
Perry, B., & Olsson, P. (2009). Cyberhate: The globalization of hate. *Information and Communications Technology Law, 18*(2). https://doi.org/10.1080/13600830902814984
Plaza-del-Arco, F. M. (2023). *Detecting offensive language by integrating multiple linguistic phenomena* [Tesis doctoral, Universidad de Jaén].
Plaza-del-Arco, F. M., Molina-González, M. D., Ureña-López, L. A., & Martín-Valdivia, M. T. (2021). Comparing pre-trained language models for Spanish hate speech detection. *Expert Systems with Applications, 166*, 114120. https://doi.org/10.1016/j.eswa.2020.114120
Rodríguez-Sánchez, F., Carrillo-de-Albornoz, J., & Plaza, L. (2020). Automatic classification of sexism in social networks: An empirical study on Twitter data. *IEEE Access, 8*, 219563–219576. https://doi.org/10.1109/ACCESS.2020.3042604
Romero-Vega, R. R., Cumbicus-Pineda, O. M., López-Lapo, R. A., & Neyra-Romero, L. A. (2021). *Detecting Xenophobic Hate Speech in Spanish Tweets Against Venezuelan Immigrants in Ecuador Using Natural Language Processing* (Vol. 1388 CCIS). Springer. https://doi.org/10.1007/978-3-030-71503-8_24
Santos Ríos, R. (2022). *Classifiers and text mining: application to a specific context* [Tesis doctoral, Universidad de Salamanca].
Shohan, M. H., Hossain, M., Rahman, M., & Karim, A. (2025). Use of Natural Language Processing for the Detection of Hate Speech on Social Media. *Journal of Advanced Research in Applied Sciences and Engineering Technology, 51*(2), 86–96. https://doi.org/10.37934/araset.51.2.8696
Spithas, V. S. (2020). *Hate Speech Detection Using Neural Networks* [Tesis de maestría, University of Piraeus].
Suntaxi, J. G., Recalde, L., Loza-Aguirre, E., & Martinez-Mosquera, D. (2024). Cholo, Indio, Mono: Ecuador and the Linguistic Context of Hate Speech on Twitter. *International Conference on eDemocracy and eGovernment (ICEDEG)*. https://doi.org/10.1109/ICEDEG61611.2024.10702066
Suntaxi Recalde, J. G. (2022). *Modelo de detección de discurso de odio en Ecuador mediante clasificación supervisada de tweets y técnicas de NLP* [Tesis de maestría, Escuela Politécnica Nacional].
Tonneau, M., Liu, D., Fraiberger, S., Schroeder, R., Hale, S. A., & Röttger, P. (2024). From Languages to Geographies: Towards Evaluating Cultural Bias in Hate Speech Datasets. En *Proceedings of the 8th Workshop on Online Abuse and Harms (WOAH)*. https://doi.org/10.18653/v1/2024.woah-1.23
Ureña-López, L. A., Plaza-del-Arco, F. M., Molina-González, M. D., & Martín-Valdivia, M. T. (2024). MODERATES: MODERAtion of ConTEnts in Social networks using Language Technologies. En *CEUR Workshop Proceedings* (pp. 112–117).
Zapatier, L., Morejón, M., Escobar, S., Jima-González, A., & Cuenca, E. (2024). *Hate Speech Detection in the 2022 Ecuador Strike Using the K-Nearest Neighbors Algorithm* (Vol. 775 LNNS). Springer. https://doi.org/10.1007/978-3-031-69228-4_10
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Oscar León Granizo, Valeria Nicol Jaramillo Ramírez, Kevin Javier Lamilla Vera, Cesar Espin Riofrío, Gary Reyes Zambrano (Author)

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Authors retain the copyright of their articles and are therefore free to share, copy, distribute, perform, and publicly communicate their work on their personal websites or in institutional repositories after its publication in this journal, provided that full bibliographic information is given to acknowledge its original publication.






















