Elamur Research

Interpretable Multi Labeled Bengali Toxic Comments Classification using Deep Learning

Paper · 2023 · Tanveer Ahmed Belal, G. M. Shahariar and Md. Hasanul Kabir

Summary

A Bengali social media comment can threaten someone and insult them in the same sentence. A system that only detects toxicity can flag the comment, while a system that assigns a single category must choose which kind of abuse to record. The authors treat these as separate decisions. Their first classifier identifies toxic comments. A second classifier can assign several labels to each comment that the first one flags. The categories are insult, threat, vulgarity, trolling, hate, and religious toxicity.

To train and evaluate the classifiers, the authors gather Bengali comments from existing collections and annotate them again under a common scheme. The resulting dataset contains 16,073 comments, of which 8,488 are toxic and 7,585 are non-toxic. Annotators can assign several toxicity labels to a comment, and a third expert helps resolve disagreements between the initial readers. The authors make the dataset public. Its labels support separate experiments on finding toxic comments and identifying the forms of toxicity present in comments already known to be toxic.

On the binary test, the strongest classifier by accuracy is a long short-term memory network, or LSTM, using contextual representations from Bangla BERT. It reaches 89.42% accuracy. On the multi-label test, the best reported average accuracy is 78.92%, from a classifier that combines convolution, a bidirectional LSTM, and attention. Its weighted F1 score is 0.86. The convolutional layers look for patterns in stretches of the input, the bidirectional network incorporates information in both reading directions, and the attention calculation forms a representation that gives some positions more weight than others. The multi-label scores come from testing on comments annotated as toxic. The paper leaves the accuracy of the complete pipeline on an incoming mixture of comments unmeasured.

The authors use Local Interpretable Model-Agnostic Explanations, or LIME, to examine individual predictions. LIME varies the input around a particular comment and estimates which words help account for the resulting changes in prediction. In the example the paper discusses, the classifier assigns high probabilities to both vulgarity and insult, and some of the same words help explain both outputs. The example illustrates what an explanation can reveal about a single decision. Across the test set, the categories have unequal representation, and the paper examines errors for hate, threat, trolling, and insult because their F1 scores are lower.

Deep dive: Interpretable Multi Labeled Bengali Toxic Comments Classification using Deep Learning

Belal and colleagues classify Bengali comments by toxicity and overlapping abuse categories, then use LIME to explain individual predictions. · about 32 minutes to read

The problem and its context

Detecting abuse and describing it

The paper begins from a practical problem in text classification. People use social networks to talk to one another, and the same channels can carry harassment, abuse, and threats. A system that processes Bengali comments needs a way to recognize harmful language in the form in which people actually write it. It also needs an operational definition of what it is being asked to recognize. The authors treat toxicity as a broad category and point out that readers can differ in what they consider objectionable. A label therefore represents a judgment made under an annotation scheme.

The most basic formulation gives each comment a binary label. The resulting classifier learns to distinguish toxic comments from non-toxic ones. That formulation can answer whether a comment should be flagged under the scheme. It groups threats, vulgar expressions, and other forms of abuse under a common positive decision. This grouping is appropriate for a general screening question, but it discards the category information that a reader might want when examining the flagged material.

A multi-class formulation adds detail by allowing more possible answers while asking for one answer per comment. In a collection organized this way, a threat and an insult might be separate categories, with one of them selected for any given example. The paper's objection is about the unit being classified. A whole comment can contain several expressions, and a single expression can contribute to more than one judgment. Assigning a sole category makes an annotator collapse those judgments into one choice. A multi-label formulation lets the labels coexist, so a training example can preserve the judgment that the comment is both a threat and an insult.

Keeping the binary decision as a separate stage gives it a distinct job. It sees non-toxic comments as well as toxic ones and learns the boundary between those groups. The category classifier is trained on toxic material, where it learns the boundaries relevant to individual types. For instance, a toxic comment can supply a negative example for the threat label while supplying a positive example for insult. This is a different meaning of a negative example from the one used at the first stage. The two stages divide the work according to the question each receives during training.

Toxicity also poses a problem for how words are represented. The authors underline the importance of context and report encountering toxic words missing from pretrained word representations they examined. A classifier that receives an uninformative value for a missing word must make its decision using whatever information remains. A classifier whose input represents a word in relation to its surrounding text has a way to use the construction in which a term appears. This distinction matters for the paper because the authors want to identify particular kinds of abuse and later inspect the words associated with particular predictions.

Earlier Bengali classification studies

The authors describe earlier work in terms of the choices made about labels, input representations, and classifiers. In the binary line of work, Banik and Rahman treat Bengali comments as either toxic or non-toxic. Their comparison sets supervised classifiers such as logistic regression and support vector machines alongside neural approaches. The paper identifies a convolutional network as their strongest classifier and notes their use of Word2Vec word embeddings. That work addresses the screening decision that Belal and colleagues keep as the first stage.

Chakraborty and Seddiqui also take a binary approach, in their case to threat and abusive language. As described by Belal and colleagues, they compare conventional classifiers with a combination of convolution and an LSTM. A linear support vector machine gives their strongest reported accuracy. Ahammed and colleagues use Bengali Facebook material to study hate speech and compare a support vector machine with naïve Bayes. The role of these examples in the paper is to show the range of ways researchers had drawn a binary boundary. The positive side of the boundary depends on the particular study and its definition of the phenomenon.

