Elamur Research

Hate Speech and Offensive Language Detection in Bengali

Paper · 2022 · Mithun Das, Somnath Banerjee, Punyajoy Saha et al.

Summary

Changing the alphabet can make familiar language difficult for a classifier to read. Das and colleagues study Bengali as it appears on Twitter, where people write it in Bengali script or use Latin letters, sometimes bringing English into the same message. The task is text classification. The classifier must decide whether a tweet expresses hate, contains an offensive attack, or falls into the ordinary category. A swear word can accompany a group-directed attack, an insult to an individual, or frustration that has no such target. Getting the category right depends on reading what the words are doing in the post.

The authors built a collection of 10,178 public tweets, divided into 5,071 Bengali-script posts and 5,107 Romanized posts. They searched for abusive expressions and community names, then asked native Bengali speakers to read the tweets, assign a class, and record whom the posts targeted. The authors released the data and code so others could use the benchmark. The collection supports tests within either writing form, as well as tests of what happens when the examples available for training come from a different form.

The paper mainly compares systems using macro-F1, which averages the classification score for each category with equal weight. When training and testing were done separately for each form, XLM-RoBERTa led with macro-F1 of 0.803 in Bengali script and 0.805 in Romanized Bengali. Pooling the original posts from both forms made MuRIL the leader on Bengali-script test posts at 0.808, while XLM-RoBERTa led on Romanized posts at 0.810. The highest reported Romanized macro-F1, 0.811, came from m-BERT trained on Romanized material supplemented with English translations of Bengali-script posts.

A classifier trained on one form performed much worse on the other when it had no labeled examples from the destination form. Adding some of those examples improved the results. With 128 examples of each class from the destination, MuRIL reached macro-F1 of 0.751 on Romanized posts after training in Bengali script and 0.709 in the opposite direction. A review of errors helps explain what aggregate scores leave open. Emoji complicated readings of tone, strings of profanity prompted offensive predictions even where no person or community was being insulted, and some political or religious remarks admitted competing interpretations. The experiments show how much the observed performance depends on the training material, the writing form at test time, and the judgments used to label the posts.

Deep dive: Hate Speech and Offensive Language Detection in Bengali

Das and colleagues benchmark hate speech and offensive language detection in Bengali tweets and test how well classifiers transfer between scripts. · about 34 minutes to read

The problem and its context

A language can have many speakers and few labeled examples

The authors start from a problem facing social media moderation. A platform can state what it prohibits, remove a post, or suspend an account, but someone still has to determine what a message means and whether the policy applies. The volume of incoming posts makes review difficult, and the language that reviewers encounter keeps changing. Familiarity with slang and with multilingual exchanges matters because an expression can carry a force that a literal reading misses. The paper treats automatic detection as a way to address part of the review problem and situates it within questions of bias, fairness and safety.

In the authors’ account, early efforts to gather data and develop detectors concentrated on English. Bengali has more than 210 million speakers according to the paper, yet that population does not ensure that researchers have labeled examples suitable for this task. The data they need must capture how people write in the setting they want to study, and it must distinguish the forms of harm that a detector is supposed to recognize. This is the sense in which the paper places Bengali hate speech detection among problems involving low-resource languages.

The variety of written Bengali makes that shortage more specific. The authors call text written in Bengali script actual Bengali. They use Roman Bengali for the form written in Latin letters, which can include English words or phrases. It helps to distinguish the two practices involved. Romanization is a choice of script for writing Bengali. Code-mixing brings material from different languages into an utterance or exchange. A person can write a Bengali sentence using Latin letters, and the resulting sentence can also include an English phrase. The annotation must account for the sense of the whole message.

For a person familiar with both writing forms, the same idea may be recognizable in either alphabet. For a classifier, the change affects the text units it receives and the wording it can associate with particular labels. When English and Bengali appear together, interpreting one part of the post can depend on understanding the other. The paper describes these practices as ordinary ways of communicating. Its experimental question is whether supervision gathered from one form can also help interpret the other. The design draws on multilingual and cross-lingual NLP.

The label depends on what the writer is attacking

The classification problem has an important boundary within abusive language. The authors’ codebook describes hate speech in terms of hatred or derogation towards a target, with attention to attributes such as religion, caste, national or ethnic origin, disability, and gender. The offensive category covers hurtful or vulgar language used to insult a person or group. Posts outside those categories receive the normal label. A single tweet may contain both insults and references to a community, so a reader has to decide whether its hostility is directed at people on the basis relevant to the hate category.

The paper illustrates the boundary with tweets that use profanity in quite different ways. In a Romanized post about a film award, the writer swears in the course of asking an exasperated question about the audience. The post is labeled normal. A different Romanized post hurls abuse at a named person and is labeled offensive. A further post uses a derogatory term for Bangladeshis within a string of insults and receives the hate label. In each example, a reader has to connect the language to the target and the purpose of the utterance. Earlier research the authors discuss also takes up this distinction, notably Automated Hate Speech Detection and the Problem of Offensive Language.

An example in Bengali script makes the complementary point about community references. A tweet reports that a Dalit organization questioned a citizenship law. The annotation treats the message as normal. It contains a term that could also appear in a group-directed attack, but here the community is part of the subject of a news-like statement. Such examples matter for evaluation. If a classifier responds to a community name as though it were always evidence of hostility, it can mistake discussion about a group for abuse of the group.

What earlier Bengali resources covered

