Elamur Research

Sentiment Analysis For Bengali Using Transformer Based Models

Paper · 2021 · Anirban Bhowmick and Abhik Jana

Summary

A website can collect thousands of comments and reviews without knowing which ones express approval, criticism, or neither. Sentiment analysis turns that reading task into a prediction. Anirban Bhowmick and Abhik Jana ask how well the prediction can be made for Bengali, where they describe a shortage of training corpora and labeled benchmarks. They start from multilingual BERT and XLM-RoBERTa, abbreviated XLM-R. Each is a pretrained transformer, a neural architecture that represents words in relation to their surrounding text.

The authors compare two ways of putting those representations to work. They rerun an earlier Bengali classifier that adds a recurrent or convolutional layer to BERT, then try the same layer choices with XLM-R. They also use direct fine-tuning, adapting each pretrained starting point to the sentiment labels of each collection without those added layers. The material includes comments from the news portal Prothom Alo, Bengali drama reviews from YouTube, and Bengali book reviews. The news comments are used in two settings. One includes a neutral category, and the other excludes the comments carrying that label.

XLM-R with direct fine-tuning gives the highest validation accuracy on both news tasks, at 0.68 with neutral available and 0.81 with only positive and negative labels. It also leads on the drama reviews, with 0.95 validation accuracy and 0.97 test accuracy. The book reviews give a different result. Both directly adapted classifiers and BERT with a convolutional layer reach 0.91 on validation. On the book-review test split, BERT reaches 0.91 and XLM-R reaches 0.87. The added-layer classifiers have reported validation scores, so the test results compare the two directly adapted classifiers.

The study establishes a Bengali benchmark across several sources of online opinion. Its strongest results show what direct adaptation can achieve with labeled material from each source. Selected predictions also give a closer view of the remaining errors. The same criticism of a news outlet’s reporting receives opposite predictions in two BERT settings, and XLM-R judges a positively labeled aphorism to be neutral. The authors identify ambiguous wording, cues that point in different directions, and statements that depend on interpretation as priorities for further analysis.

Deep dive: Sentiment Analysis For Bengali Using Transformer Based Models

A Bengali sentiment study compares multilingual BERT and XLM-R on news comments, drama reviews, and book reviews after fine-tuning. · about 32 minutes to read

The problem and its context

What a polarity label represents

The paper deals with a particular reading task. Given the text of a review or comment, the classifier assigns a polarity to the whole entry. Positive and negative are the two directions of evaluation. In the news dataset there is also a version of the task in which neutral is a valid outcome. Framed as text classification, the problem has a defined input, a fixed set of permissible outputs for each experiment, and a reference judgment against which each prediction can be scored.

The short list of answers leaves considerable room for interpretation. A reader may criticize a book by describing its vocabulary. A viewer may express admiration for a drama and then explain that something similar happened in their own life. A person commenting on sport may ask for solidarity and oppose rivalry in the same passage. These examples from the paper illustrate why the unit of judgment matters. The prediction concerns the review or comment as a whole, even when parts of it perform different jobs.

A favorable or unfavorable expression also has an object. In the book example, the judgment concerns the language in the book. In a news example, it concerns a department’s reporting. A call for cooperation can be favorable toward the conduct it recommends while expressing disapproval of the conduct it rejects. The experiment assigns a single category to each entry. This makes the recorded judgment the practical answer to the question of which attitude matters for that piece of text.

The authors motivate the task through the growth of online opinion. People consult other users’ experiences when deciding what to read, watch, or buy. The introduction also connects sentiment research to applications such as e-commerce recommendation, cyberbullying detection, and hate-speech detection. Those applications help explain the interest in identifying attitudes in text. The measurable outcome of this study is the accuracy of polarity predictions for the comments and reviews the authors selected.

Why labeled Bengali examples matter

The authors describe a disparity between languages. They treat English as a setting with an extensive history of sentiment research. For Bengali, they emphasize two resource gaps. One is a shortage of sufficiently useful corpora, or collections of text, for learning language patterns. The other is a shortage of gold-standard datasets, in which recorded human judgments serve as answers for training or evaluation. Their work sits in the literature on low-resource languages.

The two gaps affect the experiment at different points. A collection of online text can expose a system to the ways words and phrases are used. Turning individual entries into examples of a sentiment task requires linguistic annotation, the process of assigning labels according to the intended task. When an expert marks a news comment as neutral, that decision specifies an answer that can be used to teach or assess a classifier. The existence of the comment by itself supplies the input to that process.

The paper exploits a way to draw on the resources that are available. Multilingual pretraining supplies a starting point learned from large collections of text. Bengali labels then tell the system how its representations should be used for sentiment. For example, a pretrained representation may help distinguish the mention of a dispute from a writer’s endorsement of one side. The classification examples supply the connection between patterns in the passage and the labels the benchmark expects. That division of labor motivates the study’s adaptation procedure.

