Research Article

Bridging the gap in online hate speech detection: A comparative analysis of BERT and traditional models for homophobic content identification on X/Twitter

Josh McGiff*, Nikola S. Nikolov
Department of Computer Science and Information Systems, University of Limerick

* Corresponding author: [email protected]

Abstract

Our study addresses a significant gap in online hate speech detection research by focusing on homophobia, an area often neglected in sentiment analysis research. Utilising advanced sentiment analysis models, particularly BERT, and traditional machine learning methods, we developed a nuanced approach to identify homophobic content on X/Twitter. This research is pivotal due to the persistent underrepresentation of homophobia in detection models. Our findings reveal that while BERT outperforms traditional methods, the choice of validation technique can impact model performance. This underscores the importance of contextual understanding in detecting nuanced hate speech. By releasing the largest open-source labelled English dataset for homophobia detection known to us, an analysis of various models' performance and our strongest BERT-based model, we aim to enhance online safety and inclusivity. Future work will extend to broader LGBTQIA+ hate speech detection, addressing the challenges of sourcing diverse datasets. Through this endeavour, we contribute to the larger effort against online hate, advocating for a more inclusive digital landscape. Our study not only offers insights into the effective detection of homophobic content by improving on previous research results, but it also lays groundwork for future advancements in hate speech analysis.

Keywords: Homophobia detection; Sentiment analysis; Hate speech classification; Machine learning; Natural language processing (NLP); X/Twitter
Published: May 15, 2024
DOI: 10.54254/2755-2721/64/20241346
Volume: ACE Vol.64
pp. 63-68
Download PDF

References

  1. Renkin, H. Z., & Trofimov, V. 2023. The Global Dialectics of Homonationalism and Homophobia. Sexuality & Culture, 27(6), 1987–95.
  2. Jha, A., & Mamidi, R. 2017. When does a compliment become sexist? Analysis and classification of ambivalent sexism using twitter data. In D. Hovy, S. Volkova, D. Bamman, D. Jurgens, B. O’Connor, O. Tsur, et al. (Eds.), Proceedings of the Second Workshop on NLP and Computational Social Science, 7–16, Association for Computational Linguistics.
  3. Kwok, I., & Wang, Y. 2013. Locate the Hate: Detecting Tweets against Blacks. Proceedings of the AAAI Conference on Artificial Intelligence, 27(1), 1621–2.
  4. Gray, C., Russell, P., & Blockley, S. 1991. The effects upon helping behaviour of wearing pro-gay identification. British Journal of Social Psychology, 30(2), 171–178.
  5. Glick, P., & Fiske, S. T. 1997. Hostile and benevolent sexism: Measuring ambivalent sexist attitudes toward women. Psychology of Women Quarterly, 21(1), 119–35.
  6. Kumaresan, P. K., Ponnusamy, R., Priyadharshini, R., Buitelaar, P., & Chakravarthi, B. R. 2023. Homophobia and transphobia detection for low-resourced languages in social media comments. Natural Language Processing Journal, 5, 100041.
  7. Fasoli, F., Paladino, M. P., Carnaghi, A., Jetten, J., Bastian, B., & Bain, P. G. 2016. Not “just words”: Exposure to homophobic epithets leads to dehumanizing and physical distancing from gay men. European Journal of Social Psychology, 46(2), 237–48.
  8. Vigna, F. D., Cimino, A., Dell’Orletta, F., Petrocchi, M., & Tesconi, M. 2017. Hate Me, Hate Me Not: Hate Speech Detection on Facebook. In Proceedings of the First Italian Conference on Cybersecurity (ITASEC17), Venice, Italy, 86-95.
  9. Tang, D., Qin, B., & Liu, T. 2015. Document Modeling with Gated Recurrent Neural Network for Sentiment Classification. In L. Màrquez, C. Callison-Burch, & J. Su (Eds.), Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, 1422–32, Association for Computational Linguistics.
  10. Gao, Z., Feng, A., Song, X., & Wu, X. 2019. Target-Dependent Sentiment Classification With BERT. IEEE Access, 7, 154290–9.
  11. Rodriguez-Sanchez, 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–76.
  12. Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. 2019. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In J. Burstein, C. Doran, & T. Solorio (Eds.), 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, 4171–86, Association for Computational Linguistics.
  13. Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., et al. 2020. Transformers: State-of-the-Art Natural Language Processing. In Q. Liu & D. Schlangen (Eds.), Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, 38–45, Association for Computational Linguistics.