The authors situate their work in a field that had already begun broadening its language coverage. They cite shared tasks such as HASOC and TRAC and describe datasets in Hindi, Danish, Greek, Turkish, and Mexican Spanish. Shared tasks provide a common set of predictions for different research teams to attempt. Other language-specific collections make particular writing practices and annotation choices available for study. Among the efforts the authors cite is OffensEval.

The earlier Bengali studies had different purposes and collection strategies. Ishmam and Sharmin annotated 5K Facebook comments, using categories that included incitement, forms of religious or communal hostility, and religious or political commentary. Das and colleagues report that the dataset was unavailable publicly. Karim and colleagues gathered 8K posts from sources including Facebook, blogs, and news articles. The posts belonged to different hate categories. Accordingly, researchers could use that collection to examine types of hate, but would need additional examples to train a system to distinguish it from other material. Romim and colleagues compiled 30K comments and used them in a detection benchmark.

In the paper’s account, these Bengali collections used Bengali script. Das and colleagues wanted both a different platform and a benchmark that covered Romanized writing. They also wanted to preserve the distinction between hate and other offensiveness. Those choices determine which research questions the data can answer. A corpus that groups abusive posts under a common positive label can support the detection of that broad category. Evaluating the finer boundary requires examples from both sides of it, separately labeled under a common scheme.

Earlier detection systems often described a message using features that could be counted or marked directly. A word or character n-gram represents a sequence of adjacent units, and a part-of-speech tag indicates a grammatical category. TF-IDF weights a term using its occurrence in the document and its distribution across the wider collection. The paper describes earlier work passing such features to classifiers including logistic regression, support vector machines, and decision trees. It then traces a shift toward deep networks and graph embeddings as larger datasets became available.

The experiments here use pretrained encoders. An encoder converts the input text into numerical representations that a classifier can use. The systems the authors choose have already been exposed to multilingual text before they learn the Bengali annotation categories. That creates an opportunity to ask how much of the work of crossing scripts can be handled by existing representations, and how much requires examples in the writing form the classifier will see at test time.

The method, step by step

Finding posts for people to read

The authors needed a way to find relevant tweets in a public stream. They report that the multilingual hate lexicon they consulted lacked a Bengali list, so they assembled one containing 74 abusive terms. It included slurs and other derogatory expressions aimed at people or communities. They also included community names in the search vocabulary to help retrieve posts that could express hostility without an explicit abusive word. The resulting pool could contain reports, criticism, exclamations, and attacks. A search match qualified a tweet for consideration, with the meaning of the match left for a reader to judge.

Searches through the Twitter API returned 500K Bengali-script tweets and 150K Romanized tweets. Those figures describe the initial pools. In sampling the benchmark, the authors allowed a maximum of 75 tweets from any user to reduce the concentration of posts from particular accounts. They also limited contributions from any month to 500 tweets, seeking to reduce the influence of specific events. The search vocabulary shapes the subjects and expressions that can enter the pool. The account and month limits act on the material that has already been found.

From Bengali tweet collection to classifier evaluation

The steps in order.

From Bengali tweet collection to classifier evaluationStep 1: Find tweets using abuse terms and community names1. Find tweets using abuse terms and community namesStep 2: Limit contributions from users and months2. Limit contributions from users and monthsStep 3: Train annotators on expert-labeled pilot examples3. Train annotators on expert-labeled pilot examplesStep 4: Assign a class and record targets4. Assign a class and record targetsStep 5: Resolve disagreements and split by class5. Resolve disagreements and split by classStep 6: Train classifiers with different sources of supervision6. Train classifiers with different sources of supervisionStep 7: Evaluate held-out tweets and inspect errors7. Evaluate held-out tweets and inspect errors

The study used material that was publicly available on Twitter. The authors say they did not try to establish users’ identities or follow them across services. Their data statement describes the posts as coming from public discussions and records limits on what is known about the people who wrote them. The data pipeline thus begins with people’s written contributions and does not involve recruiting those users to produce comparable examples under controlled conditions.

Turning the category definitions into decisions

The main annotators were four undergraduate computer science students who spoke Bengali natively. Two doctoral students with experience studying harmful online content served as expert annotators and supervised the work. The undergraduates volunteered after recruitment through departmental email and were compensated with gift cards. The process was designed to give them a common basis for judging tweets, including cases where the categories could be difficult to separate.

The experts first labeled a pilot set of 100 tweets. The set included 30 labeled hateful, 35 offensive, and 35 normal. Each undergraduate received 30 tweets from that set and a codebook containing category descriptions and examples. In the pilot, they practiced deciding both the class and the target. The team then discussed decisions that differed from the expert labels and gathered feedback from the annotators. That exchange helped refine the guidelines before the main phase of linguistic annotation.

In the main phase, two readers labeled each tweet independently. They were asked to read the whole message, choose its class, and mark applicable targets. The team began with batches of 100 tweets and increased the batch size to 500 as the annotators became more efficient. It used a web annotation platform that let annotators work through their assigned material and track progress. The authors also report discussing earlier mistakes with the readers as the work progressed. The procedure made it possible to resolve misunderstandings about the codebook before they affected more batches.

The organization of the work mattered because the material could be distressing in sustained reading. The annotators were encouraged to take breaks and given time to complete their assignments. The team held weekly meetings to check on their well-being. These arrangements form part of the paper’s data collection account, alongside the rules for reaching agreement.

If the two primary readers chose different classes, one expert read the tweet and assigned a class. If the expert agreed with one of the readers, that class settled the disagreement. If the expert chose the remaining class and the judgments were all different, the tweet was excluded. The final classification benchmark therefore uses one accepted label per retained tweet. Unanimity was possible, but agreement after expert review was enough for a disputed tweet to enter the benchmark.