The toxic-speech study by Malik and colleagues is relevant to the choice of input representation as well as the choice of classifier. The authors describe it as testing conventional and neural classifiers and using BERT and fastText representations. This places contextual representation within the earlier work discussed by the paper. The contribution of the current study lies in how it uses Bangla BERT in a relabeled, multi-stage experiment and how it examines the resulting predictions.

The multi-class studies show how earlier systems tried to add detail to the output. The cyberbullying work the paper discusses evaluates both a binary decision and a multi-class task. Its approach uses convolution and recurrence, and its multi-class experiments include an ensemble. Das and colleagues examine Bengali hate speech with architectures that combine convolution with different ways of handling sequence information, including an attention-based approach. Karim and colleagues use a multichannel convolutional and recurrent architecture for Bengali hate speech and examine embeddings including GloVe, Word2Vec, and BangFastText. Aurpa and colleagues compare BERT and ELECTRA for Bengali abusive comments, using pretrained transformer architectures.

The authors see recurring constraints in this literature. They describe many earlier datasets as small or unevenly distributed, and they argue that binary and multi-class designs are too restrictive when several kinds of toxicity occur together. They also see a gap in interpretability. A reported classification score gives a measure of agreement with annotated examples. An individual prediction still leaves a separate question about which words supported it. Those concerns motivate the paper's combination of a revised label scheme, contextual input representations, and a method for explaining a prediction after it has been made.

The method, step by step

Building a common set of labels

The data preparation begins with existing collections. The authors draw from the Bangla Abusive Comment Dataset, a Bengali hate-speech dataset, and the Bangla Online Comments Dataset. The source collections come with different labeling schemes. The authors inspect the comments and judge the original labels to be inconsistent or unsuitable for their purposes in some cases. They also find comments that warrant several categories. They consequently apply a new annotation scheme to the collected texts.

That decision changes what an example can teach a classifier. A source collection can emphasize the distinction needed for its original task. In the combined collection, a comment has a toxicity judgment and, for a toxic comment, a set of category judgments. The six available toxicity categories are vulgar, hate, religious, threat, troll, and insult. Each category records its own decision for the same item. The category names identify the classes used in the experiments, including the class called religious, which is part of the toxicity scheme.

The authors use professional annotators and give each comment to two of them. If their judgments differ, a third expert joins the resolution through discussion. This annotation procedure gives the final label set a common review process. It also means the labels used for evaluation are the resolved judgments. A comment can retain several category labels when the readers agree that more than one applies, or reach that conclusion during adjudication.

The paper describes two checks on this work. Its control exercise starts with 100 randomly selected sentences that an expert had already labeled and includes 30 control samples. The annotators are unaware of which samples serve as controls, and the authors describe the controls as easy to understand. All annotators score above 80% on the authors' trustworthiness measure. Separately, the authors compute Cohen's kappa, a measure of agreement that accounts for agreement expected by chance. They report an average kappa of 0.96 for the toxic and non-toxic classes and refer to individual category kappas in their dataset table. The two checks address different issues. The control exercise compares judgments against expert-labeled material, while kappa describes agreement between annotators under the scheme.

The resulting collection has 16,073 comments. The 8,488 comments judged toxic supply the category examples, and the 7,585 judged non-toxic provide the other group for binary detection. In the binary task, every toxic comment is a positive example regardless of which types apply. In the multi-label task, each toxic comment still carries its individual category decisions. A category count therefore measures how many comments received that label. One comment can contribute to several such counts, while contributing only once to the total number of toxic comments.

From a raw comment to a numeric representation

The proposed pipeline begins with a single comment. It prepares that comment for the first classifier, sends it to the category classifier if it is flagged, and can use LIME to inspect a selected prediction. LIME runs after a classifier returns scores. The scores it explains have already been produced by the classification pipeline.

From Bengali comment to toxicity labels and explanation

The steps in order.

From Bengali comment to toxicity labels and explanationStep 1: Clean the raw comment1. Clean the raw commentStep 2: Tokenize and pad or truncate2. Tokenize and pad or truncateStep 3: Encode the tokens with Bangla BERT3. Encode the tokens with Bangla BERTStep 4: Pool contextual representations for classification4. Pool contextual representations for classificationStep 5: Predict whether the comment is toxic5. Predict whether the comment is toxicStep 6: Route flagged comments to the category classifier6. Route flagged comments to the category classifierStep 7: Predict applicable toxicity categories7. Predict applicable toxicity categoriesStep 8: Use LIME to explain selected predictions8. Use LIME to explain selected predictions

The cleaning step removes punctuation, emoticons, hyperlinks, and stop words. Stop words are words the preprocessing scheme treats as common enough to omit. This step changes the input before any classifier sees it. The remaining string provides the evidence available to Bangla BERT and to each downstream classification layer. For instance, the system is designed to base a decision on the retained wording after a hyperlink or emoticon has been removed.

The Bangla BERT tokenizer then turns that string into units the encoder can process. In tokenization, the units become entries in a sequence with a numeric identifier for each entry. The tokenizer supplies input IDs and mask IDs. Input IDs tell the encoder which tokens are present. The mask marks which positions contain actual input and which are padding. The authors set the sequence length to 300 tokens. A shorter sequence receives zero padding. For a longer sequence, the system takes the tokens up to that limit and drops the rest. The length rule produces a uniform input shape for all comments.

