H ate GAN : Adversarial Generative-Based Data Augmentation for Hate Speech Detection (2020)

Abstract: Academia and industry have developed machine learning and natural language processing models to detect online hate speech automatically. However, most of these existing methods adopt a supervised approach that heavily depends on labeled datasets for training. This results in the methods’ poor detection performance of the hate speech class as the training datasets are highly imbalanced. In this paper, we propose HateGAN, a deep generative reinforcement learning model, which addresses the challenge of imbalance class by augmenting the dataset with hateful tweets. We conduct extensive experiments to augment two commonly-used hate speech detection datasets with the HateGAN generated tweets. Our experiment results show that HateGAN improves the detection performance of the hate speech class regardless of the classifiers and datasets used in the detection task. Specifically, we observe an average 5% improvement for the hate class F1 scores across all state-of-the-art hate speech classifiers. We also conduct case studies to empirically examine the HateGAN generated hate speeches and show that the generated tweets are diverse, coherent, and relevant to hate speech detection.

## introduction motivation. the sharp increase in online hate speeches has raised concerns globally @xcite . the spread of hate speech in social media has not only sowed discord among individuals or communities online but also resulted in violent hate crimes @xcite @xcite . therefore, it is a pressing issue to detect and curb hate speech in online social media. major social media platforms such as facebook and twitter have made great efforts to combat the spread of hate speech in their platforms @xcite . researchers have also proposed many traditional and deep learning hate speech classification methods to detect hate speeches in online social media automatically @xcite . most of these existing methods adopt a supervised approach that heavily depends on labeled datasets for training. this results in the methods' poor detection performance of the hate speech class as the training datasets are highly imbalanced @xcite . a potential solution to address the challenges of imbalance datasets is to perform data augmentation for the class with fewer training samples. for instance, perturbing replicas of data samples using noise injection or attribute modification techniques have been successful in other domains such as image and sound classification tasks @xcite @xcite @xcite . nevertheless, these techniques are not transferable to text as they would break the text's syntax and alter the semantics of the original sentences. there are also very few works that have explored improving hate speech detection performance using data augmentation, and their results have shown limited improvement on automatic hate speech detection @xcite . research objectives. in this paper, we aim to fill the research gaps by proposing hategan, a novel controlled text generation method to generate diverse and relevant short hate speeches to augment existing social media hate speech datasets. at a high level, hategan adopts a reinforcement learning-based generative adversarial network architecture. the generative adversarial network component ensures that the generated text stays relevant and syntactically close to the original dataset. inspired by the seqgan model @xcite , the reinforcement learning-based component encourages the generator to generate text that is more hateful by introducing a reward policy gradient to guide its generation. specifically, we include a pre-trained toxicity scorer that scores a given text on six dimensions of toxic content. the computed scores are used as rewards and feedback signals to guide the generation of hateful text. contributions. foot_0 our main contributions in this work consist of the following. our experiment results show that hategan improves the detection performance of the hate speech class regardless of the classifiers and datasets used in the detection task. specifically, we observe an average 5% improvement for the hate class f1 scores across all state-of-the-art hate speech classifiers. ## related work automatic detection of hate speech has received considerable attention from data mining, information retrieval, and natural language processing (nlp) research communities. interest in this field has increased with the proliferation of social media and social platforms @xcite . traditional models @xcite @xcite @xcite and deep learning models @xcite @xcite @xcite @xcite @xcite have been developed to detect hate speech in social media. most of these existing methods adopt a supervised approach that heavily depends on labeled datasets for training, which is a challenge as existing hate speech datasets are highly imbalanced. for example, @xcite collected a twitter dataset and manually annotated the sexism and racism tweets. @xcite performed similar annotation on a larger twitter corpus, where the researchers differentiated offensive from hate tweets. however, both datasets are highly imbalanced; only about 30% of the tweets in @xcite are labeled as sexism or racism, and less than 12% of the tweets in @xcite are labeled as hateful. data augmentation methods have been explored to address the imbalance datasets challenge in supervised classification tasks. for example, noise injection or attribute modification techniques were commonly applied to generate synthetic data for image and sound classification tasks @xcite @xcite @xcite . nevertheless, it is challenging to apply such techniques on text due to the categorical nature of words and the sequential nature of text. in recent years, generative adversarial network models such as seqgan @xcite and leakgan @xcite have been proposed to generate text. however, these approaches suffer from high training variance and mode collapse. controlled text generation techniques were also explored to perform data augmentation @xcite . for instance, variational autoencoder (vae) was applied in text generation @xcite . the vae models consist of an encoder that maps each sample to a latent representation and a decoder that generates samples from the latent space and a variational attribute @xcite . the variational attribute is able to add diversity to the generated output sequences. the conditional vae (cvae) @xcite was proposed to incorporate stochastic latent variables to improve the generation of diverse and relevant text. in this paper, we propose hategan, which a novel a reinforcement learning-based generative adversarial network to generate short hate speeches. specifically, the policy gradient component in hategan guides the text generation process, which creates diverse and relevant short hate speeches. the generated hate speeches are subsequently used for data augmentation to improve automatic hate speech detection. there are very few works that explored data augmentation in hate speech detection. in a recent work, @xcite explored three kinds of data augmentation for hate speech detection. the researchers had explored (1) substituting the words in text, (2) swapping the word positions, and (3) the neural generation method using recurrent neural network (rnn) @xcite . each of these methods has its limitations. for instance, word substitution is challenging for hate speech generation as certain words may inherently contain hateful or offensive semantics. furthermore, new lexicons may be created in the fast-evolving social media, adding challenges to find reasonable semantically similar words for substitution. it is also challenging to swap words position while maintaining the coherence of the sentences. lastly, the neural generation method used in the study was generic and rudimentary. in this paper, we also adopt a neural generation approach to augment data for hate speech detection. however, unlike the neural generation method in @xcite , our proposed hategan model is specifically designed to generate high quality and diverse short hate speeches. ## adversarial generative-based model figure 1 illustrates the overall architecture of our proposal hategan model. it follows a similar process of reinforcement learning-based sequence generation proposed in @xcite . the discriminator is trained to guide the generator to synthesize tweets that are indistinguishable from the real tweets. the "realisticness" of the synthesized tweets is measured and output as realistic scores. as our goal is to improve the performance of hate speech detection by data augmentation, we aim to generate more hateful tweets. therefore, we pre-trained a toxicity scorer that quantifies the hatefulness of the synthesized tweets as hate scores. the realistic scores and hate scores are subsequently used as rewards to guide and update the parameters in the generator for more realistic hateful tweets generation. to overcome the problem of differentiation in sequence generation, a policy gradient is used to train the hategan model. ## experiment in this section, we describe the experiments conducted to evaluate the effectiveness of hategan in augmenting publicly available hate speech datasets and improving the performance of existing hate speech detection models. specifically, we evaluate the hategan's ability to improve the hate speech detection classification performance by augmenting the datasets used in training the classifiers. we also perform analysis to understand the hategan's effects on hate speech detection performance by varying the amount of data augmentation. finally, we demonstrate the quality of hategan's generated hateful tweets via case studies. ## conclusion in this paper, we proposed hategan, a deep generative reinforcement learning model, which addressed the challenge of imbalance class by augmenting the dataset with hateful tweets. we conducted extensive experiments to augment two commonly-used hate speech detection datasets with the hategan generated tweets. our experiment results showed that hategan improves the detection performance of the hate speech class regardless of the classifiers and datasets used in the detection task. specifically, we observe an average 5% improvement for the hate class f1 scores across all state-of-the-art hate speech classifiers. we also conducted case studies to empirically examine the hategan generated hate speeches and shown that the generated tweets are diverse, coherent, and relevant to hate speech detection. for future work, we aim to explore better methods for generating hateful tweets. for instance, we will explore other generation models, such as variational auto-encoder, for data augmentation. we will also consider other relevant attributes such as sentiment polarities and topic information, for hate tweets generation. finally, we will also explore other evaluation methods to measure the quality of the generated hateful content.