The authors handled targets separately by combining the target labels that readers assigned. The inventory covers gender, linguistic community, national origin, religion, and other kinds of targets. It includes Bengali and Bihari linguistic communities, for example, and Indian, Bangladeshi, and Pakistani national origins. Other entries cover political targets, individuals, disabled people, and Dalits. A tweet could be marked as directed at both an individual and a woman while receiving the offensive class. This shows the distinction between recording whom a message addresses and deciding what kind of attack it makes. The main predictive task is the class decision, with the target information available for further study.

The authors report an inter-annotator agreement of 0.696 using Krippendorff’s α, where α denotes the agreement statistic. It summarizes consistency while taking into account how much agreement could occur by chance. The statistic and the adjudication rule answer different questions. The statistic reports the degree of consistency in labeling. The rule determines which class the benchmark uses when an initial decision is contested. The authors compare their agreement with that of earlier related work, including Multilingual and Multi-Aspect Hate Speech Analysis.

What the retained data contain

Of the 5,071 Bengali-script tweets in the final data, 825 are labeled hateful, 1,341 offensive, and 2,905 normal. In the Romanized subset there are 5,107 tweets, of which 510 are hateful, 2,063 offensive, and 2,534 normal. The complete collection contains 10,178 posts. Normal is the largest category in each subset. Offensive posts make up a larger share of the Romanized material than of the Bengali-script material, while the Bengali-script subset contains more hateful posts.

These distributions matter for what a classifier encounters. A supervised learner sees different amounts of evidence for the categories depending on which subset supplies its training data. The same codebook applies to both subsets, but the labels arise from different posts found by searches in different written forms. Matching the categories across the groups makes transfer measurable without requiring the original posts to express the same messages.

From a tweet to class scores

The experiments begin with encoders that use the Transformer architecture. Attention, a mechanism in that architecture, lets each part of the encoded text take information from other parts. A term near the beginning of a post can thus be represented in light of a target mentioned later, or words in different languages can contribute to a single representation of the message. This describes what the architecture can represent. Which of those connections influences a label decision depends on what the system has learned. The architecture is described under Transformer and attention.

During pretraining, the encoder learns from text before it receives the benchmark’s class labels. Fine-tuning then adjusts the pretrained system using labeled examples of the actual classification task. The paper describes the m-BERT implementation explicitly. A special input position called CLS yields a vector that is used to represent the message. A fully connected classification layer takes that vector and produces class scores. The multilingual encoder behind this setup comes from the work on BERT.

The paper describes m-BERT as an encoder with 12 attention heads, which can attend to input relationships in parallel. Its Wikipedia pretraining covers 104 languages. The pretraining objective is masked prediction, where the system learns to recover obscured input using the surrounding text. XLM-RoBERTa is also described as having 12 attention heads. Its training instead draws on 2.5TB of filtered CommonCrawl data covering 100 languages, and the paper gives 512 tokens as its maximum supported input length. The relevant pretraining work is Unsupervised Cross-lingual Representation Learning at Scale.

IndicBERT uses a multilingual version of ALBERT, a smaller derivative of the BERT architecture. The paper reports pretraining on 9 billion tokens covering 12 major Indian languages and describes its parameter count as around 10x smaller than that of m-BERT and XLM-RoBERTa. It represents a regionally focused and more compact option in the baseline comparison. The work introducing it is IndicNLPSuite.

MuRIL uses a BERT base architecture trained from scratch on material from Common Crawl, Wikipedia, PMINDIA, and Dakshina. Its pretraining includes 17 Indian languages and transliterated text in those languages. That history is pertinent to the study because the destination form can represent Bengali in a different script from the supervised source posts. The benchmark compares MuRIL as a complete system, including its corpora and training history. The pretraining work is Multilingual Representations for Indian Languages.

Keeping training and evaluation apart

The common split is 70:10:20 for training, validation, and testing, with stratification by class. The training partition supplies examples used to adjust the classifier. Validation data are set aside for development, and test data are held out for reporting performance. Stratification organizes that division so the classes are represented across the partitions according to their distribution. The experiments can then change which training posts are available while keeping the meaning of the evaluated labels fixed.

The authors trained for 10 epochs, with an epoch denoting a pass through the training examples. They used Adam, the optimizer that governs updates to the system’s parameters. The batch size was 16 examples per update. The learning rate, which controls the scale of updates, and the numerical stability constant for Adam were set as follows.

learning_rate = 2e − 5

learning_rate names the optimizer’s step-size setting. The equals sign assigns it the value 2e − 5, with e indicating scientific notation and − 5 giving the negative exponent on the power of ten.

adam_epsilon = 1e − 8

adam_epsilon names Adam’s numerical stability constant. The equals sign assigns it the value 1e − 8, with e again indicating scientific notation and − 8 giving the exponent.

n = 400

Here n denotes the common input length setting and = assigns the value 400, measured in tokens. Tokens are the text units presented to the encoder after tokenization. The authors chose this setting for their runs even though the architecture description gives a larger input capacity for XLM-RoBERTa.

Varying which writing forms supply supervision

The reference arrangement is ELFI, which the paper expands as Each language for itself. In this study, the term covers separately working with either Bengali script or Romanized Bengali. For a Bengali-script run, all three subsets come from Bengali-script posts. For a Romanized run, they come from Romanized posts. This measures performance when labeled data are available in the form the system will ultimately classify.