Bangla BERT then represents each token by 768 real values. These values are features computed from the encoded text. A token's features can depend on other tokens in the comment, which is the sense in which the representations are contextual. The paper describes the output for a padded comment as an array of shape 300 by 768. One direction of that array distinguishes token positions and the other distinguishes the features calculated at each position. The array still retains a connection between a set of features and a location in the input.

The next operation described is max pooling. Pooling summarizes groups of values, with max pooling retaining the largest value in each group. The preprocessing and embedding description says that max pooling reduces the array to a vector of 768 values per comment. At that point, each retained value summarizes a feature over the sequence. For an engineer reading the architecture, there is an important distinction between this reduction and the pooling that the paper also describes inside the classifiers. The reduction to a single vector removes the explicit token axis. Pooling inside a convolutional classifier can leave a shorter sequence that subsequent layers still process in order.

Later stages are described as applying recurrence or convolution over an embedding representation. That language leaves the precise handoff from the initial pooling step to those stages ambiguous. The operations and the reported output sizes are clear individually. The description leaves open which classifier receives the full token array, how the pooled sentence vector is arranged for recurrence if it is used there, and whether some pooling in the architecture description refers to the same operation. The proposed classification stages can be understood in terms of their stated functions even with that interface unresolved.

Deciding whether the comment is toxic

For the binary decision, the proposed classifier uses long short-term memory. An LSTM is a recurrent network, which means it carries a state from one step of a sequence to the next. Incoming information can change that state, and the state can preserve information from earlier inputs. The authors use it to represent dependencies across the comment. The underlying idea is that the contribution of a feature may depend on the features that occurred earlier in the sequence.

The LSTM design includes a cell state and gates that control how information moves through it. The input gate regulates new information, the forget gate regulates how much existing information remains, and the output gate regulates what part of the state contributes to the outgoing representation. The paper uses this mechanism to explain why recurrence can carry information beyond the immediate input. It gives the classifier access to a representation built up across successive positions.

The binary architecture places max pooling, dropout, and a dense layer after the LSTM. Pooling selects strong values from the recurrent representation. Dropout reduces dependence on particular activations during training by temporarily suppressing some of them. A dense layer combines its input features into an output for the classification decision. The hidden layers use leaky rectified linear activation, which retains a small response for negative inputs while passing positive inputs through. The final activation is sigmoid, which maps a score to a value interpretable as a predicted probability for toxicity under the binary setup.

A binary probability and a binary decision are distinct outputs. The first is a score. The second is what the system obtains when it applies a decision rule to that score. The pipeline uses this decision to determine whether a comment proceeds. If it is accepted as toxic, the category classifier can examine it. A comment that fails the gate stops there. This is why the first classifier can affect the eventual availability of every toxicity label, even though it learns only the coarse toxicity judgment.

Assigning a set of toxicity categories

The second classifier combines a convolutional neural network, a bidirectional LSTM, and attention. A convolution applies the same filter at multiple locations in an input, looking for a pattern in each local region. A useful filter can respond wherever the pattern appears. In a text classifier, this offers a way to capture information distributed across a short stretch of input. The filter operates on the numeric representation produced upstream, so the features it receives can already encode context from Bangla BERT.

The authors describe three one-dimensional convolutional layers. They use 512, 256, and 128 filters, in that order. The associated kernel widths are 4, 3, and 2. A kernel width gives the span of positions that a filter examines together at that layer. The first convolution works on the incoming representation, and subsequent convolutions work on features produced and pooled by earlier layers. As a result, the kernel widths in the later layers refer to positions in those intermediate representations.

Each convolution uses a rectified linear activation, which preserves positive responses and sets negative responses to zero. After every convolution, max pooling with a pool size of 2 keeps the strongest value within each pooling group. The result of the convolution and pooling sequence is a representation in which downstream processing can work with local signals that have survived several transformations. The paper then applies a bidirectional LSTM with 128 units to the output of the last pooling layer.

Bidirectionality lets one recurrent pass process the sequence in its original order and another process it in reverse. At a given position, the forward state can use information acquired from earlier positions, and the backward state can use information acquired from later positions. The method joins those states. That gives the attention calculation access to features informed by both directions. The paper also uses L2 regularization, which adds a penalty based on the size of learned weights to discourage the classifier from relying on large weights that fit peculiarities of the training data.

The attention calculation begins by transforming the joined hidden state and turning the resulting score into an attention weight. In Unicode notation, the paper gives the operation as follows.

αᴬₜ = softmax(Wᴬ Hᴬₜ + bᴬ)

Here, t identifies a timestep in the sequence received by the bidirectional LSTM. The superscript A identifies the quantities in the attention calculation. Hᴬₜ is the concatenated forward and backward hidden state at that step. Wᴬ is the learned filter applied to that state, and juxtaposing Wᴬ and Hᴬₜ denotes that multiplication. bᴬ is the learned bias added to the transformed state. softmax converts a set of scores into normalized weights. αᴬₜ is the resulting attention score associated with the step. The notation gives the transformation at a step, while the description leaves the exact axis of softmax unspecified.

The next equation uses the attention scores to combine hidden states.

zᴬₜ = ∑ₜ₌₁ αᴬₜ Hᴬₜ

zᴬₜ names the context vector in the paper's notation, with A again marking the attention calculation. The summation sign directs the reader to combine terms, with t serving as the time-step index and 1 marking the start. The equation leaves its upper limit implicit. In each term, αᴬₜ weights the joined state Hᴬₜ from the corresponding step. As written, the expression describes a weighted sum over steps even though the output keeps a step subscript. The surrounding description also speaks of joining a score and a state. The equation supplies the weighted-sum operation, and the exact relationship of that operation to any concatenation is left unstated.

