Research Article

Chinese offensive language analysis based on Bidirectional Encoder Representation Transformer (BERT)

Haomin Liu1,*, Xiaozhou Wen2, Kangkai Yan3
1. Southeast University
2. Chongqing Normal University
3. Chongqing University of Posts and Telecommunications

* Corresponding author: [email protected]

Abstract

Offensive language detection is important in maintaining civilized social media platforms and training language models. However, this task remains to be developed in Chinese due to the lack of datasets. For this reason, in this paper, we introduce the Bidirectional Encoder Representation Transformer (BERT) to construct a Chinese Offensive Language Detection (COLD) model. We find that the race category has similar representation features as the region category. We investigate both the lack of training set and data poisoning attacks. Specifically, first, specific labeled data is analyzed for its role in the dataset. In addition, the experiments investigate the effect of the type of attack on the results. Second, the BERT model is used to test the results. BERT is a context-based embedding model that generates word embeddings based on context. In addition, the encoder understands the context of each word through a multi-head attention mechanism. The experimental results show that the model has the ability to handle handicapped data. The training results for the defective data were not as good as for the original data, and the model was more unstable for the training set with racial labeling and the test set with regionality. This study evaluated the importance of theme as a detection label. Poisoning attacks in BERT by changing labels were found to improve the accuracy of the test. This study can provide valuable thoughts to the community.

Keywords: Offensive Language Detection; Chinese; COLDataset; BERT
Published: March 15, 2024
DOI: 10.54254/2755-2721/45/20241268
Volume: ACE Vol.45
pp. 244-250
Download PDF

References

  1. Deng J, Zhou J , Sun H ,et al.COLD: A Benchmark for Chinese Offensive Language Detection[J]. 2022.DOI:10.48550/arXiv.2201.06025.
  2. Hosseini H, Kannan S, Zhang B, et al. Deceiving google's perspective api built for detecting toxic comments[J]. arXiv preprint arXiv:1702.08138, 2017.
  3. M. Duggan, Online harassment. Pew Research Center, 2014.
  4. Mishra P, Yannakoudakis H, Shutova E. Tackling online abuse: A survey of automated abuse detection methods[J]. arXiv preprint arXiv:1908.06024, 2019.
  5. Wulczyn E, Thain N, Dixon L. Ex machina: Personal attacks seen at scale[C]//Proceedings of the 26th international conference on world wide web. 2017: 1391-1399.
  6. Koroteev M V. BERT: a review of applications in natural language processing and understanding[J]. arXiv preprint arXiv:2103.11943, 2021.
  7. Gillioz A, Casas J, Mugellini E, et al. Overview of the Transformer-based Models for NLP Tasks[C]//2020 15th Conference on Computer Science and Information Systems (FedCSIS). IEEE, 2020: 179-183.
  8. Acheampong F A, Nunoo-Mensah H, Chen W. Transformer models for text-based emotion detection: a review of BERT-based approaches[J]. Artificial Intelligence Review, 2021: 1-41.
  9. Devlin J , Chang M W , Lee K ,et al.BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding[J]. 2018.
  10. Zampieri M, Malmasi S, Nakov P, et al. Predicting the type and target of offensive posts in social media[J]. arXiv preprint arXiv:1902.09666, 2019.
  11. Xu J, Ju D, Li M, et al. Recipes for safety in open-domain chatbots[J]. arXiv preprint arXiv:2010.07079, 2020.
  12. Gehman S, Gururangan S, Sap M, et al. Realtoxicityprompts: Evaluating neural toxic degeneration in language models[J]. arXiv preprint arXiv:2009.11462, 2020.