Joint training gives the classifier labeled posts from both writing forms. The authors still report distinct Bengali-script and Romanized test results, so improved performance on one subset can be seen independently of what happens on the other. The rationale is that the meaning relevant to the label may carry across scripts. For example, the question of whether an expression disparages a community applies to posts in either form. The challenge is whether adding examples of that relationship from a different set of written forms helps the encoder learn a decision it can use on the evaluation posts.

The direct-transfer arrangement gives each writing form a different role. One supplies the supervised training examples and is called the source. The other supplies the test posts and is called the target. MTx0 is the zero-shot condition, meaning that supervised training for the classification task uses no labeled target posts. The condition still starts from a pretrained encoder. What is withheld is explicit supervision for these categories in the particular form used at test time.

In related runs the authors add a further fine-tuning stage. They start with the classifier already trained on the source and give it a limited set of labeled target posts. The budget is specified for each class, so the added material includes examples from every category. This is a supervised form of few-shot learning.

n ∈ {32, 64, 128}

In this setting, n is the count of labeled target tweets supplied for each class. The symbol ∈ means that the count is one of the alternatives in braces, and the comma separates the alternatives 32, 64, and 128. The authors name the runs MTx32, MTx64, and MTx128. For each budget they sample three different random target sets and report the mean result. They test both directions, starting from Bengali-script supervision and adapting to Romanized posts, or starting from Romanized supervision and adapting to Bengali-script posts.

Changing the language of the extra examples

The authors also ask what happens when Bengali-script tweets are represented through English translations. They use Google Translate, a machine translation service, and retain the original class annotations. In the translated-only condition the classifier trains on the translated tweets and is evaluated on translations of held-out tweets. This tests whether a useful classifier can be built when the sequence it sees is an English rendition of the original post.

A separate condition uses the translations as additional training examples. Here the test posts remain in Romanized Bengali, and the training data contain both original Romanized tweets and English translations of the Bengali-script material. English words and phrases already occur in some Romanized posts, giving the authors a reason to ask whether the translated material might be helpful. The two translation experiments use the same general transformation for different purposes. One evaluates the classification of translated inputs, and the other evaluates the effect of adding translated supervision for an original-text target.

Experiments and results

How to read the reported scores

Accuracy is the fraction of test posts whose predicted category matches the reference label. It answers a question about the collection as a whole, where categories with more posts influence the score more. Class-level F1 summarizes precision and recall together. For the hate class, precision asks how often a post predicted as hate has that reference label. Recall asks how frequently a post labeled hate in the benchmark receives that prediction. The same definitions apply when measuring the offensive or normal class.

Macro-F1 averages the class F1 values with equal weight. This is relevant when the hateful category is smaller than the other categories. A change in its F1 has the same influence on the macro average as the same change in another class’s F1. The paper’s main tables show separate F1 values for hate and offensive language alongside the macro score. A reader can use the displayed class results to check which decision improved when the overall score changed.

The authors also report AUROC, the area under the receiver operating characteristic curve. It measures discrimination from prediction scores as a decision threshold varies. The paper’s account does not specify the averaging convention used for AUROC across classes. For direct transfer and few-shot adaptation, the reported measure is macro-F1. Those comparisons support judgments about overall performance across the categories, with class-specific changes left unresolved.

Using labels from the script being evaluated

Among the separately trained Bengali-script classifiers, XLM-RoBERTa has the highest macro-F1 at 0.803 and the highest accuracy at 0.830. Its AUROC is 0.919. MuRIL reaches macro-F1 of 0.797, followed by m-BERT at 0.795 and IndicBERT at 0.767. On accuracy, MuRIL records 0.817, m-BERT records 0.813, and IndicBERT records 0.790. The same encoder leads on these aggregate measures in the Bengali-script standalone run.

The ordering changes if the reader looks specifically at recognizing hate speech in Bengali script. m-BERT’s hate-class F1 is 0.824, while MuRIL’s is 0.816 and XLM-RoBERTa’s is 0.812. For the offensive class, XLM-RoBERTa reaches F1 of 0.717, above MuRIL’s 0.704 and m-BERT’s 0.693. IndicBERT records 0.788 for hateful tweets and 0.656 for offensive tweets. The scores give an example of how a classifier can lead on the balanced average while another makes the strongest decisions for a particular label.

With Romanized examples used throughout, XLM-RoBERTa leads at 0.805 macro-F1 and 0.858 accuracy on the Romanized test set. Its AUROC is 0.924. IndicBERT has the next highest macro-F1 at 0.793, followed by m-BERT at 0.789 and MuRIL at 0.788. The corresponding accuracies for these other runs are 0.846 for IndicBERT, 0.840 for m-BERT, and 0.843 for MuRIL.

The Romanized class results for XLM-RoBERTa are 0.666 F1 on hate and 0.857 on offensive language. IndicBERT gives 0.651 and 0.846 on those classes. m-BERT gives 0.658 and 0.840, and MuRIL gives 0.646 and 0.841. For all the tested encoders, the reported hate-class F1 is below offensive-class F1 on the Romanized test posts. The Bengali-script runs show the opposite ordering between the same classes. This difference in the class scores is visible even though the leading macro-F1 scores for the scripts are close. The reported scores concern each group of naturally collected posts, with its own mix of targets and labels.

Training with the original posts in both scripts

On the Bengali-script test set, MuRIL leads the jointly trained classifiers. It records 0.808 macro-F1 and 0.833 accuracy. m-BERT records 0.800 and 0.829, and XLM-RoBERTa records 0.794 and 0.819. IndicBERT reaches 0.769 macro-F1 and 0.785 accuracy. MuRIL’s Bengali-script macro-F1 exceeds its result under separate training, while XLM-RoBERTa’s falls below its separately trained result.