Attention is part of the computation that produces the category scores. It offers a mechanism for giving stronger influence to certain positions in the representation. Those positions are downstream of convolution and pooling, and the recurrent states include information from both reading directions. An attention score therefore attaches to a processed state. LIME, which the authors use later, begins from a different point and asks how word changes around a specific example affect an output.

The final dense layer uses sigmoid to give each category its own probability. A comment can receive high values for insult and vulgarity simultaneously. As long as each score meets the decision rule for its category, both labels can be returned. The arrangement fits the data because the target categories can overlap. Its hidden layers are shared across the category outputs, which also gives the classifier a way to reuse evidence that is relevant to several labels. The experiment does not isolate the effect of this sharing from the other architectural choices.

Training the classifiers

The authors train the binary and multi-label classifiers on different targets derived from the same annotation scheme. For the binary task, the subtype labels are collapsed into the toxic class, so any toxic comment has the same binary target. For the multi-label task, only comments with a toxic annotation are used. Each category contributes its own positive or negative target for each of those comments. This is how a classifier can learn the difference between a toxic comment that carries a particular subtype and a toxic comment that lacks it.

All the reported configurations use binary cross-entropy. In the binary task, the loss penalizes a probability for the single toxicity decision when it disagrees with the target. In the multi-label task, binary cross-entropy can evaluate the target for each category against its corresponding sigmoid score. Confident errors receive a larger penalty. The loss is a quantity used to adjust the classifier during training. Accuracy, precision, recall, and F1 are measured afterward to describe test behavior.

The reported maximum sequence length is 300, and the batch size is 16. A batch is the group of examples processed together for a training update. The authors use Adam to perform the updates and set the learning rate to 1e-5. They report L2 regularization across the experiments. They also state that the BERT-based parameter settings were kept unchanged and include explicit Bangla BERT fine-tuning configurations in their comparisons. Fine-tuning here refers to adapting a pretrained classifier to the task, while the other configurations use BERT to supply representations for additional classification layers. The paper leaves the trainable status of individual embedding layers in those additional configurations unspecified. The experiments run on an NVIDIA Tesla K80 GPU.

Explaining a decision after prediction

The authors use LIME to make a prediction easier to inspect at the word level. The approach starts with an individual comment and an output of interest. For the first classifier, that output concerns toxicity. For the second, it can concern an individual subtype. LIME then builds a set of nearby inputs by varying the features of the original example and obtains a prediction from the classifier for each variation. The paper describes generating samples from the feature representation and weighting them by similarity to the original observation.

This weighting makes the explanation local. Variations that resemble the comment matter more when estimating which features support the prediction on that comment. LIME fits an interpretable account of how features relate to the classifier's scores in that neighborhood and selects a small set of important features. The paper names Lasso as an example of the feature selection step. The underlying classifier makes the scores that LIME is trying to approximate. The explanation estimates which changes in the sampled neighborhood correspond to changes in those scores.

For the text explanations, the authors use 1000 samples. The binary displays use six word features, and the multi-label displays use ten. For a comment assigned several labels, the authors can examine which words contribute to the score for one label and repeat the inspection for another. Overlap between the displayed words gives a way to see where the explanations point to shared evidence. A word that appears in both displays has local explanatory value for both outputs under LIME's procedure. The overlap by itself leaves open how the layers inside the classifier used that word.

Experiments and results

What was held out for testing

The authors use 60% of the dataset for training. They divide the remainder between validation and test sets in a 60:40 ratio. Validation data give a way to assess a configuration while developing it, and the reported comparisons are evaluated on the test set. The split uses multi-label stratified shuffling. The purpose of stratification is to take label distributions into account when partitioning examples, which matters when some labels occur less often and a comment can carry several at once.

For binary evaluation, the relevant contrast is between toxic and non-toxic examples. Comments with one or several toxicity types all count as toxic for this task. For multi-label evaluation, the authors use only the toxic data. The distinction between these test populations is central to reading the scores. Binary detection tests the ability to find toxic material among other comments. Multi-label evaluation tests how well category scores match the annotations when toxicity is already established by the dataset.

These are component tests for a proposed pipeline. The category test gives each classifier the same kind of eligible input even if a binary classifier might have failed to flag some of those comments. That makes it possible to compare category architectures independently of the gate. An evaluation of the entire pipeline would additionally route comments using binary predictions, then score the final category decisions after that routing. The paper reports the component tests.

Which systems were compared

The binary comparison includes an LSTM with BERT embeddings, a multichannel convolutional LSTM with BERT embeddings, and fine-tuned Bangla BERT. The multichannel system is called MConv-LSTM in the paper. It combines convolution with recurrence, while the plain LSTM supplies a simpler recurrent classifier on the contextual input. Fine-tuned Bangla BERT gives the authors a comparison with adapting the pretrained architecture directly for this task.

The multi-label comparison tests an LSTM with BERT embeddings, MConv-LSTM with BERT embeddings, fine-tuned Bangla BERT, and CNN-BiLSTM with attention. Both tasks therefore include the plain recurrent configuration, a multichannel convolutional and recurrent configuration, and fine-tuning. The second task also includes the full convolutional, bidirectional, attention-based architecture described in the method. The common training settings make it possible to compare these configurations under a shared protocol. Each contrast still compares a whole configuration, with several architectural choices potentially changing together.

What the metrics count