The collections used here also illustrate why a dataset serves more than one purpose. It is a source of language examples, but it also determines which classification questions can be asked. Book-B provides positive and negative reviews. Prothom Alo provides those categories and a set of comments marked neutral. The authors can therefore ask, within the same news source, how the reported configurations perform when neutral is available and how they perform on the subset of comments expressly labeled positive or negative.

The earlier approaches that frame the study

Research described in the introduction had already applied sentiment classification to text in Hindi, Telugu, Assamese, Manipuri, and Indonesian. The authors also mention work on social-media text mixing English with Hindi or Bengali. It addresses a related setting in which a single entry draws on material from more than one language. These examples place the Bengali study within a line of work concerned with how the choice of language and source of text affect the design of a sentiment experiment.

Some of the earlier studies emphasize resources built for a particular language. The authors cite work on a Telugu sentiment corpus as part of that background. Creating such a collection makes sentiment labels available as data that can be reused and checked in experiments. The Bengali news corpus plays a comparable role for the immediate predecessor of this study. ACTSA, the annotated Telugu sentiment corpus.

The paper gives a more detailed account of a Hindi tweet study. That work used a recurrent neural approach and compared it with convolutional, lexicon-based, and other machine-learning approaches. It used Hindi Senti-WordNet to generate a lexicon, a vocabulary resource that can provide sentiment information about individual words. A lexicon supplies one source of evidence about polarity. The task described by Bhowmick and Jana calls for a judgment over a whole entry, where the role of such a word depends on how it is used.

Another line of prior work uses supervision from a different language. In the authors’ account, Balamurali and colleagues study cross-lingual sentiment classification by training a classifier in one language and using it to predict sentiment in another. Their results concern Hindi and Marathi. The new Bengali experiment uses multilingual knowledge at an earlier stage, in the starting parameters of the transformer. Its sentiment supervision comes from Bengali examples. The language of pretraining and the language of the labeled classification task are distinct choices.

The immediate precedent is the study by Islam and colleagues, which introduced the news-comments collection and applied multilingual BERT to it. Their classifier uses another neural layer above BERT. The layer takes information produced by the transformer and does further processing before the sentiment decision. Islam and colleagues tested several choices for that stage. Their setup provides Bhowmick and Jana with both a collection of labeled news text and an existing classifier design to reproduce.

Sazzed’s study contributes the Bengali drama material, and the work by Hossain and colleagues supplies the book reviews. The paper identifies the latter work as a study of book-review polarity using multinomial naive Bayes. These two sources expand the data available for the new experiment. The comparison architectures come from Islam and colleagues. This distinction matters because the study brings together data and a baseline procedure from separate lines of research.

The question that connects the experiments

With those ingredients, the authors can ask a question about where sentiment-specific learning should happen. The earlier arrangement includes a recurrent or convolutional stage above a multilingual transformer. The direct approach instead adapts the transformer to the benchmark and leaves those additional stages out. Either route can be tried with BERT or XLM-R, and either can be applied separately to the news comments and the two kinds of reviews. Applying the question across collections makes it possible to see whether the answer depends on the text source or the sentiment categories available.

The method, step by step

Choose what the classifier will read and predict

The starting material is a set of Bengali entries with sentiment judgments already attached. A training example pairs the entry with its target, which is the answer given by the dataset. On the full Prothom Alo task the target may be positive, negative, or neutral. For the reduced news task, the authors use the version that contains only positively or negatively labeled entries. Thus the reduced task is defined by a selection of documents as well as a shorter list of answers.

YouTube-B and Book-B already come in positive–negative form. There is no neutral category to remove from either task. The procedure uses each collection separately, so the sentiment examples for one collection teach a classifier for that collection. In particular, the two Prothom Alo experiments apply a common research procedure to different definitions of the target. They yield separate results for predicting among the full set of labels and for predicting polarity on the restricted collection.

The target has a different role during training and evaluation. During supervised training it tells the system which answer to favor for the input. In an evaluation it supplies the answer against which the prediction is compared. A class name such as positive therefore has a specific operational meaning in the experiment. It is a recorded answer of the benchmark, and the accuracy score gives credit for recovering that answer.

Begin with representations learned during pretraining

Both approaches start from a checkpoint, a stored set of parameters obtained from earlier training. The paper uses bert-base-multilingual-cased for BERT and xlm-roberta-large for XLM-R. It obtains the pretrained transformers through Hugging Face. The earlier training on multilingual text is what makes these useful starting points for the authors’ question. A sentiment classifier can begin with learned language representations and use the labeled Bengali material to adapt them to an output that pretraining did not directly supply.

BERT uses a bidirectional encoder. Encoding turns inputs into numerical representations that a downstream calculation can use. Bidirectionality allows representations to draw on the sequence to either side of a position. The paper emphasizes self-attention, in which information at different positions contributes to the representation of a position in the same input. It discusses this capacity in connection with long-range dependencies, where the relevant clue to an expression lies some distance away in the sequence.