Bengali-script test macro-F1 with separate and joint training

MuRIL achieves the leading Bengali-script score when training includes both original writing forms.

Bengali-script test macro-F1 with separate and joint trainingXLM-RoBERTa with Bengali script only: 0.803XLM-RoBERTa with Bengali script only0.803XLM-RoBERTa with both scripts: 0.794XLM-RoBERTa with both scripts0.794MuRIL with Bengali script only: 0.797MuRIL with Bengali script only0.797MuRIL with both scripts (this paper): 0.808MuRIL with both scripts (this paper)0.808m-BERT with Bengali script only: 0.795m-BERT with Bengali script only0.795m-BERT with both scripts: 0.800m-BERT with both scripts0.800IndicBERT with Bengali script only: 0.767IndicBERT with Bengali script only0.767IndicBERT with both scripts: 0.769IndicBERT with both scripts0.769
The numbers
System or settingMacro-F1
XLM-RoBERTa with Bengali script only0.803
XLM-RoBERTa with both scripts0.794
MuRIL with Bengali script only0.797
MuRIL with both scripts (this paper)0.808
m-BERT with Bengali script only0.795
m-BERT with both scripts0.800
IndicBERT with Bengali script only0.767
IndicBERT with both scripts0.769

For Bengali-script hate speech, joint training gives MuRIL F1 of 0.835, compared with 0.816 using Bengali-script training alone. Its offensive F1 is 0.704 under both arrangements. m-BERT’s Bengali-script hate F1 rises from 0.824 to 0.831 while its offensive F1 falls from 0.693 to 0.684. The highest AUROC with both scripts in training is m-BERT’s 0.914. MuRIL’s AUROC in that setting is 0.895, showing that its lead on accuracy and macro-F1 does not extend to every reported measure.

On the Romanized test set, jointly trained XLM-RoBERTa reaches 0.810 macro-F1 and 0.865 accuracy, leading on both metrics. MuRIL follows on macro-F1 at 0.800 and has accuracy of 0.850. m-BERT records macro-F1 of 0.789 and accuracy of 0.845, while IndicBERT records 0.767 and 0.817. The highest AUROC in this group is m-BERT’s 0.928. For XLM-RoBERTa, the Romanized AUROC under joint training is 0.918, compared with 0.924 when trained only on Romanized posts.

The class-specific comparison between XLM-RoBERTa and MuRIL on joint training is especially informative on the Romanized test set. MuRIL’s hate-class F1 of 0.670 leads XLM-RoBERTa’s 0.666. On offensive posts XLM-RoBERTa reaches 0.867, while MuRIL reaches 0.842. For IndicBERT, combining scripts lowers Romanized offensive F1 from 0.846 to 0.808 and hate F1 from 0.651 to 0.637. The joint data can thus produce gains in one setting and losses in another, even when the added posts come with the same class definitions.

Testing a source-trained classifier on the other script

The zero-shot results are substantially below the separately trained results on either destination. In the Bengali-script-to-Romanized direction, m-BERT leads on Romanized test macro-F1 with 0.390. IndicBERT records 0.319, MuRIL 0.269, and XLM-RoBERTa 0.230. A leading score in the standalone condition therefore establishes what an encoder can learn with supervision in the destination form. The zero-shot results address a different question, namely how much of the classification behavior survives a change of written input without destination labels.

In the reverse direction, MuRIL leads at 0.414 on the Bengali-script test set after training on Romanized Bengali. IndicBERT follows at 0.397. XLM-RoBERTa reaches 0.299, and m-BERT reaches 0.268. The fact that the ranking changes with direction is important. A Bengali-script source offers a different set of labeled expressions from a Romanized source, and each classifier responds differently when the unseen test examples come from the other collection.

Giving the source-trained systems labeled Romanized examples improves incoming transfer. At 32 target tweets per class, m-BERT remains the leader at 0.530 macro-F1. MuRIL follows at 0.507, with XLM-RoBERTa at 0.456 and IndicBERT at 0.332. At 64 target tweets per class, MuRIL reaches 0.671 and m-BERT gives 0.655. XLM-RoBERTa reaches 0.570 and IndicBERT gives 0.355. These few-shot scores are averages across the target samples drawn for the experiment.

Romanized test macro-F1 as MuRIL receives more target labels

Each tested increase in Romanized supervision improves the Bengali-script-trained classifier.

Romanized test macro-F1 as MuRIL receives more target labelsMTx0: 0.269MTx00.269MTx32: 0.507MTx320.507MTx64: 0.671MTx640.671MTx128 (this paper): 0.751MTx128 (this paper)0.751
The numbers
System or settingMacro-F1
MTx00.269
MTx320.507
MTx640.671
MTx128 (this paper)0.751

With 128 target examples per class in that direction, MuRIL leads on Romanized test macro-F1 at 0.751. m-BERT reaches 0.692, XLM-RoBERTa reaches 0.668, and IndicBERT reaches 0.462. MuRIL thus leads at the larger target budgets even though m-BERT is better at direct transfer and with the smallest target sample. The best reported result at this budget is still below XLM-RoBERTa’s 0.805 when trained on the full Romanized training partition.

For Romanized-to-Bengali-script transfer, MuRIL leads at every tested budget. With 32 target examples per class its Bengali-script macro-F1 is 0.575, followed by XLM-RoBERTa’s 0.542. With 64 examples per class the respective scores are 0.645 and 0.613. At 128 examples per class, MuRIL reaches 0.709, and m-BERT has the next highest result at 0.691. XLM-RoBERTa gives 0.664 and IndicBERT gives 0.557 at that budget. The leading score remains below the Bengali-script standalone result of 0.803.