The paper reports accuracy, weighted precision, weighted recall, and weighted F1. Precision asks how often a positive prediction matches a positive annotation. Recall asks how often an annotated positive is recovered. For the threat label, for example, precision concerns comments predicted to be threats, and recall concerns comments annotated as threats. A classifier can favor one of these metrics by changing the threshold at which a score becomes a positive prediction. F1 brings precision and recall together, so either kind of error can pull the measure down.

Weighting combines label-level results while giving greater influence to labels with more examples. On an uneven dataset, a weighted score is informative about performance across the observed test examples. It also means that a high aggregate can coexist with weak performance on a smaller category. The authors supplement the aggregate with per-class accuracy, precision, recall, and F1 for their strongest multi-label configuration. Those measures let a reader examine whether a conclusion drawn from the aggregate also holds for a specific category.

The paper describes the multi-label accuracy as overall average accuracy and notes that the task can be viewed as a collection of binary label decisions. It leaves the exact averaging rule unstated in its metric description. That matters because a score for individual label decisions and a score requiring the complete label set of a comment to match answer different questions. The reported accuracy is best read using the paper's metric name. The weighted F1 has its own aggregation and supplies a second view of performance.

The authors also plot receiver operating characteristic curves, or ROC curves, for the strongest classifier in each task. A ROC curve shows how the true-positive rate and false-positive rate change as the score threshold moves. A setting that flags more comments may recover more true positives and admit more false positives. The plots are a way to examine that tradeoff across thresholds. The headline accuracy values describe the test results under the evaluation used by the authors.

Binary detection

The LSTM using BERT embeddings achieves 89.42% accuracy on the binary test set, the highest reported accuracy among the binary configurations. The authors describe its accuracy advantage over MConv-LSTM with BERT embeddings as roughly 2%, and its advantage over fine-tuned Bangla BERT as around 1%. Those figures are the paper's stated margins. For MConv-LSTM and fine-tuned Bangla BERT, the reported precision, recall, and F1 values fall between 0.88 and 0.89, a narrow range in the paper's account of the comparison.

The result establishes the ranking of the tested binary configurations by accuracy on this split. The plain LSTM can use contextual representations effectively enough to outperform the additional convolutional configuration and direct fine-tuning in this experiment. The study does not vary one design feature at a time, so the ranking provides evidence about the configurations as trained. It leaves open how much of the difference comes from input handling, architecture, or properties of this particular split.

The following chart gives the current binary result alongside the Bengali toxic-comment result from Banik and Rahman that the authors discuss. Both figures are reported as accuracy for identifying toxic versus non-toxic comments. Each comes from its own study's data, and the earlier system is a point of historical context. The shared-test comparisons are the ones described above.

Binary toxic-comment accuracy on the Belal and Banik datasets

Both studies report binary accuracy on their own Bengali comment data.

Binary toxic-comment accuracy on the Belal and Banik datasetsBanik and Rahman's CNN on their comment data: 95.30Banik and Rahman's CNN on their commentdata95.30Belal and colleagues' LSTM with BERT on their test set (this paper): 89.42Belal and colleagues' LSTM with BERT ontheir test set (this paper)89.42
The numbers
System or settingaccuracy %
Banik and Rahman's CNN on their comment data95.30
Belal and colleagues' LSTM with BERT on their test set (this paper)89.42

Different results across the studies can reflect the examples selected and how the data were labeled, in addition to differences between classifiers. The earlier result therefore describes what Banik and Rahman obtained for their study. The relevant comparison for choosing a binary configuration in the current experiment uses the common held-out split and relabeled comments.

Category prediction

For the multi-label test, CNN-BiLSTM with attention reaches 78.92% overall average accuracy and a weighted F1 of 0.86. Its average accuracy is the highest of the tested category configurations. The authors report that it leads the LSTM with BERT embeddings by approximately 2%, MConv-LSTM with BERT embeddings by approximately 4%, and fine-tuned Bangla BERT by approximately 1%. These margins all describe the multi-label comparison on the study's toxic-comment test data.

The authors describe precision, recall, and F1 for the attention configuration and fine-tuned Bangla BERT as close. Their account of the comparisons with the LSTM and MConv-LSTM configurations places differences in these metrics in a range of around 3% to 7%. The strongest accuracy thus belongs to a configuration whose nearest competitor also performs similarly on the other aggregate measures discussed. The paper gives evidence of a lead on the test set and reports no uncertainty interval for it.

The best configuration differs between stages. The plain LSTM has the highest binary accuracy, while the architecture with convolution, bidirectionality, and attention has the highest multi-label average accuracy. The stages classify different targets on different test populations. Their headline accuracies describe how well each answers its own question. The difference between those two numbers does not measure the cost of predicting subtypes or the change in accuracy from running the full pipeline.

The per-class evaluation adds information about the labels with lower F1. The authors select hate, threat, troll, and insult for confusion-matrix plots. Each matrix records correct detections, correct absences, false positives, and false negatives for its category. Since the labels can overlap, an error on one category can occur on a comment whose other categories were predicted correctly. The category-level display makes that kind of partial success or failure visible at the level of individual labels.

An example with overlapping outputs

In the example the authors discuss, the multi-label classifier assigns a Bengali comment to both vulgar and insult, with reported probabilities of 99% and 95%, respectively. LIME examines the text features associated with those outputs. The explanation uses ten word features, and four are common to the explanation of both categories. The example therefore illustrates overlap both in the predictions and in some of the words associated with those predictions.