The distinction between a word and its contextual representation matters for sentiment. Consider the paper’s example in which a writer invokes rivalry to argue for a different kind of behavior. A representation of the relevant stretch of text can take account of the rejection of rivalry and the call for solidarity. That is a reason to use context in this task. The example leaves open exactly which part of the learned representation drove the resulting sentiment prediction.

To distinguish versions of BERT, the authors describe bert-base as having 12 transformer layers and 110M parameters, and bert-large as having 24 transformer layers and 340M parameters. The multilingual BERT checkpoint used for the experiments is from the base family. The XLM-R checkpoint chosen for the experiments is the large variant. These identifiers specify the actual comparison more precisely than the architecture family names alone.

The authors describe XLM-R as having been trained in approximately 100 languages. They suggest that its larger pretraining corpus may help explain the strong performance associated with it in language processing. Within the Bengali experiment, the consequence of choosing XLM-R is that the classifier starts from a different set of learned parameters, with a different pretraining history and a different checkpoint configuration. Both starting points are then used in the study’s added-layer and direct-adaptation routes.

Recreate the earlier classifier with an added layer

The authors first take the design used by Islam and colleagues. The transformer processes the text, and a further neural layer processes the resulting representations in the course of making the classification. The design has alternative versions. Each adds one of the named layers, so an LSTM result and a CNN result come from separate configurations. This arrangement lets the authors inspect how the type of additional processing relates to accuracy.

LSTM stands for long short-term memory. A layer of this type processes a sequence through a state that can retain information as the sequence is read. GRU stands for gated recurrent unit. It also uses a state, with gates that control how earlier and incoming information contribute to it. Their shared feature in this comparison is recurrence. The sequence is processed using information carried across positions, on top of the representations from the transformer.

The CNN alternative uses a convolutional neural network. Its operation is organized around patterns in groups of nearby positions. In the architecture tested here, those positions are already represented in context by a transformer. The convolution thus acts on contextual features. The grouping imposed by the CNN describes where that stage looks for patterns, and the features supplied to it can already contain information gathered over a wider part of the input.

The reproduction begins with multilingual BERT on Prothom Alo. The authors use the earlier study’s code and its hyper-parameter settings, the choices made about how to run training. They extend the runs to YouTube-B and Book-B. That extension is important for the later comparison. It makes the earlier design a baseline on the review tasks as well as on the news-comments task for which it was originally reported.

They then put XLM-R in the transformer position, retaining the same named choices for the layer above it. This means a BERT–GRU result has an XLM-R–GRU counterpart for the same prediction task. Likewise, the two convolutional versions can be examined together. The paper gives a learning rate of 5e − 04 for this set of XLM-R added-layer experiments. A learning rate is a training setting that controls the scale of parameter updates. The added-layer experiments produce the validation comparisons used as the benchmark for the next route.

Adapt the checkpoint directly to the labels

The direct route starts from the same respective checkpoints. The researchers use the labeled comments or reviews to adapt each transformer for classification, with none of the LSTM, CNN, or GRU stages used in the reproduced design. The key architectural question is whether the pretrained transformer, adapted for a specific set of sentiment labels, can do the work for which the earlier design included one of those extra stages.

Direct adaptation of multilingual transformers for Bengali sentiment

The steps in order.

Direct adaptation of multilingual transformers for Bengali sentimentStep 1: Select a labeled Bengali collection1. Select a labeled Bengali collectionStep 2: Set the sentiment categories for the task2. Set the sentiment categories for the taskStep 3: Start from a multilingual checkpoint3. Start from a multilingual checkpointStep 4: Encode each comment or review4. Encode each comment or reviewStep 5: Score the available sentiment categories5. Score the available sentiment categoriesStep 6: Compare category probabilities with reference labels6. Compare category probabilities with reference labelsStep 7: Update the classifier using Adam7. Update the classifier using AdamStep 8: Score predictions on validation and test data8. Score predictions on validation and test data

For direct fine-tuning, Bhowmick and Jana use a batch size of 16. A batch is the group of examples used together to calculate a training update. The stated learning rate is 2e − 05. In this stage, the updates begin from parameters that already encode patterns learned in pretraining. Their new purpose is to improve the classification of the Bengali entries according to the label set in use.

The training objective is categorical cross-entropy. In a classification task, this loss increases as the predicted probability of the recorded category decreases. It gives the training procedure more information than a simple indication of whether the current top choice is correct. Two predictions can choose the same category and still assign different probabilities to the correct answer. The loss distinguishes those cases, and the reported accuracy later counts only whether the chosen answer agrees with the target.

The optimizer used throughout is Adam. An optimizer turns information about how the loss responds to the parameters into updates to those parameters. The batch supplies the examples for calculating that information, the loss supplies the quantity training seeks to reduce, and the learning rate helps govern the size of an update. The paper names these operations and settings in its account of the experiments and directs readers to supplementary material for further hyper-parameters. Adam.

There is no displayed mathematical formula in the paper’s description of the training procedure. Its fine-tuning diagram gives an architectural view, and its text identifies the objective by name. The procedure ends with a prediction from the sentiment categories defined for the collection and a comparison with the reference label. The public release named by the authors is BengaliSentimentWithTransformers. They say they made the code and datasets available.

