Abusive Language Detection using Syntactic Dependency Graphs (2020)

Abstract: Automated detection of abusive language online has become imperative. Current sequential models (LSTM) do not work well for long and complex sentences while bi-transformer models (BERT) are not computationally efficient for the task. We show that classifiers based on syntactic structure of the text, dependency graphical convolutional networks (DepGCNs) can achieve state-of-the-art performance on abusive language datasets. The overall performance is at par with of strong baselines such as fine-tuned BERT. Further, our GCN-based approach is much more efficient than BERT at inference time making it suitable for real-time detection.

## introduction abusive language usage in online social media is a grave issue affecting the interactions of users online. in a study conducted by pew research center 1 , 60% of internet users have personally experienced harassment online. social media websites, like twitter and facebook, allow users to report harassing content. however, due to the sheer volume of data, timely human curation of all reported content is not possible. besides, there is also a need to filter these abusive content proactively. therefore, there is an increased interest in automated detection and moderation of abusive speech in text @xcite . abusive speech is defined as an attack targeted towards a particular individual or entity belonging to a protected group (protected group may include, but are not always limited to, religious, gender or racial minorities) @xcite . thus, abusive speech identification can be cast as a relation extraction problem in which the goal is to detect a "hate" or "attack" relation that links the speaker to a protected group (the object of the attack). current state-of-the-art methods in abusive language detection use either n-gram features @xcite or employ sequential deep learning models like cnn or lstm @xcite . these methods do not work well to capture semantic word meanings or long-range attack in text (such as long clauses or complex scoping shown in online attacks). large pre-trained language models like bert @xcite achieve high accuracy after fine-tuning on supervised tasks. however, these methods are computationally expensive and are, thus, unfit to be used for real-time detection. @xcite observed that some attention heads of the pre-trained bert model are learning syntactic dependencies between words such as direct objects of verbs etc. it is similar to a dependency parser that represents the structure of syntactic dependence between words in the sentence. recently, @xcite and @xcite also showed that including syntactic dependency as features improves classifier performance in abusive language detection tasks. however, adding features can only provide weak supervision compared to encoding these dependence explicitly in the model. on the other hand, @xcite leveraged the dependency path between the subject and object of the sentence to achieve state-of-the-art results on relation extraction task on the tacred dataset. they encoded the dependency parse graph using efficient graph convolution operations @xcite . however, a direct usage of @xcite 's method is not straightforward for abusive language datasets due to the complexity of the possibilities for expressing an attack in text. an attack may be expressed directly by either using explicit slurs or curses, or attacking a protected group explicitly. in other instances, the attack can be implicit such as sexist posts denigrating genders to stereotypical roles. these implicit attacks need nuanced understanding of the semantic context. however, parse structures of the text can still be useful for capturing longer-range dependencies than sequential models. for instance, in fig 1 , the sequential distance between the attack mentally ill and the target protected group is five, while the distance in the parse tree is only two. @xmath0. an additional challenge in applying zhang et al. (2018a)'s method to noisy social media text is that the text often does not have an explicit subject and object, in which case there is no dependency path between them. or, especially in social media text, subject and object may be present but remain undetected by a parser trained on general purpose text. thus, we propose an adaption of the zhang et al. (2018a) model that learns dependency-aware text representations useful for abusive language detection task. our contributions are as follows: ## methods in this section, we first describe our approach to use syntactic dependencies to induce a graph on the text. we then convolve over this dependency graph using a graph convolutional framework (depgcn) to compute a text embedding useful for abusive language detection task. ## experiments in this section, we first describe our experimental setup, followed by the results. we then present a detailed error analysis of dependency-based model vs. a widely-used sequential model for sentence classification. ## related work most of the prior work for detecting abusive speech on twitter primarily relies on using statistical features like bag-of-words (character or word n-grams) or tf-idf features for automated detection @xcite @xcite . bag-of-words approaches are unable to capture nuanced abusive speech as they fail to contextualize the word meanings. for instance, depending on the context, the word gay can be used to denote either ebullience or sexual preference. only the latter is a candidate attack. recently, deep learning models are also proposed that leverage pre-trained word embeddings @xcite to capture the semantics of the tweets. these models aggregate individual word embeddings in a contextaware manner to compute tweet embeddings and later use them for classification. earlier studies have either used the cnn @xcite or rnn @xcite to compute these embeddings. the syntactic structure of the text was also used to help identify the target group and the intensity of hate speech @xcite . the primary difficulty of these works is that the space of possibly relevant rules is too large to be comprehensive. besides, it verges on the impossible to specify a set of rules that will cover possible implicit attacks. on the other hand, @xcite ; @xcite proposed computational models using the dependency labels as features and reported significant gains over the bag-of-words features. our model builds on this work and explicitly models the dependency between words using graph convolution operations. ## discussion worse performance of bert: our experiments did not show the superior performance of the bert model on the abusive language datasets. we also noticed that prior literature on comparable tasks is variable, with some successes for bert-like models but few robust trends. there are numerous reports of difficulties in training these large neural networks on the small, imbalanced annotated datasets typical of such tasks @xcite . the challenges are likely an effect of over-fitting and lead to inconsistent results. remedies include careful hyperparameter tuning, early stopping, and the use of ensembles. @xcite proposed to use an ensemble of bert models to control the variance of these large models over small datasets. ensembling is expensive, so there remains a need for computationally efficient methods that approach the same performance. because gcn has far fewer parameters, it is less likely to need these countermeasures against overfitting. experiments on the relatively larger abusive language dataset of 100k tweets @xcite by @xcite highlighted that sequential models such as rnn perform well but are still hard to train on this dataset size. further, @xcite concluded that with optimal feature selection, classifiers like svm and random forest performs at par with neural networks. dataset quality and annotator bias: recent works have highlighted that majority of the abusive language datasets suffer from poor quality @xcite or show evidence that annotator decisions were inappropriately affected by surface markers of speaker race @xcite . we believe that corrections of these deficiencies and biases in annotation are essential for research progress in the field. better dataset collection, however, is complementary to our computational approach. we believe our dependency parser-based approach should be able to perform competitively on future datasets. this is because the model is designed to be insensitive to the cues from unrelated single words. social media-specific tools: social media text tends to be very noisy and thus, nlp tools trained on general corpus do not perform well on these datasets. however, our preliminary experiments with using pre-trained glove embeddings foot_3 trained on the twitter dataset showed a significant drop in performance. the performance drop could be because of the relatively smaller training data size of social media text used for training such models that may lead to overfitting. a possible counter approach can include pretraining these embeddings on a mix of general news corpus data along with social media text. similarly, our experiments with the training of spacy parser 9 on our training data showed a drop in performance. we did not experiment with parsers specially built for twitter @xcite but believe that using twitter-specific parsers might improve our results further. ## conclusion in this work, we propose a novel sentence encoder that extends the graph convolutional network (gcn) to an induced graph built from syntactic dependencies in the text for abusive language detection. our model achieved state-of-the-art performance on public hate speech twitter datasets, performing at par with strong baselines such as fine-tuned bert. our depgcn model is much more scalable than bert and thus, can be efficiently used for realtime detection. error analysis reveals that our model is complementary to the sequential baselines. future work includes using an ensemble of sequential model with our dependency parserbased model. we will also extend our approach to longer text spanning multiple sentences such as posts/comments on online platforms.