The direction of change with more labels is consistent across the four encoders and both transfers. Their standings relative to each other are more variable. This makes the budget part of the experimental condition that a reader needs when interpreting an outcome. The results show that an encoder that needs more help initially can benefit more from adaptation and end up ahead once given enough examples from the test form.

Training and testing with translated input

When the input consists entirely of English translations of Bengali-script material, XLM-RoBERTa has the leading test macro-F1 of 0.764 and accuracy of 0.796. m-BERT follows at 0.754 macro-F1 and 0.777 accuracy. MuRIL reaches 0.722 and 0.771, and IndicBERT reaches 0.671 and 0.723. XLM-RoBERTa’s strongest aggregate result in this condition is below its macro-F1 of 0.803 when it trains and tests on the original Bengali-script posts.

Some metrics order the translated runs differently. m-BERT has hate-class F1 of 0.775 and AUROC of 0.893, while XLM-RoBERTa has hate-class F1 of 0.757 and AUROC of 0.891. The offensive-class F1 results for those runs are 0.647 and 0.649, respectively. These values show the classification behavior after translation and training in the resulting input space. The experiment leaves open which individual expressions were rendered faithfully and which became harder for a classifier to interpret.

Adding translations to Romanized training data

When the authors add translated Bengali-script examples to the Romanized training material, m-BERT gives the strongest aggregate result among the encoders in that arrangement. Its Romanized test macro-F1 is 0.811, its accuracy is 0.856, and its AUROC is 0.930. It also leads on hate-class F1 at 0.694 and on offensive-class F1 at 0.852. XLM-RoBERTa gives macro-F1 of 0.799 and hate-class F1 of 0.670. MuRIL reaches macro-F1 of 0.791, and IndicBERT reaches 0.787.

Within an encoder, the most apparent benefit from translated additions comes from m-BERT. Its Romanized standalone macro-F1 appears as 0.789 in the results table and as 0.790 in the prose comparison. The change to 0.811 is an improvement under either reported starting value. MuRIL’s Romanized macro-F1 also rises from its standalone 0.788 to 0.791 with the translations. Under joint training on the original scripts, however, MuRIL reaches 0.800.

XLM-RoBERTa’s Romanized result with translated additions falls below its standalone macro-F1 of 0.805, and IndicBERT’s falls below its standalone 0.793. These comparisons show that using English as the form of the extra training material is an empirical choice with different outcomes across encoders. The fact that Romanized writing can include English makes the strategy plausible but does not determine which classifier will benefit.

Leading macro-F1 on the Romanized test set by training arrangement

Adding English translations gives m-BERT the strongest reported macro-F1 on Romanized posts.

Leading macro-F1 on the Romanized test set by training arrangementXLM-RoBERTa trained on Romanized posts: 0.805XLM-RoBERTa trained on Romanized posts0.805XLM-RoBERTa trained on both original scripts: 0.810XLM-RoBERTa trained on both originalscripts0.810m-BERT trained on Romanized posts and translated additions (this paper): 0.811m-BERT trained on Romanized posts andtranslated additions (this paper)0.811
The numbers
System or settingMacro-F1
XLM-RoBERTa trained on Romanized posts0.805
XLM-RoBERTa trained on both original scripts0.810
m-BERT trained on Romanized posts and translated additions (this paper)0.811

The chart compares the best run under each training arrangement and therefore includes a change of encoder. On Romanized accuracy, XLM-RoBERTa with both original scripts gives 0.865, above the 0.856 of m-BERT with translation augmentation. The two choices can be ordered by the measure used to choose among them. Macro-F1 answers the question about performance with equal weight for each class, while accuracy summarizes the share of correctly classified posts.

Moving between Bengali-script datasets

The authors conduct a further experiment using the collection from Romim and colleagues. The earlier paper had reported 87.5% test accuracy for a support vector machine. Das and colleagues run XLM-RoBERTa throughout their comparison so that the training dataset, instead of the kind of classifier, is the variable of interest. They restrict their side to Bengali-script tweets and merge their hate and offensive classes to match the broader positive category used by Romim and colleagues. The resulting task has a different label scheme from the primary experiments.

When trained and tested on the Romim collection, XLM-RoBERTa records 0.894 macro-F1 and 0.905 accuracy. Training and testing on the new Bengali-script collection under the merged label gives 0.843 macro-F1 and 0.846 accuracy. These are the within-collection reference scores for the comparison.

Training on the Romim data and testing on Das and colleagues’ Bengali-script data yields 0.646 macro-F1 and 0.646 accuracy. Training on the new data and testing on Romim’s yields 0.754 macro-F1 and 0.774 accuracy. Each transfer is weaker than the corresponding run that learns from the evaluation collection’s own training data. The difference between the transfer directions is observable even though the authors have aligned the script, positive label, and classifier.

Pooling the datasets gives 0.899 macro-F1 and 0.910 accuracy on the Romim test material. On Das and colleagues’ test posts, joint training gives 0.835 macro-F1 and 0.837 accuracy. Thus the additional material improves the Romim test result, while the new collection has its highest binary test scores in the run trained on that collection alone. The result lends perspective to the script comparisons. Considerable transfer difficulty can occur even when the script is held constant and the class distinction is made broader.

What the ablations show

The comparisons change the supervision

The paper includes no ablation that removes an encoder component, and instead examines changes to the labeled data, transfer budgets, translation, cross-dataset performance, and a sample of classification errors.