How the two routes produce comparable results

The paper uses the direct procedure to answer the same classification questions as the added-layer experiments. On a given validation task, a correct answer has the same meaning for either route because the task is defined by the collection and its labels. The comparison uses the complete training recipes for the respective classifiers. That is the appropriate level at which to read the headline result. The original architecture can be reproduced or modified, and the simpler architecture can be trained as specified and scored on the same kind of decision.

Each experiment also gives a more specific comparison. Within the added-layer route, the layer can be named when comparing BERT with XLM-R. Within the direct route, the jointly stated batch size, learning rate, and loss make it possible to identify the checkpoints being compared under the same reported fine-tuning settings. Across routes, the common reference is validation accuracy. The test column adds a comparison for direct fine-tuning on a separate split.

Experiments and results

Where the examples came from

The Prothom Alo dataset starts from comments on 10 popular news topics from the Bengali news portal. Islam and colleagues gathered and cleaned the comments. The resulting collection contains 17,852 entries, with sentiment labels assigned by Bengali domain experts. The full version includes 8351 negative, 4732 neutral, and 4769 positive comments. The entries are user responses in news threads. Their subject matter can include the news itself as well as aspects of how the portal covers it.

The two-class Prothom Alo variant contains 13,120 entries. Its positive and negative counts are the same as those in the full collection because the source dataset builders made this version by excluding the neutral comments. Both versions contain more negative than positive entries. The design gives researchers two ways to study closely related source material. One involves distinguishing each polarity from neutral, and the other asks for a polarity judgment on comments already annotated with a positive or negative label.

YouTube-B consists of manually labeled reviews of Bengali dramas on YouTube. There are 8500 positive and 3307 negative reviews in the collection. Positive entries therefore have a larger presence than negative ones, the reverse of the distribution of the two polarities in Prothom Alo. The drama reviews also have a different immediate purpose from the news comments. An entry can address what a viewer thought of a particular performance or story and may connect that judgment to the viewer’s experience.

Book-B contains 2000 book reviews. Hossain and colleagues collected the material from web sources that include blogs, Facebook, and e-commerce sites. The dataset has 1018 negative and 982 positive entries. It is the smallest of the collections and the closest to an even division between the two polarities. Its results give the comparison another setting in which the type of text and the distribution of the reference labels differ from the drama reviews and the news comments.

These are collection totals. The validation and test figures describe performance on the respective splits. To interpret the distinction, consider that a review collection can be mostly positive while a particular evaluation split has its own class counts. A collection total gives the reader context for the benchmark. The score concerns the particular items evaluated, and the number of entries in a class across the whole collection does not specify how many of that class contributed to a particular score.

What accuracy is being compared

The reported metric is accuracy, the share of evaluated entries for which the sentiment prediction matches the reference category. The result tables express it as a decimal. A higher value indicates agreement on a greater share of the evaluated items. Accuracy pools the judgments across classes into one score. Accordingly, the mix of labels and the specific texts present in the evaluated split matter to the interpretation of that score.

The authors follow the earlier work by using validation accuracy for the added-layer comparison. That choice lets them put the reproduced BERT systems, their XLM-R substitutions, and the directly fine-tuned systems on a common reporting basis. They additionally report test accuracy for the direct configurations. A statement about which system leads the architecture comparison therefore refers to validation. A statement about the test ranking compares the two directly adapted checkpoints.

The task is another part of the score’s identity. Prothom Alo with neutral available and Prothom Alo with the neutral items excluded have separately reported accuracies. When the study compares scores from Book-B with scores from YouTube-B, the number is always the same kind of measure, but the predictions concern different sets of reviews. The strongest evidence for a configuration choice comes from comparing results within a task and split.

The news-comments task with a neutral category

In the three-class Prothom Alo validation comparison, adding different layers to BERT produces a narrow range of scores. The CNN version reaches 0.59, LSTM reaches 0.58, and GRU reaches 0.57. CNN is the strongest of those BERT baselines on this version of the task. Trying XLM-R in the same architectural role produces a broader range. With LSTM it reaches 0.65, with GRU it reaches 0.63, and with CNN it reaches 0.37.

The strongest of the added-layer systems is consequently XLM-R with LSTM, even though the strongest BERT system uses CNN. The two highest added-layer XLM-R scores belong to recurrent configurations. This task offers a clear example of why the checkpoint and the layer need to be identified together. A statement about replacing BERT with XLM-R would describe an improvement for some of the attached layers and a lower score for another.

Direct fine-tuning yields 0.63 validation accuracy for BERT and 0.68 for XLM-R. Directly adapted BERT exceeds its own added-layer variants and reaches the same validation accuracy as XLM-R with GRU. Directly adapted XLM-R achieves the highest reported validation accuracy for the three-class task. Its closest added-layer comparison is with XLM-R and LSTM, which shares the checkpoint family and is the strongest version of the earlier design on this task.

