Bangla hate speech detection on social media using attention-based recurrent neural network
Paper · 2021 · Amit Kumar Das, Abdullah Al Asif, Anik Paul et al.
Summary
A hostile Facebook comment can attack an ethnic group, express religious hatred, or direct aggression at an individual. A system that flags all of these as abusive answers a different question from one that assigns each comment a more specific label. Das and colleagues study the second task for Bangla, a language widely used on social media that had received much less attention in hate speech research than English. They assemble 7,425 Bangla comments from public Facebook pages and use seven labels. The collection brings together material retained from an earlier Bangla study and newly gathered comments. Its label scheme includes religious and political comments and adds a category for suicidal comments, so its scope is broader than hate speech in the ordinary sense.
The authors process each comment into words, reduce some inflected forms to a common stem, and remove selected punctuation, uncommon tokens, and frequently used words. They also develop Bangla Emot, a dictionary-based component that turns emojis and text emoticons into Bangla descriptions. This gives the classifier a textual representation of cues that might otherwise disappear during cleaning. A neural encoder looks for patterns in nearby words. The authors then compare three ways of using the encoded information to predict the label. Two rely on recurrent layers, which carry information along a sequence. The third uses attention to give different parts of the input different weights.
With 80% of the collected data allocated to training and 20% to testing, the attention-based classifier reaches 77% accuracy on the seven-label task. The long short-term memory and gated recurrent unit alternatives each reach 74%. The attention system also has the highest reported aggregate precision, recall, and F1, although the paper leaves the averaging convention unspecified. In a separate binary comparison, the authors report 88% accuracy for attention. That figure answers a coarser question and belongs to a different evaluation from the seven-label result.
The clearest evidence comes from comparing the complete classifiers on the authors’ collection. Each uses a convolutional encoder, and the attention variant produces the most correct predictions under the reported setup. The experiments leave open how much the emoji conversion and other preprocessing decisions contributed, how the classifier would perform on unfamiliar Facebook pages, and whether its attention weights would help a person understand an individual prediction. Those questions matter because the study brings together a particular definition of the task, a particular sample of public comments, and a particular way of preparing them for classification.
Deep dive: Bangla hate speech detection on social media using attention-based recurrent neural network
Das and colleagues compare attention and recurrent decoders for detecting types of hate speech in Bangla Facebook comments. · about 35 minutes to read
The problem and its context
Why the kind of comment matters
The paper starts from a feature of public social media. A page can bring many readers into contact with speech aimed at someone else. An attack can be directed at a public figure, a religious community, or a group associated with an ethnic identity, while the surrounding discussion can include ordinary disagreement and political or religious conversation. Detecting harmful material automatically was already an active area of research. The authors describe a gap between the volume of Bangla communication and the attention paid to it in that research.
The operational task is text classification. The system receives the text of a comment and predicts a category from a fixed inventory. In the binary version described by the paper, the question is whether the comment belongs on the abusive side of a division. In a multiclass version, the choice is among more detailed kinds of comments. Each decision in the latter version carries two burdens. The classifier has to recognize relevant evidence in the text, and it has to learn the boundaries laid down by the label scheme.
Consider the distinction between Religious Hatred and Religious Comment. A reference to religion can make a comment relevant to both categories at the level of subject matter. To choose between them, a classifier needs some evidence about what the writer is saying about that subject. The paper’s Political Comment category adds a different complication. The authors allow material with and without hate in that category. As a result, a comment’s topic and its hateful character can both be pertinent to the task without being expressed along a common scale.
The other labels show that the scheme mixes several properties of communication. Aggressive Comment describes something about the manner or force of an expression. Ethnical Attack identifies a kind of target. Suicidal Comment concerns what the person expresses about suicide, which is a different kind of signal from aggression towards another person. The paper’s detailed account places suicidal and religious comments on the non-hateful side, while an earlier passage uses a broader characterization of suicidal comments. This matters because the everyday meaning of hate speech gives a reader only part of the information needed to reconstruct the dataset.
The aim, then, is to predict the categories used for these comments. A classifier can succeed at that aim to the extent that the available words and symbols support the choices annotators make. A comment read in isolation supplies a narrower range of evidence than a reader might have when looking at the original post and discussion. The paper’s design focuses on evidence that can be turned into a representation of the comment itself. That makes the handling of individual words, word order, and expressive symbols central to the project.
What earlier classifiers used as evidence
The paper describes earlier work on English in which researchers represented text through recurring patterns of characters and words. An n-gram is a span containing a fixed number of successive units. Those units can be characters, which allows a classifier to use fragments of words, or words, which allows it to distinguish short phrases. A skip-gram also permits intervening material. The studies described by Das and colleagues supplied patterns of these kinds to a support vector machine, which learns a boundary between categories from examples that have already been labeled.
A feature inventory of this kind determines what distinctions the classifier can learn easily. Word patterns can represent recurring expressions directly. Character patterns can capture similarities between spellings even when the full words differ. Linguistic and syntactic features, which the paper describes in another earlier system, bring additional information about how the comment is written. These are different ways to turn a raw comment into measurements a classifier can use. They help explain why the Bangla study spends so much space on text preparation before presenting its neural architecture.
Other strands of the earlier research organized the evidence differently. The paper describes work that combined context-aware logistic regression with a neural approach. It also discusses the Bag of Communities approach, which used material from an existing online community to identify abusive behavior and compared several standard classifiers. In one Facebook study, researchers began by finding pages likely to contain hateful comments, then filtered the resulting material and examined sentiment. The act of finding examples was therefore already part of the design of a detection task. A classifier trained on examples from such a collection learns from the speech that the collection procedure brought into view.
The paper also cites research in Amharic and Indonesian based on Facebook material. The Amharic study addressed a hate versus non-hate distinction and compared different combinations of classifiers and text representations. The Indonesian study dealt with long texts and used resources that included character patterns, individual words, and a lexicon. The distinction between longer texts and individual comments is relevant here because a comment can offer very little text from which to infer what kind of expression it contains. A representation that relies on several recurring words has more opportunities to collect evidence when the input is long.
The multilingual HASOC work described in the paper organized the detection problem in stages. It first separated hate and offensive content from other material. It then distinguished types of offensive material and considered whether an insult was targeted. Those tasks illustrate that a decision about the presence of offensive speech and a decision about its nature can be evaluated separately. Das and colleagues likewise report binary and multiclass comparisons, but their seven-label inventory combines distinctions particular to the Bangla Facebook corpus.
The Bangla studies closest to this one
The immediate predecessor is the study by Ishmam and Sharmin on comments from public Facebook pages. It used annotated Bangla comments and included political discussion, religious discussion, religious hatred, and several forms of attack or incitement. It also compared conventional classifiers with a recurrent neural alternative. Das and colleagues draw on this collection directly. That makes the connection both methodological and empirical. The earlier paper supplies a point of comparison for the kind of classifier used, and some of its comments become part of the new collection.
There is continuity in the label scheme, although the names shift. The earlier work uses labels translated as Communal Attack and Inciteful. Das and colleagues use Ethnical Attack and Aggressive Comment in their account of the new collection, while describing the inherited classes as remaining the same. The relation between these labels is relevant to interpretation. Their names indicate broadly related categories, but a reader would need the annotation rules to tell whether a particular case of incitement was treated in exactly the same way after the expansion.
The paper also describes work by Eshan and Hasan using Bangla Unicode text. Their features included counts of word patterns and weights based on term frequency and document frequency. Their classifiers included a form of naive Bayes and support vector machines. Another Bangla study incorporated both words and emoticons and tested a combination of convolution and recurrence as well as conventional methods. Das and colleagues therefore enter a line of research that had already tested several ways of representing Bangla comments and had already recognized that expressive symbols could carry relevant information.
The authors distinguish their work through the combination of a larger comment collection, a Bangla dictionary for emojis and emoticons, and a recurrent architecture with attention. They also discuss prior preprocessing that either omitted stemming or applied a stemmer with limited coverage. Their own pipeline attempts to address some inflectional variation explicitly. For the attention mechanism, they adapt an alignment method developed for machine translation. Its motivating idea is that a prediction can draw on several encoded positions while giving stronger weight to the positions that are most relevant at that point. Neural Machine Translation by Jointly Learning to Align and Translate
The method, step by step
From public comments to training examples
The study takes a public Facebook comment as its basic unit of input. The authors selected pages associated with news, entertainment, politics, and sports. They name Bangladeshi news outlets as well as pages associated with public figures, including cricketers and entertainers. Their reasoning was that pages with large audiences offer an opportunity to collect comments addressed to individuals and comments aimed at communities. They collected only public comments and left out information identifying the commenters.
The description of collection mentions the Facebook Graph API and manual retrieval when access through the API was limited. It also gives a more specific account of the two sources of the final corpus. The earlier Ishmam and Sharmin study supplied a pool of 5,126 comments, from which Das and colleagues retained 2,500 after cleaning. They give 4,925 as the number gathered separately from Facebook pages. Those figures describe provenance. They do not establish that every category was drawn in the same proportion from each source.
The linguistic annotation supplies a target label for each example. The list includes Political Comment, Suicidal Comment, Hate Speech, Religious Comment, Ethnical Attack, Aggressive Comment, and Religious Hatred. In the collection description, the authors count around 6,020 comments as hateful and place those examples in the first four categories. Religious Comment and Suicidal Comment are described there as non-hateful. Political Comment can contain both kinds of material. This arrangement is important for understanding why changing from the seven labels to a binary evaluation calls for its own explanation of how examples are assigned.
After collection, the comments were stored in a CSV file. The paper reports a training allocation of 80% and a test allocation of 20%. Its label encoder converts category names into numerical representations associated with training and test examples. This step is separate from the binary classification experiment. A machine-readable representation can use binary values to encode a label even when the set of possible labels is larger than a binary choice. The training procedure needs these representations to compare predictions with known categories.
From public Facebook comments to Bangla speech categories
The steps in order.
Preparing the words and the expressive symbols
The authors describe a group of text-preparation operations intended to give the learning procedure a more regular input. They remove punctuation and other unwanted characters, partly to simplify work with Bangla Unicode text. They also discard tokens that occur fewer than 5 times. This frequency rule treats very uncommon items as an unreliable basis for learning. A string that appears very rarely may reflect an incidental spelling or noisy input. It can also be a rare meaningful word. The procedure makes the same initial frequency decision in either case.
Tokenization is the process of dividing text into units for analysis. Here the main units are Bangla words. The paper illustrates the operation by taking a sentence and separating its component words, with certain punctuation discarded. The resulting sequence gives later layers discrete positions to work with. If a later layer examines nearby positions, what counts as nearby depends on the sequence produced at this point. Removing a token can bring the words on either side of it closer together in that representation.
The next operation concerns variation across forms of the same word. Stemming reduces related surface forms to a shared base. The paper focuses on Bangla nominal and verbal inflection. In practical terms, this lets the classifier encounter some forms of a noun or a verb under one representation, even if their endings differ in the original comments. The authors frame it as a way to limit fragmentation of the vocabulary. They give the coverage in terms of nouns and verbs and leave the full set of transformations unspecified.
The stopword filter removes frequently used items that the authors expect to carry little information for the classification task. They start from a Bangla list of around 400 words. Because the comments contain misspellings and abbreviated expressions, they extend the list with frequent spelling variants of stopwords. This part of the pipeline responds to a specific property of the material. A list that recognizes only a regular spelling would remove the regular form and preserve a common informal variant, creating a distinction that the authors did not intend for the classifier to learn.
The expressive symbols require a different treatment. An emoticon may consist of ordinary typed characters arranged into an expression. The authors use forms such as :-D for laughter or a broad grin and :-O for surprise to illustrate the difference between a meaningful character sequence and isolated punctuation. An emoji is a picture-character that can represent a face or another object or idea. Both forms can carry information about the tone in which a comment was written. They are therefore potential input to sentiment and emotion analysis as well as to the assignment of a speech category. Sentiment & emotion
Bangla Emot is the Python component that handles this conversion. The authors collect forms and descriptions in a dictionary, translate the descriptions into Bangla, and match the symbols or character sequences in each comment against dictionary entries. A match is rendered as Bangla text. This gives the later stages words to work with whether the original cue was a picture-character or a face typed from punctuation. A symbol by itself is not assigned one of the seven classes. Its description becomes part of the evidence from which the classifier can learn associations.
There is a practical dependency between this operation and punctuation cleaning. If a punctuation-based face has already been stripped of its constituent marks, a dictionary lookup cannot recover it from the remaining text. The account establishes that the pipeline recognizes these forms and also removes punctuation, but gives limited detail about the handoff between the two operations. The flow diagram groups them together for that reason. It also helps to distinguish a dictionary description from a judgment about what the writer meant. The same description can enter the representation even when the symbol is used playfully in one comment and sarcastically in another.
The numerical representations
The paper describes two numerical representations of text. The first is TF-IDF, or term frequency–inverse document frequency. Term frequency measures how often a term occurs in a document. In this application, a comment can play the role of a document. Inverse document frequency depends on how widely the term occurs across the collection. A term can therefore make a strong contribution in one comment when it occurs there and is comparatively uncommon across comments. The representation assigns a separate weight to each term instead of giving each written occurrence its own context-sensitive interpretation.
The numerator in the paper’s normalized weight expression has the following form.
TFᵢ × log(N / nᵢ)
Here i identifies a vocabulary term. TFᵢ is the term’s frequency in the document being represented. N is the number of documents in the collection used for the document-frequency calculation, and nᵢ is the number of those documents containing term i. The slash denotes division, log is the logarithm, and × denotes multiplication. The logarithmic factor depends on the term’s distribution across documents. The paper specifies no logarithm base.
The authors denote the normalized result by wᵢ. Their expression displays a normalization term formed from squared term weights, which can be written separately as follows.
∑ⱼ₌₁ⁿ (TFⱼ × log(N / nⱼ))²
The summation sign ∑ means to add the contributions indexed by j, starting at 1 and ending at n. Here j is a running term index, n is the upper limit over the terms included in the normalization, and TFⱼ and nⱼ are the frequency and document count for term j. N, log, /, and × have the same meanings as in the numerator. The outer exponent ² squares each term’s contribution. The paper’s notation gives the numerator and this sum but leaves the exact normalization operation unclear. Its stated purpose is to keep document length from giving longer inputs disproportionate weight.
The second representation uses word embeddings. In an embedding, a word from the vocabulary is represented by a vector, a list of numerical values that the neural layers can process. The paper describes an embedding layer that learns vectors along with the other parameters during training. A word appearing in different comments is looked up through the same vocabulary. The layers that follow can respond differently to it depending on the other positions in the comment.
The two representations preserve different aspects of the input. TF-IDF summarizes term use and gives prominence to some vocabulary items on the basis of their frequencies. An ordered sequence of embeddings supports operations that depend on which words follow which. This distinction matters for reading the architecture. The paper describes both feature procedures, and it explicitly places an embedding layer in the neural network, but it does not clearly map TF-IDF into each of the three decoder configurations. It is therefore possible to describe the two feature procedures and the common encoder with more confidence than the exact interface between them.
How the encoder builds a sequence of features
An encoder transforms the comment into internal features that are useful to the next stage. In the experimental comparison, the common encoder is a one-dimensional convolution, called Conv1D. Its filters move along the text sequence. At each position, a filter operates over a local span of numerical inputs and produces a response to the pattern it encounters. Because the same filter can be applied at different positions, a pattern can be recognized in more than one place in a comment.
The local span supplies a type of evidence that a list of term weights does not preserve on its own. A word can be surrounded by different nearby words in different comments, and these combinations can produce different filter responses. The authors use convolution to capture such local structure before comparing different ways of combining the resulting evidence. The encoder output is a feature sequence or map. The task of the following layers is to turn the encoded information into a category prediction.
For the recurrent alternatives, the paper uses long short-term memory, or LSTM, and the gated recurrent unit, or GRU. A recurrent layer processes an ordered sequence by carrying forward a hidden state. The hidden state is a numerical record of the preceding computation, updated as the layer encounters another position. The gates in LSTM and GRU regulate which information is retained and which new information is incorporated. Both alternatives can combine evidence across positions even though the convolutional features begin with local neighborhoods.
The paper also describes bidirectional recurrence in its account of attention, using a bidirectional LSTM to illustrate the encoder states that attention can read. One pass proceeds in the original sequence order and the other in reverse. At a given position, the two state vectors are concatenated, meaning that their components are joined to form a single representation. A state at a particular word can consequently include information from words on either side of it. In the paper’s account, this surrounding information helps the system distinguish positions that carry similar words but play different roles.
The experimental descriptions name convolution as the common encoder, while the attention diagrams refer to the bidirectional recurrent layer as an encoder in their explanation of the alignment mechanism. These descriptions operate at different levels of detail. The comparison identifies a convolutional feature extractor shared by the tested systems. The attention explanation identifies the recurrent states over which alignment is computed. The paper gives a clearer account of what each of these operations does than of the exact wiring and dimensions of every intermediate layer.
How attention changes what the decoder can use
The intuition behind attention is that a decoder can draw from the whole sequence of encoded positions and vary their importance. A single state at the end of a recurrent pass requires earlier evidence to survive successive updates. An attention mechanism offers a more direct route to that evidence by allowing a position to contribute to a new context vector. In this study, the authors describe higher weights as a means of giving relevant words greater influence. The weights depend on learned states, so the same word need not receive the same weight in every comment.
The equations are presented using source and output sequences, following the translation architecture that motivates the method. The source is indexed by i; the output is indexed by t. In the general description, a decoder updates its state at each output position using its preceding state, the preceding output, and the current context.
sₜ = f(sₜ₋₁, yₜ₋₁, cₜ)
The symbol sₜ is the decoder’s hidden state at output position t. The expression t − 1, rendered in the subscripts as ₜ₋₁, refers to the preceding position, so sₜ₋₁ is the previous state and yₜ₋₁ is the previous output item. cₜ is the context vector supplied for the current position. The function f is the recurrent update, which combines the quantities inside its parentheses. The paper describes t as running from 1 through m, where m is the length of the output sequence in this general formulation.
The context vector is a weighted combination of the encoder states.
cₜ = ∑ᵢ₌₁ⁿ αₜ,ᵢ hᵢ
Here cₜ again denotes the context vector for output position t. The source position is i, and n is the number of source positions. The summation ∑ᵢ₌₁ⁿ adds the contributions from source position 1 through n. The vector hᵢ is the encoder state at position i, which the bidirectional description builds from the forward and backward states. The scalar αₜ,ᵢ is the weight assigned to that source position when forming the context for output position t. Multiplying hᵢ by this scalar changes the size of its contribution before it is added to the other vectors.
The weights come from a softmax, an operation that transforms a set of scores into positive weights with a shared total. The paper expresses the calculation as follows, with j used here to distinguish the position being summed over from the position whose weight is being calculated.
αₜ,ᵢ = align(yₜ, xᵢ) = exp(score(sₜ₋₁, hᵢ)) / ∑ⱼ₌₁ⁿ exp(score(sₜ₋₁, hⱼ))
The weight αₜ,ᵢ expresses the alignment, written align, between output item yₜ and source item xᵢ. The position of the output item is t, and i identifies the source item under consideration. The function score compares the preceding decoder state sₜ₋₁ with encoder state hᵢ. The function exp exponentiates that score. In the denominator, j runs from 1 through n, and hⱼ is the encoder state being scored at the current position in that sum. Dividing by the sum puts the scores on a common scale. A position that gains a larger share of the weight contributes more strongly to cₜ.
The remaining equation specifies how the alignment score is learned. The paper illustrates the scoring function with a decoder state written sₜ; when the softmax evaluates the previous state, that state is supplied as the decoder argument.
score(sₜ, hᵢ) = vₐᵀ tanh(Wₐ concat(sₜ, hᵢ))
The function score returns a scalar for the pair of state vectors sₜ and hᵢ. The function concat joins their components. Wₐ is a learned weight matrix that transforms the joined vector, and tanh is the nonlinear hyperbolic tangent applied to the resulting components. The vector vₐ holds another set of learned alignment weights. The superscript ᵀ transposes it so it can reduce the transformed vector to a single score. The subscript a identifies the parameters associated with alignment. This scoring network learns jointly with the other neural components.
The paper goes on to illustrate attention over encoder and decoder states, with the resulting context vectors and the current hidden state contributing to an output. Its illustrations use the language of generating a word. The benchmark, however, supplies a category for each comment and assesses which category the system predicts. The sequence equations explain how the decoder obtains context. The paper gives less detail about how the illustrative output sequence is mapped into the final classification interface.
Controlling training
The labeled training comments supply examples from which the word vectors and the neural layers can learn. During training, the authors use dropout, which temporarily suppresses a share of the signals used by the network. They specify 0.4 for node dropout and 0.3 for recurrent dropout. The recurrent setting concerns the connections that carry information across sequence positions. The stated purpose of both settings is to reduce overfitting, which occurs when a system learns patterns specific to its training examples that transfer poorly to unfamiliar inputs.
The paper also reports using an EarlyStopping callback. Early stopping allows training to end when a monitored measure ceases to improve under a stopping rule. It is relevant to the comparison because the reported procedure includes choices about when to stop as well as choices about the neural architecture. The paper does not give the monitored measure and stopping rule in enough detail to reconstruct the decision. It also leaves unclear how any validation examples were set aside within the reported allocation. These details affect how precisely the reported scores can be tied to a protocol for choosing the final trained classifier.
Experiments and results
The main comparison on the seven-label corpus
The principal experiment compares the three encoder–decoder configurations on the 7,425-comment Bangla Facebook corpus. The paper gives 80% for training and 20% for testing and reports that this allocation yielded its highest accuracy for the multiclass problem. The common convolutional encoder gives the comparisons a shared starting point. The LSTM and GRU decoders serve as the direct reference systems for assessing the attention-based alternative on that task.
Accuracy is the share of examples for which the predicted category agrees with the recorded category. In the seven-label experiment, a comment assigned to a different category is an error even if both categories belong to the broad group described as hateful. For example, predicting Religious Hatred for an item labeled Ethnical Attack would miss the required answer while still indicating that the text belonged to the broad harmful side of the scheme. The metric therefore captures the success of the specific category decision.
Decoder accuracy on the seven-label Bangla Facebook comment test split
The attention decoder leads the recurrent alternatives.
The numbers
| System or setting | accuracy % |
|---|---|
| CNN with LSTM | 74 |
| CNN with GRU | 74 |
| CNN with attention (this paper) | 77 |
On the multiclass test portion, the CNN with an attention decoder achieves 77% accuracy, while the CNN with an LSTM decoder and the CNN with a GRU decoder each achieve 74%. Identical accuracy for the recurrent alternatives means that their overall shares of correct predictions are reported as equal. The two classifiers may still differ in the kinds of comments they classify correctly. The other metrics in the paper provide a different view of this comparison.
Precision, recall, and F1
For a given class, precision asks what share of the classifier’s predictions of that label are correct. Recall asks what share of the comments recorded under that label the classifier recovers. The two measures inspect different sides of an error. Predictions of a class on other kinds of comments lower precision for that class. True members of the class sent to other labels lower its recall. F1 combines precision and recall so that a strong value depends on both. In a multiclass task, a single number for any of these measures requires a choice about aggregation.
For the seven-label experiment, the paper reports precision of 0.78, recall of 0.75, and F1 of 0.78 for attention. The corresponding reported values for LSTM are precision of 0.72, recall of 0.71, and F1 of 0.72. The authors give 0.70 for GRU precision and recall and 0.69 for GRU F1. Therefore, across the aggregate figures printed in the paper, attention has the highest value on each of these measures. The aggregate accuracy tie between LSTM and GRU gives way to an ordering in the other reported measures.
The paper does not specify whether category-level contributions were weighted equally, weighted by the number of examples, or combined by another convention. That decision matters because the distribution of comments across classes affects the influence each class has on an overall score. A score dominated by common types answers a different evaluation question from one in which a rare category has the same influence as a common category. The three aggregate values should therefore be read as separately reported results. Computing a fresh F1 from the printed precision and recall would assume an aggregation procedure the paper does not establish.
The paper includes a figure comparing F1 by speech category across the decoder variants. It offers a more detailed view than a single overall accuracy and directs attention to performance on individual categories. The discussion gives no corresponding series of numerical class scores, so the strongest numerical comparison is the aggregate one. Class-level F1, moreover, describes how well a category is identified in terms of precision and recall. It cannot by itself reveal which alternative label accounts for most of that category’s missed predictions.
Training time and memory
The paper reports training time and memory usage for the same multiclass decoder comparison. Training the attention configuration took 220 seconds and its reported memory usage was 332 MB. The LSTM configuration took 193 seconds and used 432 MB. The GRU configuration took 201 seconds and used 410 MB. Attention thus had the longest reported training time and the lowest reported memory usage among the systems in the comparison.
These measurements capture different aspects of the training run. Time describes how long the reported training procedure took. Memory describes the resource usage attributed to the configuration. A system can require less stored state or a smaller allocation while still spending longer performing its computations. The paper ties these measurements to its implementation and gives insufficient detail about the measurement conditions to turn them into general resource rankings for attention, LSTM, and GRU. It also leaves the speed of classifying an incoming comment unmeasured.
The authors plot accuracy for the training and test data for the attention system. These traces address the behavior of the classifier during learning and complement the endpoint comparison. A reader can use a training-versus-test plot to ask whether improvements on examples seen during training carry over to the other portion of the corpus. The paper also relates its training procedure to dropout and early stopping. It gives neither a controlled comparison of those choices nor a numerical estimate of the uncertainty around the final performance.
The binary classification comparison
The paper presents another set of results for binary labels. In this setting the classifier has a coarser decision to make. Its success depends on the division between the binary groups and their representation in the evaluated data. Within the authors’ own binary comparison, the reported accuracy is 88% for attention, 83% for GRU, and 80% for LSTM.
Decoder accuracy in the paper’s binary Bangla comment comparison
Attention also leads when the task uses binary labels.
The numbers
| System or setting | accuracy % |
|---|---|
| LSTM | 80 |
| GRU | 83 |
| Attention (this paper) | 88 |
The binary results reproduce the lead of attention within the paper’s evaluated systems. The reporting of this experiment is less detailed than the account of the seven-label task. In particular, the authors’ category description allows Political Comment to include hateful and non-hateful examples. The binary comparison does not say how those comments were assigned or whether every example from the multiclass corpus was used. Its figures are best read as the reported results for binary labels, with separate scope from the main 80% training and 20% testing multiclass setup.
The binary table also includes numbers from earlier Bangla studies. It lists random forest at 78% accuracy and a support vector machine at 82% accuracy for one earlier study. For another, it lists LSTM at 77% accuracy and a support vector machine at 78% accuracy. The table presents these as earlier binary results. The paper does not describe retraining the earlier systems for that table using a shared set of comments and the authors’ own split. The entries show the performance reported in related studies, with differences in study design still in play.
The comparison with earlier multiclass work
The multiclass table places the new results beside the earlier Bangla Facebook study from which the authors retained part of their data. That table reports earlier accuracies of 50% for SVC, 24% for naive Bayes, 52% for random forest, and 70% for GRU. Elsewhere, the related-work discussion gives 52.20% for the earlier random forest and 70.10% for the earlier GRU. Those are the reported accuracies of the earlier classifiers as they appear in the two parts of the paper.
The predecessor’s experiment used a collection with fewer label types. The newer study both expands the data and adds Suicidal Comment. Reusing some examples establishes a connection between the corpora, but each reported score is still conditional on the evaluation in which it was obtained. For a controlled architecture comparison, the direct evidence is the comparison among the three CNN-based systems in the new study. The external comparisons establish what the reported results looked like alongside earlier Bangla experiments, including research that used a different label inventory.
Together, the experiments support a specific empirical finding. Attention leads the systems the authors compare under both of their reported label configurations, and it leads across the aggregate metrics reported for the seven-label problem. The latter experiment is the more fully described test of the paper’s central task. Its comparison can inform understanding of how the tested ways of processing an encoded comment performed on this corpus. The accompanying training measurements and earlier results add context of their own, subject to their respective evaluation conditions.
What the ablations show
The decoder comparison isolates a design choice
The paper offers a comparison of decoder configurations, training and test accuracy curves, and category-level F1 analysis, with no separate ablation that removes an individual preprocessing or attention component from an otherwise fixed system. This is an important distinction because the classifier is built from several changes introduced together. An ablation that turned one of these changes off would answer a narrower question about its contribution.
The decoder comparison is the nearest experiment to that form of evidence. Each configuration starts with a convolutional encoder, while the subsequent processing uses LSTM, GRU, or attention. The classifier with attention has the best reported seven-label accuracy and the best reported aggregate F1. That shows that the attention configuration was a more successful way to use the encoded input under the authors’ training and evaluation conditions. The recurrence-only alternatives form a relevant baseline because they can already use the order of features in the sequence and carry information forward.
The authors motivate attention through its ability to weight positions selectively. This makes one explanation for the result plausible. A comment category may depend strongly on a short phrase, on a word interpreted in its surrounding text, or on an expressive symbol represented by words. Attention gives the classifier a way to emphasize positions carrying such evidence. Testing that explanation directly would require identifying those positions in examples and measuring what happens when their influence changes. The decoder comparison establishes the performance ordering of configurations as trained.
Several design choices are bundled into that ordering. An attention-equipped decoder can differ from the other decoders in how it uses bidirectional state information and how it forms its context. The paper does not report a parameter-matched recurrent classifier with the attention weights switched off or made uniform. As a consequence, the contribution of selective weighting cannot be separated from the other architectural and training differences using the reported scores. The shared CNN is a meaningful comparison condition. It leaves the decoder as a whole as the unit being compared.
The two recurrent alternatives also give a useful internal check on how to read the metrics. They obtain the same reported accuracy but different aggregate precision, recall, and F1. This is consistent with different distributions of errors across classes. The result does not identify which class each decoder handles better. The category-level figure is the paper’s way of opening that question, while the aggregate results describe the overall performance. A confusion analysis would add the destinations of errors, which matters if the question is whether the systems confuse a topic with an attack or confuse two kinds of hostility.
What the preprocessing claims depend on
Bangla Emot is motivated by the possibility that expressive symbols contain relevant signals that punctuation cleaning could otherwise discard. The operation is concrete and its dictionary matches are traceable to stored descriptions. The experimental contribution of those descriptions is a separate matter. The paper does not compare an otherwise identical classifier trained with the module enabled and disabled. The full system’s score therefore includes the consequences of using the module without estimating its marginal benefit.
The same applies to stemming, stopword filtering, and the cutoff for rare tokens. The authors motivate these procedures through properties of the language and collection. Reducing inflected forms can make related examples easier to recognize. Removing selected common forms can concentrate the text representation on content the authors expect to be more informative. Removing rare items can reduce the influence of accidental spellings. Each choice can also affect useful distinctions in the input. The reported comparisons do not vary those choices individually, so they cannot show how much each one helped or whether that contribution differed across classes.
The feature representations are similarly difficult to compare in isolation. The paper describes TF-IDF and learned embeddings, but provides no paired results on the main task where one representation is exchanged for the other while holding the rest of the classifier fixed. It is possible to explain what kinds of information the representations encode. It is also possible to establish from the methods that learned embeddings are used in the neural system. The experiments leave their relative contribution unresolved.
What the other analyses can answer
The accuracy curves describe learning behavior within the attention configuration. Their purpose is different from that of the decoder comparison. They relate performance on the training and test data over the reported training run, whereas the endpoint scores compare the completed systems. The presence of the curves and the use of early stopping tell the reader that the authors considered overfitting. The effect of early stopping or either dropout setting remains unquantified because the paper does not vary those settings in an accompanying experiment.
The binary results supply a second view of the architecture comparison under a coarser labeling task. Attention again takes the lead. This shows that its relative performance was favorable in both evaluations the paper reports. Because the binary label construction is only briefly described, the comparison gives weaker evidence about the effect of changing the number and definition of the categories. In particular, the binary score cannot tell a reader which fine-grained distinctions account for errors in the seven-label task.
The category-level F1 analysis directs attention to another question that matters for the application. A detector could perform satisfactorily on categories with many examples while having difficulty with categories that have fewer examples or depend on subtler language. Category-specific scores are a way to look for these differences. The paper’s aggregate results, category figure, and resource measurements together describe performance from several angles. The mechanism that produced a correct or mistaken label on a particular comment remains outside those analyses.
Limitations
Limits and extensions the authors identify
The conclusion treats the dataset as a starting point that can be expanded. The authors specifically mention Facebook comments that mix English and Bangla. Such comments would extend the linguistic coverage of the corpus and change the text-preparation problem. A pipeline prepared around Bangla word forms, Bangla stopwords, and Bangla descriptions of symbols needs its behavior evaluated on inputs that switch languages within a comment. The authors propose collecting such material and testing classification approaches on it. The reported scores concern the collection used in this study.
The authors also point to photo comments. An emoji converted to a Bangla phrase can be processed along with other words once the dictionary recognizes it. A photograph containing written text calls for an additional step to recover that text, and a picture can convey an attitude through visual content alone. The conclusion proposes detecting the speech expressed in photo comments as a possible extension. The evaluated input here is the comment text and the expressive symbols covered by the conversion component.
The paper proposes a future interface in which a Facebook post link would trigger classification of its comments and a graph would display the proportions assigned to each category. This would extend the unit of use from one labeled comment to a collection of comments associated with a post. The experiment evaluates individual classification. A post-level graph would also depend on how comments are retrieved and whether errors concentrate in particular categories. The proposed interface remains a direction for future work.
Limits of the data and labels
The public-page sampling gives the study access to the kind of discussion that motivated it. It also limits the population to which the result can be applied directly. News, sports, entertainment, and political pages can each produce recognizable names, recurrent topics, and local conventions. A comment-based split can contain examples drawn from the same kinds of discussions in both portions of the corpus. The paper does not establish performance on pages held out from training, on another social platform, or on comments collected at a later time.
This distinction matters because a useful cue on the authors’ pages may be an incidental marker of topic elsewhere. A classifier might learn a strong association between a recurring name and a class when comments containing that name are often assigned the class in training. If the association weakens on a different page, the learned cue can lose value. The study’s test results measure classification on its corpus allocation. They leave the strength of performance under a change of source undetermined.
The reuse of examples from Ishmam and Sharmin creates another question about coverage. The authors identify how many earlier comments were retained and how many were collected separately, but they do not report separate scores on the two sources. Thus the results do not show whether the classifier behaves similarly on the retained material and on the newly gathered comments. The addition of a label means that the relation between source and class is also pertinent. The paper’s results give aggregate performance across the corpus without breaking down that dependence.
Annotation places practical limits on what agreement with a label means. The paper names and illustrates categories, but supplies little detail about independent labeling, agreement among annotators, or how disputes were resolved. A comment can express political hostility and religious hatred at once. The label list by itself gives limited instruction for deciding which of those properties should take precedence. Scores against the recorded labels therefore measure how successfully the classifiers reproduce the dataset’s decisions, to the extent those decisions are represented by the evaluated comments.
The position of Suicidal Comment is especially important. The account of the final collection places it among the non-hateful categories, while the text that justifies its introduction uses a broader characterization. Political Comment is explicitly mixed with respect to hate. These issues matter most in the binary experiment, where reproducing the setup requires knowing how the boundary was applied to individual examples. For the seven-label task, the categories are directly named. Their relationship to a general definition of hate speech remains more complex than their names alone suggest.
Limits of the performance evidence
The paper gives the main training–test proportions, examples of training controls, and comparative scores. It leaves several choices that influence reproducibility unspecified. These include how any validation data were selected, the monitored criterion for early stopping, and whether the split preserved the proportions of all categories. The description also gives limited detail on when frequency-dependent vocabulary and feature calculations were fitted relative to the test split. These points bear on whether the evaluation can be independently reproduced under matching conditions.
The paper does not report variation across repeated training runs or alternate splits. The ordering in the reported comparison is clear, but its stability under those changes is unknown. The single aggregate accuracy also gives more influence to labels with more test examples. The additional precision, recall, and F1 values make the report more informative, with the averaging convention still unspecified. Without that convention and explicit class scores, readers have limited grounds for assessing whether the overall gain is distributed across the categories.
Comparison with prior papers has a different limitation. The earlier numbers concern other collections, preparation procedures, and label schemes. Even where the language and platform match, the newer collection includes an additional category and draws on both retained and newly gathered comments. The earlier studies establish the technical setting and provide historical performance figures. The paper’s controlled evidence for a relative advantage comes from the CNN-based systems trained and evaluated for its own comparisons.
Limits of attention as an explanation
Attention generates a distribution of weights over internal states. Those states can include surrounding words and features computed over local neighborhoods. A large weight at one position therefore records the contribution of an encoded representation in the context calculation. Its interpretation as a human-readable explanation would require further evidence about what information the state carries and how that information affects the final label. This is an issue of interpretability distinct from classification accuracy.
The paper motivates attention in terms of placing emphasis on relevant words. Its experiments judge the resulting labels and report aggregate scores and class-level F1. They do not compare the weighted positions with passages selected by people as reasons for the labels, or test how the prediction changes when those passages are withheld. The evidence supports attention as a useful component of the evaluated classifier. It leaves the relationship between its weights and a reader’s reasons for judging a comment open.
What came after
BanHADEX: Towards Explainable HAte Speech Detection in Bangla Using Human Annotated EXplanation cites the study and takes up explainable Bangla hate speech detection through human-annotated explanations. The subject links it to a question raised by the earlier architecture. Das and colleagues use weights to determine which encoded positions contribute to a prediction, and assess the predictor on the accuracy of its labels. Human-annotated explanations bring people’s accounts of the evidence into the research task itself.
The distinction is consequential even when two systems predict the same category. One can ask whether a comment received the category recorded by an annotator. One can also ask which words or passages support that category and whether the evidence recognized by the system corresponds to what a person found relevant. In the earlier study, the aggregate scores address the first question. The attention equations describe an internal operation that could be examined in connection with the second. The focus signaled by BanHADEX brings the explanation question to the foreground in the same language and application area.
The documented connection establishes a continuation of the research problem and a shift in the kind of human annotation under consideration. It leaves the mechanics of any direct reuse open. In particular, the citation and stated focus do not establish that BanHADEX used the Facebook collection, the seven labels, the Bangla Emot dictionary, or the convolutional and recurrent architecture. The defensible comparison is between the earlier evaluation of category prediction and the later work’s explicit emphasis on explanations annotated by people.
Cite
Cite as Amit Kumar Das, Abdullah Al Asif, Anik Paul and Md. Nur Hossain. 2021. Bangla hate speech detection on social media using attention-based recurrent neural network. Journal of Intelligent Systems.
@article{das2021bangla,
title = {{Bangla hate speech detection on social media using attention-based recurrent neural network}},
author = {Amit Kumar Das, Abdullah {Al Asif}, Anik Paul and Md. Nur Hossain},
journal = {Journal of Intelligent Systems},
year = {2021},
doi = {10.1515/jisys-2020-0060},
eprint = {2203.16775},
archivePrefix = {arXiv},
url = {https://doi.org/10.1515/jisys-2020-0060}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/das-2021-bangla-hate-speech-detection-social/