The separate and joint runs show what happens when examples in the other writing form enter supervision. With the test group fixed, the value of that addition depends on the encoder. MuRIL gains on macro-F1 on both test groups. XLM-RoBERTa gains on Romanized posts, while its Bengali-script macro-F1 drops. IndicBERT sees a larger change on Romanized posts in the downward direction than it does in the upward direction on Bengali-script posts. These outcomes measure the net effect of including more examples with a different input distribution. The design changes how much supervised material the system gets and what kind of text that material contains.

The target-budget comparisons address a different intervention. They begin with a source-trained classifier whose target performance can be measured before adaptation, then add labeled target examples and continue training. The consistent improvement shows that the classifiers can use target supervision to recover some of the performance lost in direct transfer. Since the budget applies within each class, even the smallest adaptation set exposes the system to labeled target examples of the rarer category. The paper does not report whether the added examples help most by improving hate detection or by changing decisions elsewhere, since this experiment reports macro-F1 alone.

The authors link part of MuRIL’s performance to pretraining on transliterated text. Its gains under joint training and its lead in the larger adaptation runs are consistent with the explanation. The experiment compares full encoders with different sources, parameters, and pretraining choices, so the role of transliteration itself remains an interpretation. Its direct-transfer results also show that pretraining exposure and task supervision make distinct contributions. On incoming Romanized transfer, m-BERT has the better zero-shot score even though MuRIL is the one the authors single out for explicit coverage of transliterated counterparts.

The translation runs change the representation of the added training material. With original Romanized data in training and at test time, m-BERT performs better on macro-F1 with English additions than with original Bengali-script additions. For XLM-RoBERTa, the joint run with original Bengali-script data gives the better Romanized score. The different responses narrow the paper’s finding to particular combinations of encoder and data. Plausible factors include how translation handles abusive phrasing and how closely the translated inputs resemble English fragments already found in Romanized tweets. The experiment leaves their individual contributions unmeasured.

The cross-dataset test offers another way to investigate transfer. Aligning the script and merging the labels removes two apparent sources of mismatch, yet neither cross-dataset run reaches the performance obtained using the destination’s own training data. The collections may differ in source, wording, subject matter, sampling, and what their annotations count as abuse. The experiment measures the transfer across the collection boundary and cannot assign the loss to any single difference. The asymmetry also means that a larger transfer score in one direction does not on its own establish that one dataset is of higher general quality.

What the error review explains

The authors manually examine 50 test posts for which the predicted category and benchmark label differ. They group recurring problems into several kinds and show examples using XLM-RoBERTa’s predictions. They report similar trends for the other encoders. This kind of review helps interpret scores that otherwise record only whether the predicted class agreed with the annotation. A disagreement can arise because the system missed an insult, because it found an attack the annotators did not see, or because reasonable readers may disagree about the label.

One example concerns a post comparing its addressee to a street dog and appending several emoji. The reference judgment is offensive, but the illustrated prediction misses that reading. The authors point to the possibility that emoji make a post sound sarcastic or introduce ambiguity about its tone. Someone interpreting the words together with the symbols may make a different judgment from someone emphasizing their literal content. The example raises that possibility without isolating the symbols experimentally. There is no reported comparison of the prediction for the same tweet with and without the emoji.

Another example uses a sequence of profanities in a complaint about a train. The reference puts the post outside the offensive category, while the classifier assigns that category. The vocabulary is strongly associated with abuse, yet the message does not direct an insult at a person or a community. The case illuminates a tension built into the data collection. Finding messages by searching for vulgar or derogatory expressions makes it possible to gather likely cases. The labeling task then asks the classifier to distinguish the uses of those expressions, including when a string of them is doing little more than expressing frustration.

Political and religious viewpoints pose another problem. One example is a Romanized reply that brings together religious references and political affiliations. The annotators marked it as hate, and the illustrated system missed that classification. The authors describe such cases as sensitive to viewpoint. A reader may interpret a reference as an attack on a religion, as an attack on supporters of political parties, or as part of an exchange whose intent is hard to recover. How the reader resolves that question affects what they regard as the appropriate label.

In the example of mixed linguistic structure, a post criticizes a political party and its supporters using English wording alongside Bengali script. The benchmark treats the message as offensive, but the classifier does not assign that label. The authors use this category to draw attention to cases where the language supplying particular words and the language shaping the sentence do not align neatly. The example also illustrates why mixing and Romanization are separate aspects of the task. A post can use Bengali script and still require the reader to follow a switch into or out of English.

The final kind of disagreement concerns the reliability of the reference judgment. The authors examine a post that uses religiously charged wording while attacking supporters of a politician. The benchmark calls the post hate, and the classifier calls it offensive. The authors consider whether the target may have been political and the slur may have prompted an annotation of hate in the absence of a clear group-directed attack. They treat this as a possible problem with the label. The evidence here is the ambiguity revealed by reading the post again, rather than independent verification of a replacement label.

The error categories explain why better cross-script recognition can address only part of the task. A system can recognize that words in different scripts have comparable meanings and still misunderstand whom they target or how an emoji affects their tone. Conversely, a classifier may recognize an insult yet assign a different label because it interprets the target differently from the annotators. Those are distinct judgments that are combined into the same measured prediction.

Limitations

Limits the authors identify

The authors explicitly flag the absence of external context. Their classifiers use the tweet text without incorporating a profile biography, prior posting patterns, or information such as the user’s gender. This makes the benchmark a test of what can be inferred from the post. A reply can rely on a thread that explains whom a pronoun refers to, and a remark can presuppose knowledge of the political or religious dispute under discussion. The paper’s examples give reasons to consider contextual information, but the study leaves the benefits of any specific context source unmeasured.