Selected classifiers on three-class Prothom Alo validation accuracy

Directly adapted XLM-R leads the comparison, and its LSTM version is the closest added-layer alternative.

Selected classifiers on three-class Prothom Alo validation accuracyBERT with CNN: 0.59BERT with CNN0.59XLM-R with LSTM: 0.65XLM-R with LSTM0.65Directly fine-tuned BERT: 0.63Directly fine-tuned BERT0.63Directly fine-tuned XLM-R (this paper): 0.68Directly fine-tuned XLM-R (this paper)0.68
The numbers
System or settingaccuracy
BERT with CNN0.59
XLM-R with LSTM0.65
Directly fine-tuned BERT0.63
Directly fine-tuned XLM-R (this paper)0.68

On the three-class news test split, the directly adapted classifiers preserve the validation ordering. XLM-R attains 0.53 and BERT attains 0.49. Both scores are below the corresponding validation results. This is also the lowest of the reported test accuracies for each checkpoint. The practical implication for interpreting the results is that an architecture can lead a comparison on validation and still have substantially lower measured agreement on the corresponding test split.

The news-comments task restricted to polarity

For binary Prothom Alo, BERT with LSTM records a validation accuracy of 0.63. Its CNN and GRU versions each reach 0.74. With XLM-R, the LSTM version reaches 0.64, the CNN version reaches 0.77, and the GRU version reaches 0.79. The strongest added-layer arrangement on binary news is therefore XLM-R with GRU. XLM-R with LSTM held that position while the neutral comments were in the task.

The direct BERT classifier reaches 0.77 on binary validation. It matches the XLM-R–CNN result and exceeds each of the added-layer BERT results. The XLM-R classifier produced by direct fine-tuning scores 0.81, the highest validation accuracy in the binary news comparison. The score is higher than the best result with an added recurrent layer in this setting. The result gives the authors a case for direct fine-tuning on the positive–negative news task even when the strongest added-layer configuration uses the same pretrained checkpoint.

Binary Prothom Alo test accuracy is 0.69 for BERT and 0.73 for XLM-R after direct fine-tuning. XLM-R leads this comparison, as it does on the binary validation split. Both directly adapted classifiers earn higher validation and test scores on binary Prothom Alo than on the full version with neutral. This is a comparison of outcomes under two task definitions. The binary score describes the ability to classify the retained texts under the smaller label set.

The distinction is important even when the original source is held constant. The binary setup gives the classifier fewer possible answers and changes which comments it sees in training and evaluation. A higher binary accuracy is evidence that the complete binary setup yielded more agreement with the recorded labels. The experiment does not attribute that pattern to the number of answer categories alone.

The drama reviews

On YouTube-B, the earlier architecture works best with BERT and CNN, which reaches 0.92 validation accuracy. BERT with GRU attains 0.91, and BERT with LSTM attains 0.85. Replacing the transformer with XLM-R yields 0.90 when the additional layer is CNN and 0.90 when it is GRU. With LSTM, the XLM-R variant scores 0.85. The BERT–CNN result is therefore the strongest added-layer comparison for these reviews.

Both direct configurations improve on that validation benchmark. BERT records 0.94 and XLM-R reaches 0.95 on YouTube-B validation. This is the setting behind the abstract’s reference to 95% accuracy for a two-class task. The positive–negative labels are the same kinds of answers available in binary Prothom Alo and Book-B. The headline figure belongs specifically to the drama reviews and to the validation comparison.

YouTube-B drama review validation accuracy for selected classifiers

Direct fine-tuning puts both checkpoints above the best added-layer classifier.

YouTube-B drama review validation accuracy for selected classifiersBERT with CNN: 0.92BERT with CNN0.92BERT with GRU: 0.91BERT with GRU0.91Directly fine-tuned BERT: 0.94Directly fine-tuned BERT0.94Directly fine-tuned XLM-R (this paper): 0.95Directly fine-tuned XLM-R (this paper)0.95
The numbers
System or settingaccuracy
BERT with CNN0.92
BERT with GRU0.91
Directly fine-tuned BERT0.94
Directly fine-tuned XLM-R (this paper)0.95

On YouTube-B test, the directly fine-tuned BERT classifier has 0.95 accuracy and the directly fine-tuned XLM-R classifier has 0.97. These are the strongest test results for the respective checkpoints in the study. Each is also above its corresponding drama-review validation score. This split behavior differs from the one observed on Prothom Alo, where the news test scores fall below the news validation scores. The paper shows the difference through the separate scores.

A drama example illustrates what a correct decision looks like in this setting. The writer expresses enthusiasm for a drama and associates it with something that happened in their life. The paper shows a positive prediction by directly fine-tuned BERT, agreeing with the positive target. The example contains explicit praise, and the reference category applies to the entry as a whole. It is an illustration of the classification output behind the accuracy score.

The book reviews

