An Efficient BERT Based Approach to Detect Aggression and Misogyny (2021)

Abstract: Social media is bustling with ever growing cases of trolling, aggression and hate. A huge amount of social media data is generated each day which is insurmountable for manual inspection. In this work, we propose an efficient and fast method to detect aggression and misogyny in social media texts. We use data from the Second Workshop on Trolling, Aggression and Cyber Bullying for our task. We employ a BERT based model to augment our data. Next we employ Tf-Idf and XGBoost for detecting aggression and misogyny. Our model achieves 0.73 and 0.85 Weighted F1 Scores on the 2 prediction tasks, which are comparable to the state of the art. However, the training time, model size and resource requirements of our model are drastically lower compared to the state of the art models, making our model useful for fast inference.

## introduction with the rise of social media, there has also been a huge surge of online criticism and trolling. mitigation of these kinds of online bullying has been an important problem and has been studied for a long time. however, the amount of information generated on social media is too large for humans to wade through. machine learning (ml) and deep learning (dl) models have achieved great success in the task of text categorization. however, even as larger models with higher accuracy are being built, the importance of the quality of data has still not reduced. larger models will give sub-optimal results if the training data is not of good quality. but the results of large models are more difficult to interpret. traditional ml models have the advantage of producing results that are relatively easier to interpret. in this work, we combine a large deep learning model and traditional ml approaches for the purpose of text classification. our experimental data is comprised of social media texts from youtube comments and the task is to predict the presence of aggression and misogyny from the data. first the data is analyzed to reveal the class distribution issue with the data. next we develop a bidirectional encoder representations from transformer (bert) @xcite ) based text data augmentation pipeline to fix the class distribution. this augmented data helps to reduce class imbalance. for the classification part, we develop a tf-idf and xgboost based classification model to classify the text. our model foot_0 achieves a score very close to the state of the art. however, since the augmentation task is essentially a one-time process, our model is simpler and faster. the main classification pipeline does not require high-end computational resources during inference, which makes our model even more efficient. ## related works so far, significant contributions have been made in the domain of aggression detection in text @xcite @xcite . other aspects of of the task have been investigated in areas such as trolling @xcite , misogyny @xcite , cyberbullying @xcite , racism @xcite , offensive language @xcite and hate speech @xcite . all these works are diverse in terms of the target subject they investigate. the works have mainly been conducted on english datasets, however there are some other languages on which works have been reported, for example, in hindi @xcite ,spanish (garibo i orts, 2019),chinese @xcite , etc. 3 model description 3.1 bert based text data augmentation the dataset had a skewed distribution, with the majority of the data belonging to one category. this imbalance can cause models to always predict the majority class. to counter this effect, we employed a bert based masked word prediction model for data augmentation. the process of augmentation is presented in algorithm (1). algorithm 1 bert based data augmentation -masked word prediction 1: select one text belonging to the minority class. the dataset is augmented once and stored. this essentially being an offline one time process, makes our overall model faster. this process need not be repeated during inference, which makes our net model size smaller. ## conclusion in this work, a fast and efficient pipeline to detect aggression and misogyny from social media texts was developed. the text data is cleaned and analysed and data augmentation was performed using a bert based model. various models were experimented upon and tf-idf + xgboost model performs the best among them. weighted f1 score of 0.735 and 0.852 was produced by our model, however with drastically reduced computational requirements. in future, we aim to perform the training on a larger dataset to obtain better results. this would enable us to develop a fast and efficient system to tackle the problem of hatred on social media sites. there is scope of improvement in specific areas like improving the pipeline to detect the subcategory of covertly aggressive better, and to detect misogynous content slightly better. we can extend the reach of the present work to processing multilingual datasets as well.