The authors also identify adversarial robustness as untested. The benchmark includes the Romanization and code-mixing found in naturally collected public posts. Its results concern the classification of those posts with the available training data. Whether a detector would still work when someone deliberately changes their writing to get around it is a separate empirical question. The authors propose future testing in that setting.

The ethics discussion calls for rigorous testing before using the classifiers directly on a platform. It also identifies unintended bias towards particular communities as a subject for further study. Target labels provide a starting point for that inquiry because they allow researchers to locate posts associated with different targets. The reported comparisons mainly aggregate across those targets. A good score for hate speech leaves open how often messages concerning a specific gender, religion, or linguistic community are wrongly flagged or missed.

Limits that follow from the design

The search terms specify the part of public Twitter conversation from which candidates could be drawn. Adding community names broadens the search beyond overt abusive terms, but a hateful post can still avoid all of the selected expressions. Account and month limits reduce concentration in the retrieved material. The resulting category counts describe the benchmark under that collection procedure and give no estimate of the prevalence of hate or offensiveness in general Bengali conversation. The study’s evidence about Romanized material is also tied to Twitter. Earlier Facebook and other collections provide context for the research question without making the platform coverage interchangeable.

The authors describe the train, validation, and test split as stratified by class. They do not report holding out accounts, months, or events as groups. Limiting the contribution of an account controls how much of that account’s writing can enter the sample. A group-based split would address a different question about how well predictions generalize to authors whose writing has not appeared in training. The cross-dataset experiment gives some evidence of performance when the collection changes, but it uses the merged positive class in Bengali script. Its results cannot establish transfer between platforms for the full three-category Romanized task.

The naturally collected script groups also limit what the transfer experiment can isolate. They contain different messages and different class distributions. A measured loss may reflect a change in script, different spelling choices, differing use of English, or different topics and targets. A comparison of the same messages rendered in each script would hold more of those differences fixed. The study instead measures the combined change a classifier faces when it moves between the two collected groups, which is relevant to its practical question about reusing available data.

Similar care is needed with the translation result. The original labels are carried over to a text produced by Google Translate. The experiment does not score whether those translations preserve the derogatory force, the target, or the intended tone of the originals. For instance, the translation may preserve the apparent target of a tweet while shifting how vulgar it sounds. A classifier evaluated on a translated tweet is scored against the label established for the original, so its performance combines the effects of translation and classification. In the augmentation setting, the measured outcome is whether those translated examples help on the original Romanized target.

The few-shot comparisons establish the effect of giving target examples to classifiers already trained on the source form. The paper does not report a matched run that starts from the pretrained encoder and trains it only on the same small target sample. Such a comparison would isolate the benefit of the source task training when destination labels are scarce. The reported averages over sampled target sets make the comparison less dependent on a single draw, while leaving the variation among draws unspecified. For full-data training, the Romanized macro-F1 of 0.811 for translation augmentation and 0.810 for original-script pooling are reported point estimates. Evidence about their stability across reruns would be needed to establish a reliable lead between those arrangements.

The process for settling disagreements gives the classifiers a reference label for each retained tweet. It also excludes cases where each reader reaches a different decision. The resulting test scores concern retained examples under that rule. In a moderation setting the messages that caused the most divergent readings would still require a judgment, possibly with additional context. Similarly, the agreement statistic summarizes consistency overall, and gives no indication of which particular group labels or types of tweet prompted the most disagreement.

Finally, the manual review samples errors and provides examples of how they can occur. It does not provide counts for all tweets with emoji, code-mixing, or political references in the test set. Its examples therefore support explanations of possible failure modes rather than estimates of how often those types of content are misclassified. The doubtful reference labels warrant the same care. The authors illustrate that some disagreements invite reconsideration, while the study leaves the frequency of such label problems unknown.

What came after

One later citing work takes up resources for automated identification in the area of gender-related online harm. Its focus connects to a distinction in the Bengali benchmark between the type of message and the identity of its target. A tweet can carry a gender target alongside an individual target and still receive the offensive label. Resources for a harm centered on gender face a more specific question about how to represent that aspect of a message. The citation connects the studies at the level of resources for identifying harm. Whether the later work used the tweets or their target annotations remains unspecified. Resources for the Automated Identification of Online Gender-Related Harm

Another later work addresses low-resource counterspeech generation for Indic languages. Counterspeech is a response that challenges harmful speech. Its generation poses a different objective from classifying the original post. Das and colleagues examine how the written form and available labels affect recognition. The later work’s subject is producing a reply under language-resource constraints, placing the problem within text generation. The citation connects the two tasks, while leaving open whether the work used the benchmark, its classifiers, or any of the training arrangements. Low-Resource Counterspeech Generation for Indic Languages

Cite

Cite as Mithun Das, Somnath Banerjee, Punyajoy Saha and Animesh Mukherjee. 2022. Hate Speech and Offensive Language Detection in Bengali. Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (Volume 1: Long Papers).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2022.aacl-main.23

@inproceedings{das2022hate,
  title = {{Hate Speech and Offensive Language Detection in Bengali}},
  author = {Mithun Das, Somnath Banerjee, Punyajoy Saha and Animesh Mukherjee},
  booktitle = {Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)},
  year = {2022},
  doi = {10.18653/v1/2022.aacl-main.23},
  url = {https://doi.org/10.18653/v1/2022.aacl-main.23}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/das-2022-hate-speech-offensive-language-detection/