For Book-B, BERT with the convolutional layer again gives the strongest added-layer validation result, at 0.91. BERT with GRU reaches 0.86, and BERT with LSTM reaches 0.49. The corresponding XLM-R results are 0.88 with CNN, 0.84 with GRU, and 0.60 with LSTM. Replacing BERT therefore helps the LSTM version in this setting, while the stronger BERT configurations with CNN and GRU retain their lead over their respective XLM-R counterparts.

Direct adaptation gives a validation accuracy of 0.91 for each checkpoint. These results share the highest reported Book-B validation score with BERT plus CNN. The study thus gives evidence that the direct procedure can match the strongest baseline on the book reviews. It also establishes that the strongest review baseline is genuinely competitive in that domain. Removing the extra layer from the architecture used for direct BERT adaptation goes with an unchanged top validation score.

Book-B test accuracy distinguishes the two directly adapted classifiers. BERT obtains 0.91 and XLM-R obtains 0.87. This is the task in which directly fine-tuned BERT leads XLM-R on test. For BERT, the book-review validation and test scores agree at the paper’s reported precision. For XLM-R, the validation result is higher than the test result. The validation tie therefore resolves in BERT’s favor on the separate set of book reviews.

Book-B test accuracy after direct fine-tuning

BERT leads on the book-review test split after a tie on validation.

Book-B test accuracy after direct fine-tuningDirectly fine-tuned BERT (this paper): 0.91Directly fine-tuned BERT (this paper)0.91Directly fine-tuned XLM-R: 0.87Directly fine-tuned XLM-R0.87
The numbers
System or settingaccuracy
Directly fine-tuned BERT (this paper)0.91
Directly fine-tuned XLM-R0.87

The Book-B result qualifies the pattern seen in the other collections. Directly fine-tuned XLM-R leads on both versions of Prothom Alo and on YouTube-B across the reported validation and test comparisons. Book-B shares the strongest validation result across different architectures and gives BERT the higher result on test. The findings support direct adaptation across the study, while the evidence for a particular checkpoint depends on where it is evaluated.

Where the benchmark advances

The authors describe the directly fine-tuned classifiers as achieving state-of-the-art performance. Within the published comparison, the strongest support comes from the validation results on Prothom Alo and YouTube-B. XLM-R after direct fine-tuning achieves the highest validation accuracy of the tested approaches in both news settings and on the drama reviews. Book-B adds evidence for parity with the strongest validation baseline. Its test ranking is informative about the two direct classifiers, and the paper gives no corresponding test comparison with the added-layer classifiers.

The pattern across the datasets also clarifies what the best individual number represents. The strongest drama-review score belongs to one task with two labels. It says how much agreement was measured there, under the adaptation procedure and split used for that task. The news scores and the book results complete the benchmark by showing the variability of the procedure across different text sources and classification settings.

What the ablations show

The paper does not report a fully matched component ablation. Its closest analyses compare checkpoint replacements under a specified added layer, contrast the direct approach with the earlier architecture, and inspect selected correct and incorrect predictions. The score comparisons reveal which changes are associated with better performance on each task. The example predictions expose differences in individual decisions, including differences that are invisible in an overall accuracy score.

Replacing the transformer under the same kind of layer

A comparison between BERT and XLM-R with LSTM retains the kind of layer added above the transformer. The rest of that classifier still receives a different learned representation. On the full Prothom Alo task, the switch to XLM-R moves the LSTM and GRU validation results upward. The matching CNN comparison moves downward, from 0.59 with BERT to 0.37 with XLM-R. The counterexample makes the result more specific than a general preference for one checkpoint on news text.

The switch has a more consistent result on the two-class version of Prothom Alo. Each named added layer yields a higher validation accuracy with XLM-R than its BERT counterpart. The result for CNN is particularly informative because the direction of the change reverses between the news settings. The pattern shows an interaction between the task setting and the configuration of the classifier. The comparison leaves open how much of that interaction concerns the neutral category and how much concerns the texts retained in the binary task.

The review results further narrow what can be inferred from the replacement. On YouTube-B, LSTM reaches the same validation score with either transformer, and CNN and GRU each score higher with BERT. On Book-B, switching to XLM-R improves the LSTM configuration, while BERT still does better with CNN and GRU. The review evidence thus includes a Book-B configuration that benefits from substitution even as the strongest review baselines remain BERT systems.

These comparisons help explain the organization of the paper. Simply changing the multilingual checkpoint within the earlier design sometimes raises validation accuracy and sometimes lowers it. The next experiment tests a different way of using the representations. It asks whether direct adaptation yields a stronger complete classifier for the labels of each collection. This follow-up concerns the design and training procedure together, so the apparent advantage of a checkpoint in one route need not predict the advantage in the other.

Comparing architectures that share a pretrained starting point

The direct-versus-added-layer comparisons can be made within each checkpoint. That keeps the pretrained starting point in view. Directly fine-tuned BERT exceeds its strongest added-layer counterpart on both news validations and on the drama validation, and it ties its strongest one on book reviews. Directly fine-tuned XLM-R exceeds the highest score among its own added-layer alternatives on every reported validation task. These comparisons support the authors’ proposal that direct adaptation can be sufficient for these benchmarks.

