E mpty M ind at BLP -2023 Task 1: A Transformer-based Hierarchical- BERT Model for B angla Violence-Inciting Text Detection (2023)

Abstract: The availability of the internet has made it easier for people to share information via social media. People with ill intent can use this widespread availability of the internet to share violent content easily. A significant portion of social media users prefer using their regional language which makes it quite difficult to detect violence-inciting text. The objective of our research work is to detect Bangla violence-inciting text from social media content. A shared task on Bangla violence-inciting text detection has been organized by the First Bangla Language Processing Workshop (BLP) co-located with EMNLP, where the organizer has provided a dataset named VITD with three categories: nonviolence, passive violence, and direct violence text. To accomplish this task, we have implemented three machine learning models (RF, SVM, XGBoost), two deep learning models (LSTM, BiLSTM), and two transformer-based models (BanglaBERT, Hierarchical-BERT). We have conducted a comparative study among different models by training and evaluating each model on the VITD dataset. We have found that Hierarchical-BERT has provided the best result with an F1 score of 0.73797 on the test set and ranked 9th position among all participants in the shared task 1 of the BLP Workshop co-located with EMNLP 2023.

## introduction the presence of violent language on social media has significantly increased in recent times which may lead to bigger crime in real life. violent texts often result in cyberbullying in online communication. government authorities and social media companies are very much concerned about such a critical issue. a significant amount of previous studies have been conducted on hate speech and toxic, and abusive text detection. the majority of related research works have been done in highresource languages, like english @xcite . however, little has been done for low-resource languages such as bangla. since many social media users prefer using their regional languages, such as bangla, it becomes a greater challenge to identify violent text content. difficult lexemes and no specific pattern for tokens make bangla violent word detection so hard. rule-based machine learning methods @xcite for detecting violent text are considered insufficient nowadays. therefore, applying rule-based lexical analyzers or parsing methods provides poor performance. @xcite and transformer-based @xcite approaches provide better performance compared to traditional rule-based machine learning methods violence-inciting text detection. transformer-based approaches have not been utilized for violent text detection in the bangla language. the primary objective of this paper is to detect violence-inciting text in bangla on social media using a hierarchical transformer. the first bangla language processing workshop (blp), co-located with emnlp, has arranged a shared task, introducing a novel dataset called vitd, categorized into nonviolence, passive violence, and direct violence text, for the purpose of detecting bangla violence-inciting text @xcite . to achieve this objective, we have employed a diverse range of models, including three machine learning models (rf, svm, xgboost), two deep learning models (lstm, bilstm), and two transformer-based models (banglabert, hierarchical-bert). we have conducted a comparative analysis by training and evaluating each model on the vitd dataset, ultimately determining that the hierarchical-bert model has outperformed the others with an impressive f1 score of 0.73797 on the test set. in the hierarchical-based transformer model, the first bert model is em-ployed to differentiate between violence and nonviolence text while the second bert is used to classify direct and passive violence text. the implementation details have been provided in the following github repository - https:// github.com/ml-emptymind/blp-task1 . ## related work the previous studies on violence inciting text detection (vitd) can be categorized under machine learning, deep learning, and transformer-based approaches. traditional machine learning (ml) techniques have been applied for violence text detection in online social media platforms @xcite . machine learning algorithms such as support vector machine (svm), naive bayes (nb), and k-nearest neighbours (knn) have been utilized where svm provides the best result for violenceinciting text detection. in another previous work, a lexicon-based method has been used to retrieve violence-related microblogs and then a similaritybased method has been applied to extract sentiment words to detect violent text @xcite which outperforms the previous svm methods. however, hierarchically structured categories in text categorization have been used @xcite . they have emphasized the importance of considering the impact of hierarchy on machine learning approaches for improved text classification efficiency. compared to the traditional methods used for detecting violence-inciting text (vitd), deep learning (dl) based approaches are less dependent on explicitly defined features. instead, these models learn patterns and features automatically. a deep learning neural network has been capitalized to detect gender-based violence (gbv) in mexican tweets @xcite . they have used techniques like countvectorizer and a multilayer perceptron to design the model architectures. a fine-tuned transformer named distilbeto has been applied to detect aggressive and violent incidents from social media in spanish @xcite . another approach utilizes gan-bert to detect violent text in the same dataset @xcite . ## dataset we have utilized the violence detection dataset provided under shared task 1 (vitd) of the blp workshop @ emnlp 2023 @xcite . this dataset contains three categories non-violence, passive violence, and direct violence. the dataset is divided into three sets train, dev, and test with 2700, 1330, and 2016 samples. each split contains 16-18 words on average. each category contains 14-20 words on average. ## methodology in this section, we provide an overview of the methods and techniques used on the dataset explained before. initially, we have extracted features using different extraction techniques and applied various ml and dl algorithms. moreover, different transformer models have been applied to develop the system shown in figure 1 . machine learning based approaches for detecting violence inciting text, we have applied traditional ml-based methods such as random forest and support vector machine. we also have used xgboost as an ensemble classifier to improve the performance. here, we have used nltktokenizer to tokenize the dataset and applied word2vec to extract features from the dataset. for svm, we have chosen the parameter c value of 1 for a soft margin in a hyperplane. for the ensemble method, we have specified the boosting rounds or number of decision trees to @xmath0. deep learning-based approaches have been utilized for detecting violence-inciting text. we have implemented two lstm-based models. in the first model, we have applied three bidirectional lstm layers with different numbers of lstm cells. the three directional layers consist of 32, 16, and 8 bidirectional lstm cells respectively. in the second model, we have used four lstm layers which consist of 32, 32, 16, and 8 lstm cells respectively. both models have been trained up to 10 epochs. we have used categorical cross-entropy as the loss function, and callback method to monitor validation loss during training to select the best model. transformer-based approaches are being used very widely in many aspects nowadays. we have employed banglabert @xcite to address this task. as the dataset is imbalanced, we have used the hierarchical approach shown in figure 2 . in the hierarchical approach, we first classify the violence and non-violence text, then further classify the violence text into direct violence and passive violence. for both classification tasks, we have finetuned two banglabert models. at first, we have divided the dataset into two groups, violence, and nonviolence. under the violence category, we have assigned the remaining two categories-direct and passive violence. we have finetuned one banglabert model named nvbert to distinguish between violence and nonviolence texts. then, we have finetuned another banglabert model named dpbert using violence-categorized text which further classifies the violent text into direct and passive violence. at the time of inference, when nvbert recognizes a text as violence then we give that text as input to dpbert to determine whether it is direct or passive violence. passive and direct violence texts are significantly different from non-violence texts. in passive or direct violence texts, we find the presence of violent words which is not the case for non-violence texts. that is the reason we have selected the combination where first nvbert finds out the non-violence text and dpbert finds out the passive and direct violence text. ## results and analysis in this section, we present performance comparisons among various machine learning, deep learning, and transformer-based approaches. ## conclusion in this research work, we have conducted a comparative study among different machine learning, deep learning, and transformer-based models for bangla violence-inciting text detection in social media content. during the training and evaluation of the different models, we utilized the vitd dataset provided in a shared task. we have found that the hierarchical-bert model has outperformed all other models with an f1-score score of 0.73797. the error analysis shows that our trained models become biased toward the majority class. in the future, we will address the issue by incorporating different strategies to address the class imbalance in the vitd dataset.