The probabilities describe what the classifier assigns to that example. They are distinct from the average accuracy and weighted F1 measured across held-out data. In particular, the probabilities give the two outputs on a particular comment, while the LIME display estimates the local contribution of features to those outputs. The example shows that the architecture can return overlapping types and provide corresponding word-level explanations. The paper does not use this case to estimate how often the same pattern appears across the full test set.

What the ablations show

The paper reports no component-removal ablation. It instead offers comparisons among complete classifiers, observations about missing words in embeddings, per-category error analyses, threshold plots, and an example of a word-level explanation. These analyses support different kinds of conclusions. A comparison can rank systems on a common test set. An error analysis can identify where a strong aggregate result hides weaker performance. An example can show how a particular prediction behaves under a local explanation procedure.

What the classifier comparisons isolate

The binary comparison tests whether different ways of making use of contextual representations lead to different scores. The plain LSTM with BERT embeddings comes first on accuracy. Both the plain LSTM and the multichannel convolutional LSTM receive BERT representations, so their comparison gives evidence about the resulting downstream configurations with a common source of input features. The accuracy ranking makes a limited point about architecture choice. Adding the multichannel convolutional configuration does not improve the reported binary accuracy under this protocol.

The multi-label winner uses attention, and the authors argue that focusing on important parts of the input helps the classifier use relationships in the sequence. The attention equation supplies a mechanism compatible with that account. The experimental comparison changes the convolutional architecture and the recurrent processing as well as the attention calculation. The paper leaves unmeasured what happens if the attention layer alone is removed while the convolutions, bidirectional recurrence, training procedure, and test examples stay fixed. The evidence therefore concerns the package of components, and the explanation for the package's advantage remains a hypothesis about how its parts contribute.

The same reasoning applies to label dependencies. The authors aim to capture relationships among toxicity types, and the classifier uses shared features to predict several outputs. The example involving insult and vulgarity demonstrates that the outputs can coincide and have overlapping local word explanations. It does not separate learning a relationship between the labels from learning predictors that respond to some of the same language. Those two mechanisms can produce a similar pattern in one example. The experiments give no controlled comparison that distinguishes them.

What the embedding observation establishes

The authors report encountering toxic words that are missing in the pretrained GloVe, fastText, and Word2Vec representations they considered. In their account, these missing words were represented through null values. This observation gives a concrete reason to care about coverage for the words found in their comment collection. A missing representation can leave the downstream classifier without features for a word that carries information about the type of abuse.

Bangla BERT offers contextual representations for the inputs used in the experiment. That choice addresses the authors' concern about representing words in a way that uses surrounding text, along with their concern about missing entries. The comparison does not report a controlled experiment that exchanges only the embeddings while holding the rest of a classifier fixed. As a result, the observation supports the motivation for using Bangla BERT, while the reported test scores leave the contribution of the embedding choice unquantified.

What the error analyses and explanation reveal

The per-category results show that an aggregate score can conceal uneven performance. The authors inspect confusion matrices for categories with lower F1, drawing attention to the interaction between category imbalance and errors. A false negative in one of those matrices means that an annotated type was missed. A false positive means that a category was added where the annotators left it absent. These interpretations apply within toxic comments, because that is the population evaluated at the category stage. The plots give a way to inspect failures more precisely than an overall score can.

Unequal label frequencies are one plausible contributor to those failures, as the authors suggest. A category with fewer observations offers fewer examples from which to learn its variations. The paper does not vary category frequencies experimentally, and the confusion matrices by themselves leave several explanations open. A category might also be harder to distinguish because its examples vary more in wording or because its boundary overlaps with other categories. The matrices identify which predictions deserve investigation while leaving the cause of their errors unsettled.

The ROC curves contribute a different check. They show how predictions trade off recovered positives against false alarms as the threshold changes. This helps a reader see that a classifier's behavior can vary with the decision rule applied to its scores. The LIME example works at a finer scale by investigating one comment and two outputs. It shows which words the local explanation associates with each output, including shared words. Together, the analyses describe variation across thresholds, across categories, and within an individual comment. The dataset-wide strength of the word explanations and the isolated contribution of attention remain unmeasured.

Limitations

Limits the authors identify

The authors call attention to unequal representation across toxic categories. The binary totals are fairly close, but the distributions of individual types are uneven. These are different properties of the data. The binary task pools every type into one group, so its class counts give little information about how much training material is available for a particular subtype. The authors connect this unevenness to possible bias toward some categories and examine confusion matrices where F1 is lower.

The paper also acknowledges the difficulty of defining toxicity. Readers can have different judgments about harmful or objectionable content, and the annotators resolve some cases by discussion. The reported kappa of 0.96 concerns the broad toxic and non-toxic judgments. The paper distinguishes that result from the kappas for individual categories. Strong agreement at the screening level can coexist with questions about which specific type is present, especially where several labels describe related aspects of a comment.

The authors describe missing words in pretrained representations as a problem they encountered with their data. Their use of Bangla BERT is a design response to it. They also leave more extensive work on transfer learning and fine-tuning Bengali transformer architectures for the future, together with increasing the number of examples per category. That future work would broaden the set of methods compared and provide more training evidence for smaller categories. The present findings apply to the architectures and data in the reported comparisons.

Limits that follow from the evaluation