The Book-B result is a particularly informative comparison at the level of complete configurations. A recurrent version of BERT scores poorly there compared with its CNN counterpart. BERT adapted directly reaches the score of the better configuration. The experiment therefore makes a case for the direct route without implying that every added layer behaves alike. In this dataset, the choice between recurrent and convolutional processing in the earlier design is associated with a substantial change in measured agreement.

The measured improvements belong to the training recipes as run. The learning rate specified for the added-layer XLM-R experiments differs from the rate specified for direct adaptation. The comparison also places the two recipes in different architectural settings. A matched experiment that changed only the presence of a given layer would answer a narrower causal question. The reported experiments establish a performance comparison among usable configurations and give a basis for examining that narrower question.

One criticism with different predictions

The paper displays a news comment criticizing the standard of reporting by a department of Prothom Alo. The recorded target is negative in the displayed entries. The BERT entries include a negative prediction and a positive prediction for the comment. A shown XLM-R entry assigns it the negative label. This is a particularly direct way to see what changing the classification setting can mean for an individual item. The same wording and reference polarity can receive opposing decisions.

The positive prediction is an error about the direction of the evaluation. The comment discusses a standard of reporting and expresses dissatisfaction with it. It is possible for a reader to see the evaluative contrast clearly while having little evidence about which expression the classifier relied on. The sample establishes the output and its divergence from the target. It gives no record of the probability distribution or internal computation that produced that decision.

A different example concerns a comment saying that others are in the same situation and that people’s behavior must be understood. The reference label is neutral. BERT assigns it a positive label in the example. The sentence makes a statement about circumstances and follows it with a call for understanding. One possible reading emphasizes an attitude of sympathy. The authors’ table establishes the neutral-to-positive error, while the explanation of how the classifier arrived at it remains a question.

Successful interpretations and harder cases

Some correct predictions involve wording with more than one evaluative cue. The paper shows a BERT prediction that matches the positive label on a call for fellowship in sport, even though the writer also rejects rivalry. An XLM-R example similarly matches a positive label on a comment favoring friendly relations and objecting to competitive behavior. In both cases, the positive reference judgment concerns the stance expressed by the whole passage. These successes show that the presence of competing cues can coexist with correct classification.

A different demand on interpretation appears in the aphorism about the possibility of waking a sleeping person and the futility of trying to wake someone already awake. The recorded label is positive, and XLM-R predicts neutral. The saying makes no overt appraisal of a book, performance, or report. Its force depends on what the reader takes the contrast to imply. The prediction illustrates the challenge of mapping that indirect expression to the benchmark’s positive category.

The book-review example presents another kind of error. A reader objects to the vocabulary in the book, and the target is negative. XLM-R predicts positive. The wording, in the paper’s rendering of its meaning, looks more openly evaluative than the aphorism. The contrast between the two errors is useful for interpreting the authors’ informal categories. Some disagreements arise on text whose overall attitude takes interpretation, and the displayed mistakes also include an apparent reversal of a straightforward criticism.

Taken together, the examples motivate the authors’ attention to ambiguity, conflicting polarity cues, and reflective language. The examples are selected illustrations. Their evidential strength lies in showing what particular mistakes and successes look like. Measuring how common each phenomenon is, or determining whether a particular phrase caused a particular error, would require a different form of analysis across the evaluation items.

Limitations

Limits identified by the authors

The authors explicitly recognize that the classifiers still misread some Bengali passages. Their discussion highlights ambiguous terms, expressions associated with opposing polarities, and statements with a philosophical character whose meaning depends on human interpretation. The goal they identify for immediate future work is to examine wrong predictions, understand why they occur, and try to reduce them. The displayed decisions are exploratory observations that help motivate this work.

There is a distinction between identifying a kind of example that deserves study and knowing its contribution to the overall error rate. An aphorism can pose a difficulty different from an explicit complaint. A text with words associated with both approval and criticism can express a coherent attitude that a reader infers from their relationship. The authors draw attention to these possibilities through a few cases. Their treatment leaves the frequency and causes of such mistakes open for the more detailed analysis they propose.

The authors also intend to investigate sentiment in other low-resource languages, naming Tamil, Oriya, and Gujarati. They propose exploring variants of transformer-based approaches in that wider setting. Their evidence concerns Bengali and the three collections used for the experiments. The broader proposal is a research direction suggested by the Bengali results. The paper does not report the outcome of applying these choices to those additional languages.

Limits of the comparison design

The BERT and XLM-R experiments compare specific checkpoints with multiple differences associated with the choice. The BERT checkpoint belongs to the base family, and the XLM-R checkpoint is the large variant. The sources and extent of pretraining are also part of the difference between the starting points. The paper suggests a larger pretraining corpus as one possible reason for XLM-R’s strong performance. Its experiments show how the two starting points fare after adaptation, leaving the contribution of corpus size unresolved.

