Skip to main content

Coded Hate Speech Detection via Contextual Information

  • 415 Accesses

Part of the Lecture Notes in Computer Science book series (LNAI,volume 13280)


Hate speech on online social media seriously affects the experience of common users. Many online social media platforms deploy automatic hate speech detection programs to filter out hateful content. To evade detection, coded words have been used to represent the targeted groups in hate speech. For example, on Twitter, “Google” is used to indicate African-Americans, and “Skittles” is used to indicate Muslim. As a result, it would be difficult to determine whether a hateful text including “Google” targets African-Americans or the search engine. In this paper, we develop a coded hate speech detection framework, called CODE, to detect hate speech by judging whether coded words like Google or Skittles are used in the coded meaning or not. Based on a proposed two-layer structure, CODE is able to detect the hateful texts with observed coded words as well as newly emerged coded words. Experimental results on a Twitter dataset show the effectiveness of our approach.


  • Coded hate speech
  • Few-shot learning

This is a preview of subscription content, access via your institution.

Buying options

USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-3-031-05933-9_8
  • Chapter length: 13 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
USD   84.99
Price excludes VAT (USA)
  • ISBN: 978-3-031-05933-9
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Softcover Book
USD   109.99
Price excludes VAT (USA)
Fig. 1.
Fig. 2.


  1. 1.

  2. 2.

  3. 3.


  1. Davidson, T., Warmsley, D., Macy, M., Weber, I.: Automated hate speech detection and the problem of offensive language. In: ICWSM (2017)

    Google Scholar 

  2. Fortuna, P., Nunes, S.: A survey on automatic detection of hate speech in text. ACM Comput. Surv. 51(4) (2018)

    Google Scholar 

  3. Gitari, N.D., Zuping, Z., Damien, H., Long, J.: A lexicon-based approach for hate speech detection. Int. J. Multimed. Ubiquit. Eng. 10(4), 215–230 (2015)

    CrossRef  Google Scholar 

  4. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9(8), 1735–1780 (1997)

    CrossRef  Google Scholar 

  5. van der Maaten, L., Hinton, G.: Visualizing data using t-SNE. J. Mach. Learn. Res. 9, 2579–2605 (2008)

    MATH  Google Scholar 

  6. Magu, R., Joshi, K., Luo, J.: Detecting the hate code on social media. In: Eleventh International AAAI Conference on Web and Social Media (2017)

    Google Scholar 

  7. Magu, R., Luo, J.: Determining code words in euphemistic hate speech using word embedding networks. In: ALW (2018)

    Google Scholar 

  8. Mikolov, T., Chen, K., Corrado, G., Dean, J.: Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781 (2013)

  9. Mou, G., Ye, P., Lee, K.: SWE2: SubWord enriched and significant word emphasized framework for hate speech detection. In: Proceedings of the 29th ACM International Conference on Information & Knowledge Management, pp. 1145–1154. Association for Computing Machinery, New York, October 2020

    Google Scholar 

  10. Peters, M., et al.: Deep contextualized word representations. In: NAACL (2018)

    Google Scholar 

  11. Qian, J., ElSherief, M., Belding, E., Wang, W.Y.: Hierarchical CVAE for fine-grained hate speech classification. In: EMNLP (2018)

    Google Scholar 

  12. Qian, J., ElSherief, M., Belding, E., Wang, W.Y.: Leveraging intra-user and inter-user representation learning for automated hate speech detection. In: NAACL (2018)

    Google Scholar 

  13. Rajamanickam, S., Mishra, P., Yannakoudakis, H., Shutova, E.: Joint modelling of emotion and abusive language detection. In: ACL, May 2020

    Google Scholar 

  14. Schmidt, A., Wiegand, M.: A survey on hate speech detection using natural language processing. In: Proceedings of the Fifth International Workshop on Natural Language Processing for Social Media (2017)

    Google Scholar 

  15. Tran, T., et al.: HABERTOR: an efficient and effective deep hatespeech detector. In: EMNLP, October 2020

    Google Scholar 

  16. Waseem, Z., Hovy, D.: Hateful symbols or hateful people? Predictive features for hate speech detection on twitter. In: Proceedings of the NAACL Student Research Workshop (2016)

    Google Scholar 

Download references


This work was supported in part by NSF grants 1564250, 1946391, and 2103829.

Author information

Authors and Affiliations


Corresponding author

Correspondence to Shuhan Yuan .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Verify currency and authenticity via CrossMark

Cite this paper

Xu, D. et al. (2022). Coded Hate Speech Detection via Contextual Information. In: Gama, J., Li, T., Yu, Y., Chen, E., Zheng, Y., Teng, F. (eds) Advances in Knowledge Discovery and Data Mining. PAKDD 2022. Lecture Notes in Computer Science(), vol 13280. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-05932-2

  • Online ISBN: 978-3-031-05933-9

  • eBook Packages: Computer ScienceComputer Science (R0)