The clearest limit is the separation of the stage tests. A toxic comment missed at the binary gate would never reach the multi-label classifier in the proposed pipeline. Conversely, a non-toxic comment incorrectly sent to that classifier would reach a stage trained on annotated toxic data. Testing the second classifier only on known toxic comments leaves both possibilities outside its reported results. In consequence, the 78.92% overall average accuracy and 0.86 weighted F1 characterize category prediction under the paper's test condition. The performance of the complete system on a mixed stream remains open.

The way the data were collected also sets a boundary. The authors relabel examples from several existing collections and use a stratified split of the resulting dataset. That measures performance on held-out comments from the combined collection. The study does not report a test that withholds an entire source or evaluates a separately gathered collection. Such tests would address whether the classifiers travel across different sources of comments or different material from the same language. The common annotation scheme improves the consistency of the comparison within the collection, while the split leaves external generalization unmeasured.

The reported margins are point estimates. The study does not give variability across repeated data splits or training runs in its account of the results. The approximate 1% accuracy lead reported for the winner over Bangla BERT fine-tuning in each task can be described as a lead under the experiment that was run. Its stability across runs is unknown. The reported common training settings make the individual comparisons easier to read, but a common protocol by itself gives no estimate of run-to-run variation.

Aggregate metrics also leave practical questions open. Weighted F1 emphasizes categories with more support, and the multi-label accuracy description leaves its averaging convention unclear. A complete label set can be wrong even when several of its individual label decisions are correct. Conversely, a category can have a superficially high accuracy if many comments lack that label and the classifier usually predicts its absence. Reading precision and recall alongside accuracy helps explain such cases. The paper makes that possible through its per-class evaluation of the strongest category classifier, while some questions about exact label-set recovery remain unresolved.

Limits that follow from the method and explanations

Several implementation choices matter to a close reading of the architecture. The paper specifies the overall embedding and pooling dimensions, kernel widths, and recurrent configuration, while leaving the tensor handoff from sentence-level pooling to sequence processing ambiguous. The attention equation leaves its normalization axis and summation endpoint implicit, and the prose and weighted-sum equation describe the creation of the context vector at different levels of detail. These gaps affect a reader who wants to reproduce the exact computation. They are separate from whether the reported comparisons use the same test data.

The input policy limits the evidence available for an individual decision. Material beyond 300 tokens is removed, and cleaning discards items such as punctuation and emoticons before encoding. A comment whose interpretation depends on something removed at either step reaches the classifier in a changed form. The paper does not report an experiment varying the cleaning policy or the sequence limit, so the effect of these choices on particular types of toxicity is unknown. The system also takes a comment as its input. Its architecture provides no separate representation of surrounding conversation for cases in which that information would affect a reader's judgment.

The paper reports example probabilities and ROC curves, while leaving probability calibration unmeasured. Calibration asks whether a given score corresponds to the observed frequency of correct outcomes among predictions with that score. The 99% and 95% in the illustrated case are the classifier's outputs for vulgar and insult. Their relation to frequencies over similar comments is a separate empirical question. Similarly, inspecting a range of thresholds illustrates tradeoffs without giving evidence for a threshold's suitability in a different population of comments.

LIME supports a specific form of interpretability by estimating which features account for behavior near one example. The explanation depends on the feature variations sampled, their weights, and the local approximation. The paper illustrates the procedure but does not measure how stable its highlighted words are across changes in sampling or compare the highlights with independent human judgments of which words explain a label. The annotators establish which categories apply to a comment. Their agreement statistics concern those categories. They supply no direct validation of the words highlighted by LIME.

The attention calculation and the LIME explanation also support different inferences. Attention affects how the network combines hidden states. LIME examines how variations of a comment affect a prediction. A hidden state can represent information from several surrounding positions, and a word's local influence can depend on the other words left in the input. The paper's example offers a concrete account of selected predictions, while a general claim about which words cause the classifier to recognize each type of toxicity would require additional testing.

What came after

BanHADEX cites this study and takes up explainable hate-speech detection in Bangla using human-annotated explanations. The connection is in the kind of evidence attached to a classification decision. Belal and colleagues have humans assign toxicity labels, then use LIME to estimate which words matter to the classifier's prediction. BanHADEX's stated emphasis puts human annotation at the explanation level as well.

That emphasis narrows the subject to hate speech while developing the question of how to explain a decision about it. In the earlier paper, hate is one possible label among several that can apply to a toxic comment. A LIME explanation is tied to a category score and to how that score changes across variations of the input. A human-annotated explanation expresses a reader's judgment about what warrants an explanation for the example. These are distinct sources of evidence, and the citation connects work that approaches the explanation task from those different starting points. The citation and stated focus establish that connection. They leave the reuse of the earlier dataset, pipeline, or label scheme unspecified.

Cite

Cite as Tanveer Ahmed Belal, G. M. Shahariar and Md. Hasanul Kabir. 2023. Interpretable Multi Labeled Bengali Toxic Comments Classification using Deep Learning. International Conference on Electrical, Computer and Communication Engineering.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1109/ecce57851.2023.10101588 · arXiv 2304.04087

@inproceedings{belal2023interpretable,
  title = {{Interpretable Multi Labeled Bengali Toxic Comments Classification using Deep Learning}},
  author = {Tanveer Ahmed Belal, G. M. Shahariar and Md. Hasanul Kabir},
  booktitle = {International Conference on Electrical, Computer and Communication Engineering},
  year = {2023},
  doi = {10.1109/ecce57851.2023.10101588},
  eprint = {2304.04087},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/ecce57851.2023.10101588}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/belal-2023-interpretable-multi-labeled-bengali-toxic/