The architecture comparison has a similar scope. It tests the earlier added-layer approach and the direct approach under their respective recipes. The paper gives a different learning rate for the added-layer XLM-R runs and the direct runs. The reported gains therefore support the choice of a complete direct fine-tuning procedure. They give less direct evidence about what would happen if a layer were added to or removed from a classifier while every other part of the training procedure was fixed.

The accuracy on Prothom Alo with neutral available is lower than on the binary version of the news task. This is a comparison within one news source, which helps reduce some differences encountered when comparing news with reviews. It still changes the data in an important way. The second task omits the comments whose reference label is neutral. Its score can reflect the reduced set of possible answers, the characteristics of the remaining comments, and the evaluated items in each split. The study does not estimate the individual effects of those factors.

The authors motivate direct fine-tuning partly through the possibility of working with a limited amount of labeled data and spending less time on training than starting from scratch. The reported evaluation measures classification accuracy. It contains no comparison of training times and no experiment that varies the amount of labeled material. The results demonstrate performance with the collections used, leaving the amount of data or computation needed to reach a specified accuracy unmeasured.

What the scores leave open

A high overall accuracy can accompany different rates of success for different labels. The dataset counts make that concern concrete. The Prothom Alo collection has more negative than positive comments, and YouTube-B has more positive than negative reviews. A positive and a negative success give the same credit to an accuracy score when each occurs once. The more frequent class can contribute more such successes because it accounts for more of the observations on a split.

The paper reports overall accuracy and examples of individual predictions. It does not give a breakdown that would establish how often each true class was confused with each predicted class. On the three-class news task, the neutral-to-positive example illustrates one direction of error. Whether this direction accounts for much of the news error would require the corresponding counts across the split. The same issue applies to comparisons of success on positive and negative reviews within either of the binary review datasets.

The validation-only reporting for added-layer classifiers sets a further boundary. On Book-B, BERT with CNN and the two directly fine-tuned classifiers share the highest validation result. The direct BERT result exceeds the direct XLM-R result on test. A test result for BERT with CNN would be necessary to place that baseline in the Book-B test ordering. The same distinction applies to Prothom Alo and YouTube-B, where the direct route’s lead over the strongest added-layer system is established through validation.

The split differences also have an unresolved source. After direct fine-tuning, both news classifiers score lower on test than on validation for both news tasks. Both score higher on test than on validation for the drama reviews. The paper’s numerical comparisons establish these directions. They do not show what share of the variation is associated with the composition of the splits or with training and selection decisions. The main results are point scores, with no reported uncertainty around the rankings.

How far the findings transfer

Use of the same procedure in several collections is evidence of applicability across several tasks with Bengali supervision. Each classifier is adapted with examples from the collection on which it is evaluated. A news classifier trained on Prothom Alo and applied to book reviews would test something different, namely whether the learned sentiment decision carries into a new domain. The reported comparison leaves this kind of transfer open, as well as transfer to Bengali material from other sources.

There is also a difference between recovering a corpus label and resolving an interpretive disagreement. The positive target for the aphorism is the criterion for judging the displayed prediction. The paper does not give enough information about judgments on that example to tell how consistently independent readers would select the same label. This distinction matters for assessing an apparent error. Agreement with the benchmark is the measured outcome, and annotation agreement would address how reproducible the human judgment is.

Finally, the applications mentioned in the introduction ask for outputs beyond a general polarity judgment. A recommendation system would need evidence that its use of opinions improves the recommendations. A classifier for harmful language would need reference judgments about the kind of harm it is supposed to detect. The Bengali experiments establish a comparison for comment and review polarity. The connection to those applications remains the motivation described in the paper.

What came after

No subsequent study is documented here as building on this paper. The conclusion gives the authors’ intended next directions. The nearer one is to study erroneous Bengali predictions more systematically and investigate how to reduce them. The example of a positively labeled saying predicted as neutral gives that direction a concrete target. A more detailed study could determine whether interpretive examples of that kind recur among the errors and whether they pose the same difficulty across checkpoints.

The wider direction is to explore sentiment classification for Tamil, Oriya, and Gujarati and to investigate alternative transformer configurations for those languages. The Bengali benchmark offers a defined point of departure for that proposed work. It shows the results of adapting multilingual checkpoints separately to labeled collections, and it compares direct adaptation with an existing added-layer design. Its outstanding questions concern the sources of error, the effects of individual design choices, and the performance of the approach when the language or the domain changes.

Cite

Cite as Anirban Bhowmick and Abhik Jana. 2021. Sentiment Analysis For Bengali Using Transformer Based Models. Proceedings of the 18th International Conference on Natural Language Processing (ICON).

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{bhowmick2021sentiment,
  title = {{Sentiment Analysis For Bengali Using Transformer Based Models}},
  author = {Anirban Bhowmick and Abhik Jana},
  booktitle = {Proceedings of the 18th International Conference on Natural Language Processing (ICON)},
  year = {2021},
  url = {https://aclanthology.org/2021.icon-main.58/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bhowmick-2021-sentiment-analysis-bengali-transformer-based/