References

17 references, from the paper's own bibliography.

  1. "The 10 Most Spoken Languages In The World — babbel," https://www.babbel.com/en/magazine/the-10-most-spoken-languages-in-the-world, (Accessed on 20/07/2022). OpenAlex ↗ · Scholar ↗
  2. "70% of Women Facing Cyber Harassment Are 15-25 Years in Age", Dhaka Tribune, 24 Sept. 2019, www.dhakatribune.com/bangladesh/dhaka/2019/09/24/70-of-women-facing-cyber-harassment-are-15-25-years-in-age, (Accessed on 22/07/2022). OpenAlex ↗ · Scholar ↗
  3. N. Banik and M. H. H. Rahman, "Toxicity Detection on Bengali Social Media Comments using Supervised Models," 2019 $2^{nd}$ International Conference on Innovation in Engineering and Technology (ICIET), 2019, pp. 1-5, doi: 10.1109/ICIET48527.2019.9290710. OpenAlex ↗ · Scholar ↗
  4. T.T. Aurpa, R. Sadik and M.S. Ahmed, "Abusive Bangla comments detection on Facebook using transformer-based deep learning models," Social Network Analysis and Mining, 12.1, 2022,pp. 1-14, doi: 10.1007/s13278-021-00852-x. OpenAlex ↗ · Scholar ↗
  5. M. F. Ahmed, Z. Mahmud, Z. T. Biash, A. A. N. Ryen, A. Hossain, F. B. Ashraf, "Cyberbullying detection using deep neural network from social media comments in bangla language.", 2021, arXiv preprint, arXiv:2106.04506. OpenAlex ↗ · Scholar ↗
  6. M. R. Karim, B. Raja Chakravarthi, J. P. McCrae and M. Cochez, "Classification Benchmarks for Under-resourced Bengali Language based on Multichannel Convolutional-LSTM Network," 2020 IEEE $7^{th}$ International Conference on Data Science and Advanced Analytics (DSAA), 2020, pp. 390-399, doi: 10.1109/DSAA49011.2020.00053. our card
  7. P. Chakraborty and M. H. Seddiqui, "Threat and Abusive Language Detection on Social Media in Bengali Language," 2019 $1^{st}$ International Conference on Advances in Science, Engineering and Robotics Technology (ICASERT), 2019, pp. 1-6, doi: 10.1109/ICASERT.2019.8934609. OpenAlex ↗ · Scholar ↗
  8. S. Ahammed, M. Rahman, M. H. Niloy and S. M. M. H. Chowdhury, "Implementation of Machine Learning to Detect Hate Speech in Bangla Language," 2019 $8^{th}$ International Conference System Modeling and Advancement in Research Trends (SMART), 2019, pp. 317-320, doi: 10.1109/SMART46866.2019.9117214. OpenAlex ↗ · Scholar ↗
  9. P. Malik, A. Aggrawal and D. K. Vishwakarma, "Toxic Speech Detection using Traditional Machine Learning Models and BERT and fastText Embedding with Deep Neural Networks," 2021 $5^{th}$ International Conference on Computing Methodologies and Communication (ICCMC), 2021, pp. 1254-1259, doi: 10.1109/ICCMC51019.2021.9418395. OpenAlex ↗ · Scholar ↗
  10. A. K. Das, A. A. Asif, A. Paul and M. N. Hossain, "Bangla hate speech detection on social media using attention-based recurrent neural network." Journal of Intelligent Systems, 30.1, 2021, pp. 578-591. our card
  11. J. Cohen, ‘A coefficient of agreement for nominal scales’, Educational and psychological measurement, vol. 20, no. 1, pp. 37–46, 1960. OpenAlex ↗ · Scholar ↗
  12. O. Sharif and M. M. Hoque, ‘Tackling cyber-aggression: Identification and fine-grained categorization of aggressive texts on social media using weighted ensemble of transformers’, Neurocomputing, vol. 490, pp. 462–481, 2022. OpenAlex ↗ · Scholar ↗
  13. S. Sarker. "BanglaBERT: Bengali Mask Language Model for Bengali Language Understading".textslGitHub. https://github.com/sagorbrur/bangla-bert (accessed Feb. 03, 2023). OpenAlex ↗ · Scholar ↗
  14. Y. Luan and S. Lin, "Research on Text Classification Based on CNN and LSTM," 2019 IEEE International Conference on Artificial Intelligence and Computer Applications (ICAICA), 2019, pp. 352-355, doi: 10.1109/ICAICA.2019.8873454. OpenAlex ↗ · Scholar ↗
  15. G. Xu, Y. Meng, X. Qiu, Z. Yu and X. Wu, "Sentiment Analysis of Comment Texts Based on BiLSTM," IEEE Access, vol. 7, pp. 51522-51532, 2019, doi: 10.1109/ACCESS.2019.2909919. OpenAlex ↗ · Scholar ↗
  16. A. Rahman, "Bangla-Abusive-Comment-Dataset". GitHub. https://github.com/aimansnigdha/Bangla-Abusive-Comment-Dataset (accessed Feb. 03, 2023). OpenAlex ↗ · Scholar ↗
  17. M. T. Ribeiro, S. Singh, C. Guestrin, "Why should i trust you? Explaining the predictions of any classifier", Proceedings of the $22^{nd}$ ACM SIGKDD international conference on knowledge discovery and data mining, 2016, pp. 1135-1144. our card