Elamur Research

Deep Learning for Hindi Text Classification: A Comparison

Paper · 2020 · Ramchandra Joshi, Ramchandra Joshi, Purvi Goel et al.

Summary

A Hindi question can be classified by the kind of answer it seeks, and a Hindi movie review can be classified by the sentiment it expresses. Both tasks require examples with known answers or ratings. The authors faced a shortage of large labeled collections for Hindi, so they translated established English benchmarks into Hindi in Devanagari while drawing on the original task labels. They used TREC for question classification and the Stanford Sentiment Treebank for review classification. The study asks which approaches work well on these short inputs, and how much the choice of a pretrained text representation matters. Both questions bear on a practical problem in text classification.

The comparison starts with a system that averages word vectors and builds up to classifiers that use word order in different ways. A convolutional neural network, or CNN, looks for useful patterns in short stretches of neighboring words. A long short-term memory network, or LSTM, reads the sequence in order and can carry information between positions. Some variants use attention to give greater weight to selected words or to the contextual representations produced by a recurrent network. The authors also test classifiers that start with a ready-made representation of the entire sentence from multilingual BERT or LASER. In the word-based systems, they compare random starting values with Hindi FastText vectors that are either kept fixed or updated during training. These are different ways of using word embeddings.

The paper reports that the plain CNN achieved the strongest classification accuracy on each translated dataset. The bag-of-words baseline remained competitive, and weighting its words with attention generally helped, particularly when its FastText vectors were frozen. Among the recurrent variants, the bidirectional LSTM with max pooling did better than its attention-based counterpart and the unidirectional LSTM in the authors’ account. Random initialization caused relatively little loss in accuracy, although FastText initialization made performance steadier across training epochs. LASER came close to the strongest task-trained classifier and did better than the frozen BERT representation.

The findings apply to short Hindi translations of English questions and movie reviews. They show that local word patterns and simple pooling can be effective under those conditions. The authors suggest that the relaxed word order of Hindi may help explain why the recurrent approaches trailed the CNN. Their comparison also varies how each architecture gathers evidence for a decision, so it leaves the contribution of word order open. The sentence-encoder results concern frozen representations read by a downstream classifier. They give a practical comparison of that use of multilingual pretraining, with broader questions about adaptation and performance across languages still unresolved.

Deep dive: Deep Learning for Hindi Text Classification: A Comparison

A comparison of neural classifiers for Hindi questions and reviews, using translated benchmarks, FastText word vectors and multilingual sentence encoders. · about 34 minutes to read

The problem and its context

A sentence and a predefined label

The paper studies a specific form of language processing. An input is a sentence, and a classifier assigns it a label from a set defined before training. For a question, the label represents its type. The system can therefore get credit for identifying what sort of question it has read without supplying the answer. For a review, the label represents a sentiment rating or a polarity category, depending on the benchmark. The common operation is to read a short text and decide which category best describes it. This is one part of natural language processing.

Those tasks call for different kinds of evidence. A question may be recognizable from a word or phrase that signals what the speaker wants to know. In sentiment classification, an evaluative word can be informative, and nearby words can affect how that evaluation should be understood. These possibilities help explain the range of systems the paper compares. An average of word vectors can exploit clues carried by individual words. A classifier that sees small ordered windows can also use combinations of nearby words. One that processes the sequence recurrently has a way to bring information forward from earlier positions. The paper treats the usefulness of these options as an empirical question. The review experiments concern sentiment and emotion.

The authors situate sentence classification within a wider family of applications. They mention spam detection, email and document categorization, and intent recognition in conversational systems. Those examples explain why classification matters beyond the benchmarks. Each application needs a set of labels appropriate to its purpose, and the unit of text can be longer than a sentence. The paper narrows its own experiments to questions and short reviews. That choice gives the architectures a shared kind of input while retaining a distinction between recognizing a question’s purpose and reading the sentiment of a review.

Why test these methods in Hindi?

The authors describe a mismatch between the increasing amount of Hindi digital content and the available training resources for classification. They point to service providers and e-commerce businesses reaching audiences in local languages and to improvements in translation and transliteration. Their experiments address a specific bottleneck within that setting. A collection of unlabeled Hindi text can support the learning of word representations. Training a sentence classifier also requires examples for which the desired category is known. The shortage the paper emphasizes is a shortage of large labeled corpora, a common concern in research on low-resource languages.

Hindi also gives the authors a reason to question how readily methods tested elsewhere will carry over. They describe it as morphologically rich, meaning that words can occur in a range of forms, and as having relatively flexible word order. A classifier that treats whole words as its input units can encounter related forms as distinct tokens. Its treatment of those forms will depend in part on the vectors used to represent them. Flexible order raises a different issue. A useful clue may survive a change in position, while particular local sequences can still matter. The paper’s classification runs allow some approaches to retain order and give others a way to summarize evidence across positions. The linguistic issue behind the first of these concerns is morphology.

Translation gives the authors a route to labeled Hindi sentences. TREC and the Stanford Sentiment Treebank already organize their inputs by task and provide pre-defined data splits. Transferring their sentences into Hindi makes it possible to ask the corresponding questions in a language where the authors say comparable labeled training data are scarce. They cite XNLI as another evaluation effort that used translation to create multilingual material. XNLI enters the argument as precedent for the data construction, since the experiments here involve different tasks. The bridge from existing labels to Hindi text is machine translation.

What earlier classifiers contributed

In the Hindi work that the paper discusses, Arora used sequences of neighboring items and weighted versions of those sequences for sentiment analysis. Such features can make recurring patterns available to a classifier directly. Tummalapalli and colleagues brought convolutional and recurrent classifiers to Hindi and Telugu, working with translated datasets and studying word-level and character-level features as a way to capture morphological variation. The new comparison carries forward the interest in Hindi and the use of translation, with its own emphasis on word vectors and sentence architectures. The older feature approach is based on the n-gram.

The authors also identify lines of research that contributed particular designs. Kim’s work provides a precedent for applying convolutions to sentence classification in English. Joulin and colleagues offer the simple alternative of averaging word vectors. The recurrent approach draws on work by Lai and colleagues, and the attention variant draws on Zhou and colleagues’ use of attention with a bidirectional LSTM. Together these precedents motivate a spectrum of choices about what to retain from an input sentence. The paper uses them to frame a comparison of familiar methods on Hindi data.

A separate tradition supplies representations that have already been learned from larger collections. The authors mention Skip-Thought Vectors, the Universal Sentence Encoder and InferSent as examples of work on reusable sentence encodings. In their own experiments they select multilingual BERT and LASER. The practical idea is to take a representation learned in an earlier training process and supply it to a classifier for a new task. This differs from initializing a sequence of word vectors and letting the downstream architecture build a sentence representation of its own. The paper investigates both kinds of transfer within multilingual and cross-lingual NLP.

The method, step by step

Preparing the Hindi sentences

The authors begin with English sentences from the question and sentiment benchmarks. They use Google Translate to produce Hindi sentences in Devanagari. The underlying categories still come from the source tasks. A translated question is classified by the type assigned to the source question, while a translated review is judged against the source sentiment label. Reusing the labels makes the new datasets possible. It also makes preservation of meaning consequential, because a shift in what a sentence asks or how a review sounds can change the evidence for its inherited label.

The paper adds a filtering step intended to remove noisy sentences. The authors train a system on a Hindi Wikipedia corpus and use it to filter the translated material. Its role is separate from that of the final classifiers. A question can resemble ordinary Hindi while still failing to ask what its source asks. A review can likewise read fluently while expressing a different strength of approval. Fluency and label preservation are therefore distinct considerations when interpreting a filtering step based on a language model.

For the word-based approaches, each sentence becomes a sequence of tokens, the individual units passed to the classifier. The paper describes these units as words. It reports a shared vocabulary of 31k words for the embedding matrix. A row in such a matrix is the numerical representation associated with a vocabulary entry. The input to a classifier can then be understood as a sequence of selected rows, with each token position supplying its corresponding vector. This conversion from written text to processing units is tokenization.

The authors initialize that matrix with FastText vectors pretrained on Hindi in the runs that use pretrained words. They assume coverage for words outside the original vocabulary of the pretrained resource because FastText can produce a vector for an unknown word. There are separate issues here. FastText’s capacity to generate a vector supplies a way to represent a form, and the architecture determines what can be done with the representation. The classifiers operate on the resulting word vectors. The paper sets aside a separate comparison of explicit character-level or sub-word inputs.

From translated benchmark sentences to Hindi class predictions

The steps in order.

From translated benchmark sentences to Hindi class predictionsStep 1: Translate English benchmark sentences into Hindi1. Translate English benchmark sentences into HindiStep 2: Filter noisy translations using Hindi Wikipedia training2. Filter noisy translations using Hindi Wikipedia trainingStep 3: Split sentences into words for word-based classifiers3. Split sentences into words for word-based classifiersStep 4: Look up word vectors or extract multilingual sentence vectors4. Look up word vectors or extract multilingual sentence vectorsStep 5: Pool word-based features or transform whole-sentence vectors5. Pool word-based features or transform whole-sentence vectorsStep 6: Score the predefined categories with a dense layer6. Score the predefined categories with a dense layer

The branches in this pipeline produce the same kind of decision from different kinds of intermediate evidence. With word vectors, the classifier must compose a representation for each sentence, whether by averaging, finding local patterns or processing the sequence recurrently. A pretrained sentence encoder supplies a vector for the whole input. Its downstream classifier transforms that vector before assigning scores. The distinction determines which representation-building components the labeled task can change during training.

Choosing what the word vectors can learn

The word-based comparison varies the starting values and the freedom to update them. In the random condition, the authors draw initial entries from a continuous uniform distribution. The interval is written as follows.

[0.0, 1.0)

The left square bracket includes the lower endpoint, 0.0. The right parenthesis excludes the upper endpoint, 1.0. The comma separates the lower and upper bounds. Uniform sampling is the rule for choosing initial values over that interval. This notation defines a starting condition for the embedding entries, with classifier training following afterward.

The pretrained condition called fast text in the paper begins with the Hindi FastText vectors and allows them to change as the classifier learns. The condition called fast text-static uses the pretrained starting values and freezes the embedding layer. Updating the vectors gives the supervised task a way to reshape the representation of words it sees. Freezing them retains the relationships established during pretraining throughout the classifier’s training. The paper presents the trainable version as an opportunity for adaptation to the target domain, an instance of fine-tuning.

The comparison matters because the information needed by a classifier can differ from the information reflected in general word use. A word vector may place related terms in nearby parts of the representation space. The labels for a particular benchmark may reward a finer distinction among those terms, or group words together for reasons specific to the task. Updating the embeddings gives the classifier an opportunity to express that distinction at the word level. With static vectors, subsequent layers must learn how to make the distinction from the representations they receive. This is the connection between the choice of initialization and the broader question of lexical semantics and word embeddings.

Averaging a sentence and learning which words count more

The bag-of-words classifier, abbreviated BOW, takes the simplest path from individual word vectors to a sentence representation. It averages the vectors associated with the words in the sentence. The result has dimension 300, as each position in the result averages the corresponding coordinate across the input vectors. This operation gives every word occurrence equal weight. If the same words appeared in a different order, the average would be the same. The classifier can learn which directions in that average predict a label, while the average itself discards the order of the words.

The BOW average feeds a dense layer with an output for each class. A dense layer combines the input features into scores using learned weights. The paper applies softmax to the scores, which turns them into a distribution over the available labels. It describes cross-entropy as the loss for this classifier. In this setup, the loss provides a training signal by penalizing low probability on the label assigned to the example. The paper names Adam as the optimizer in its description of BOW. Adam updates the trainable parameters in response to that signal.

The attention version preserves the idea of forming an average and changes how much each word contributes. The authors pass each word vector through a learned linear layer that gives it a scalar score. The shape specified for this layer is the paper’s explicit mathematical notation for the word-level attention step.

300 × 1

The 300 is the width of the input word vector. The 1 is the single score produced for that vector. The multiplication sign separates the input and output dimensions in the description of the layer’s shape. A softmax across the scores of the words then gives normalized attention weights. That is a different use of softmax from applying it to class scores. Here the alternatives being weighted are positions in a sentence, and the result determines how much the corresponding vector contributes.

The weighted average still has dimension 300 and goes to a dense classification layer of the same kind as in BOW. A word whose vector receives a greater attention weight has a larger effect on the resulting sentence vector. In this architecture, the score at a given position comes from the word vector at that position. The scoring procedure has no recurrent or convolutional representation of the word’s surroundings to consult. Reordering the same words therefore preserves this weighted bag-of-words representation too. The natural comparison to the plain average is what changes when the system learns the relative contribution of its input words.

This arrangement gives the attention weights a concrete role. They control which word information reaches the sentence representation in greater strength. A high weight can make a particular occurrence more prominent in that average, and the classification layer still determines how the entire representation contributes to the score for a category. The paper later uses the same general form of weighting on a different input. In the recurrent attention variant, the vectors eligible for weighting already contain sequence context. The weighting operation is comparable across the variants, while the evidence available to it differs.

Detecting short patterns with convolutions

The CNN receives the sequence of word vectors. Its convolutions move along the sentence and inspect contiguous groups of word positions. The paper uses kernel sizes 2, 3, and 4, so the filters operate at different local widths. A filter applies the same learned calculation wherever its window falls in the sentence. Its output at a position indicates how strongly the pattern encoded by its weights responds to that window. The authors specify 128 filters for each width.

This gives the CNN a specific view of word order. The order inside a window can affect a filter response. The same filter can respond to a similar arrangement when it appears elsewhere in the sentence. This property separates where evidence is found from which nearby words make up that evidence. A useful question pattern or sentiment-bearing phrase can register as a strong local response. The system learns its filters from classification examples, so the benchmark’s labels determine which recurring patterns turn out to be useful to it.

After convolution, the authors apply max pooling over time. Here time means successive word positions. For each filter, max pooling retains its largest activation across the sentence. The pooled results from the different kernel widths are concatenated, meaning that they are joined into a single vector. The paper reports a width of 384 for the resulting sentence representation. A dense layer converts it to class scores. The pooling step gives that output access to strong responses from throughout the sentence and discards the positions at which those responses occurred.

The architecture thus makes a different compression choice from the bag-of-words classifiers. The averages build one sentence vector directly from the word vectors. The CNN generates candidate features from ordered windows first, then keeps the strongest value for each feature. The dense classifier can use pooled responses from different widths together. Its input carries information about whether the filters found strong patterns, with the order between those patterns largely lost at pooling. It is this specific combination of local order and position-independent aggregation that the experiments evaluate.

Reading the sequence with recurrent layers

The authors’ unidirectional recurrent classifier uses stacked LSTM layers. An LSTM maintains an internal state as it processes successive input positions. Each update uses information from the current input and the state carried from preceding positions. Stacking means that the representation produced by one recurrent layer is available to the next layer. The paper specifies two layers and a cell size of 128. It sends the final timestep’s output, also of width 128, to the dense layer for classification.

Taking only the final output places the burden of sentence summarization on the recurrent sequence. An early word can still affect the result if its information is carried through to the final position. That is one reason the final-state design differs from a pooling design. Pooling has direct access to the outputs at all positions and can give an earlier activation a direct route into the sentence vector. In the unidirectional LSTM used here, every earlier contribution passes through the recurrence before it can reach the final classifier.

The bidirectional version changes the reading procedure and the aggregation. It uses two stacked bidirectional LSTMs. Within a bidirectional layer, information is processed in both directions along the sequence, so the outputs can reflect words on either side of a position. The paper keeps the cell size at 128 and applies max pooling across time to the contextual outputs. It reports a 256-dimensional pooled sentence representation, which goes to the dense layer. A strong contextual feature can therefore reach the classifier from the position where it is most prominent.

This bidirectional classifier gives max pooling different material from the CNN. The CNN pools features computed in local windows. The bidirectional LSTM pools contextual vectors generated by scanning the sentence. Even where both use a maximum across positions, the feature chosen at a position has a different history. A comparison of their accuracies can reveal the better overall design for the benchmark. Interpreting the gap as the effect of any particular kind of context would require separating those architectural choices.

Combining recurrent processing with other ways of finding evidence

The CNN plus Bi-LSTM system puts a convolutional layer before recurrent processing. The convolution has a kernel size of 3 and uses 256 filters, so the bidirectional LSTM receives a sequence of local feature vectors. Max pooling follows the recurrent stage, and a dense layer makes the prediction. The order of operations is important. The recurrent layer has access to local feature outputs at successive positions because the convolutional sequence is still present at that point. Pooling compresses the sequence only after recurrent processing.

The hybrid is accordingly a distinct construction. In the plain CNN, several window widths supply features that are pooled directly. In the hybrid, a convolution at the specified width supplies features to a further sequence-processing stage. Any difference in classification accuracy between them can reflect the input to that stage, the recurrent processing itself or the way the resulting features are summarized. The architecture explores whether a sequence of learned local patterns is a useful input to bidirectional recurrence.

The Bi-LSTM with attention keeps the bidirectional recurrent approach and changes the readout. The paper replaces max pooling with an attention mechanism like the one used for the weighted bag of words. The inputs to attention are now outputs of the bidirectional LSTM. A position can receive a weight on the basis of a vector that encodes surrounding text, so its weight can reflect evidence available through sequence context. The dense classifier uses the resulting weighted representation to produce class scores.

There is a further distinction between the competing readouts. Max pooling can take the maximum for different feature coordinates from different positions. An attention-weighted average applies a position’s weight to the representation at that position as a whole. A sentence containing useful signals at several places can be compressed differently by these operations. This gives a precise interpretation to the pooling comparison in the paper. It tests competing ways of presenting the outputs of a bidirectional recurrent network to a classifier.

Using a representation of the whole sentence

The final approaches pass a Hindi sentence through a pretrained multilingual encoder. The authors compare BERT, described as a 12 layer system trained on multilingual data covering 104 languages, and LASER, described as a 5 layer bidirectional LSTM trained on data covering 93 languages. Hindi belongs to both sets of training languages. The encoders differ in architecture and in the pretraining problem from which the sentence representation is drawn. For BERT, the paper identifies the underlying architecture as a Transformer.

The paper explains BERT’s pretraining through masked language prediction. Selected parts of the input are hidden and the encoder learns to use the surrounding material for prediction. This creates a training signal that can draw on context from both sides of a masked position. LASER’s representations come from a translation training setup. An encoder processes an input sequence and a decoder produces an output sequence for translation. The bidirectional encoder is the part used to produce a sentence representation. These objectives give the encoders different reasons to preserve information in their representations.

For classification, the authors extract sentence embeddings from both encoders and leave the pretrained encoders fixed. BERT supplies a vector of dimension 768, and LASER supplies one of dimension 1024. Each goes through a dense layer with 512 units and then through a dense output layer matched to the number of classes. A softmax operates on the output scores. The labeled task trains the downstream classifier to read the representation it receives. Its training leaves the upstream encoder unchanged.

This setup asks how easily task-relevant information can be read from a ready-made sentence vector using the classifier the authors selected. The word-based systems have a different means of learning that information. Even with static FastText inputs, their downstream architecture builds a sentence representation by operating on the words for the specific task. The frozen sentence encoders supply an already composed vector and leave the task-specific layers to work with it. The paper’s comparison therefore covers different allocations of learning between reusable features and the stage that makes the final prediction.

Experiments and results

What the datasets ask the classifiers to learn

TREC contains questions sorted into six types. The dataset supplies a pre-defined split with 5452 training samples and 500 testing samples. For validation, the authors randomly hold out 10 % of the training data. Validation examples allow intermediate checks during development, while the test examples belong to the final evaluation split. The training count describes the pre-defined source partition from which the validation data are drawn. The Hindi task concerns the category of each translated question.

The Stanford Sentiment Treebank supplies sentences from movie reviews. SST-1 uses sentiment ratings on a scale of 1-5. The pre-defined split assigns 8544 samples to training, 2210 to testing and 1101 to validation. The rating task asks the classifier to distinguish levels of sentiment. That gives it a finer decision to make than polarity alone. A review that conveys approval can still be assigned the wrong category if the predicted strength differs from the benchmark rating.

SST-2 uses positive and negative labels. According to the paper, the training, test and validation sets contain 6920, 1821 and 872 samples, respectively. These are the counts for that binary benchmark. The narrower label space changes the supervised task as well as the output layer’s size. The distinction matters when reading results across benchmarks. SST-1 and SST-2 offer related evidence about classifying review language, with separate labels and sample counts for each evaluation.

All these evaluations concern Hindi versions of the source sentences. Keeping TREC alongside the sentiment tasks broadens the comparison beyond a single kind of meaning. The two SST versions ask related questions about how a review sounds. TREC asks what a question seeks. A classifier that ranks well on both families has succeeded under different category definitions within this translation-based setup. The score for each benchmark still belongs to its own decision problem, which is an important part of evaluation and benchmarks.

How to read the comparisons

The outcome reported by the paper is classification accuracy, the share of evaluated sentences assigned their recorded label. The simplest comparison point is BOW, which has a supervised output layer and gives equal weight to the input word vectors in its sentence average. BOW with attention changes that weighting. The convolutional and recurrent methods offer sequence-aware alternatives, and the frozen multilingual encoders test a different source of sentence features. The FastText and random conditions add another dimension by varying what the word-based systems start with and whether pretrained inputs can change.

The results discussion gives the ordering of several approaches and describes their relative closeness in places. The table is identified as a comparison of classification accuracies, and the paper’s narrative gives no numerical accuracy entries. The reported ordering can therefore be stated without assigning a score or a margin to it. The numerical comparison below uses the architecture dimensions that the paper specifies. It shows the width of the sentence vector at the point where it is supplied to the classification head. The starred row identifies the CNN as the paper’s accuracy leader, and the direction marked in the chart refers to vector width.

Sentence representation width of classifiers evaluated on Hindi TREC, SST-1 and SST-2

The accuracy-leading CNN uses a wider sentence vector than the displayed recurrent and word-average baselines and a narrower one than either frozen encoder.

Sentence representation width of classifiers evaluated on Hindi TREC, SST-1 and SST-2LSTM final state: 128LSTM final state128Bi-LSTM with max pooling: 256Bi-LSTM with max pooling256Bag of words: 300Bag of words300Bag of words with attention: 300Bag of words with attention300CNN (this paper): 384CNN (this paper)384Frozen BERT: 768Frozen BERT768Frozen LASER: 1024Frozen LASER1024
The numbers
System or settingdimensions
LSTM final state128
Bi-LSTM with max pooling256
Bag of words300
Bag of words with attention300
CNN (this paper)384
Frozen BERT768
Frozen LASER1024

Width counts the coordinates available to the classifier at that stage. It gives a way to compare what is passed between parts of the system using the paper’s stated values. It leaves the computational cost of producing the vector open. In particular, a vector that comes from a frozen multilingual encoder still has to be produced by that encoder, and a recurrent final state requires a pass through the word sequence. The additional dense layer in the frozen-encoder setting also distinguishes its head from the simpler word-average classifier. Vector width and accuracy describe different parts of the experiment.

Which architecture ranked highest?

The authors report that the plain CNN was the best performer on translated TREC, SST-1 and SST-2. This places an approach based on short ordered windows and max pooling at the top for both question typing and sentiment classification. The paper connects the result to the short length of the benchmark sentences. Local patterns can provide direct evidence for a label in that setting, and max pooling lets a strong response reach the classifier wherever it occurs. This is the authors’ explanation of an observed benchmark ordering. The experiments do not give an accuracy breakdown by sentence length.

The authors describe the recurrent systems as relatively close in performance. They report an advantage for the bidirectional LSTM with max pooling over the bidirectional attention version and the unidirectional LSTM. That ordering is more specific than the result for CNN versus LSTM as broad categories. It shows that the choice of recurrent readout matters in this comparison. It also means that the reported comparison between the strongest convolutional and recurrent approaches involves concrete designs, each with its own way of collapsing the sentence into a fixed vector.

The convolutional-recurrent hybrid falls between the recurrent and convolutional approaches in the authors’ account. The result gives a practical indication of how the tested composition behaves. A bidirectional LSTM applied after the convolution did not yield the overall accuracy leader. The paper’s description supports a broad intermediate ranking and leaves the distance to the neighboring approaches unspecified. The hybrid’s different convolutional front end also matters when interpreting that placement.

BOW remains comparatively strong. Its relevance as a baseline comes from how little it requires of the sentence representation. Once the word vectors are available, the representation is formed by computing an average. The paper reports that this simple approach produced results comparable to the recurrent and convolutional approaches, despite the plain CNN leading the comparison. The authors regard BOW as an option when a speed and accuracy tradeoff is acceptable. The experiments provide an accuracy comparison for that judgment, while the paper gives no timing figures for quantifying the tradeoff.

What pretraining contributed in these runs

The authors report that starting with random word vectors did not cause a large loss in classification performance. They also describe the FastText runs as more stable across training epochs. Those observations address different questions. A random start can reach a competitive score, and a pretrained start can give steadier performance during the training run. The paper gives the direction of the stability observation without specifying numerical variation across epochs. This makes stability a reported property of the training behavior instead of a measured margin available for comparison.

Attention improved the bag-of-words approach in the authors’ account. They single out the static FastText condition as one in which the weighting helped particularly. In that condition, the supplied word vectors stay fixed, while the weighting and the classification layers can learn from the task. The architecture therefore provides a way to change what the sentence representation emphasizes even when it cannot change the vectors themselves. The finding is specific to the comparison between the weighted and equal-weight averages under the reported embedding conditions.

The frozen multilingual sentence representations generally trailed the ones learned by the task-specific classifiers. Within the frozen comparison, LASER did better than BERT and was reported to come close to the strongest approach. That means the downstream classifier could recover evidence from LASER’s sentence vectors that was useful for the translated tasks. BERT’s vectors worked less well in this particular extraction and classification setup. Since both encoders were frozen, the result compares the utility of their supplied sentence vectors under the paper’s chosen readout.

These findings put the role of reusable representations in perspective for the tasks the authors chose. A word-vector initialization can help shape the course of training, even if the authors observe little drop in accuracy when it is replaced by a random start. A frozen sentence encoder can yield a competitive downstream classifier, even if a purpose-built sentence representation leads the comparison. Word initialization and whole-sentence transfer occur at different points in the pipeline, so their outcomes answer separate questions about what pretraining supplies.

What the ablations show

The effect of weighting an unordered representation

The paper makes several controlled comparisons and architecture comparisons. The cleanest contrast in the word-average family is between assigning equal importance to the vectors and learning their weights. The width of the sentence representation stays at 300, and the downstream class layer has the same role. The change is in how evidence from the words gets into the representation. The advantage reported for attention therefore supports learned weighting in this design, including when the underlying vectors are held fixed.

This comparison is informative precisely because both versions discard order. The attention system can learn that some words tend to supply better classification evidence than others. It cannot resolve different sentences with identical word inventories by changing their order. Its improvement shows that a better allocation of weight among individual word vectors can matter independently of modeling sequence. That is a narrower explanation than attributing the gain to an ability to read grammatical structure. The comparison also leaves open which words the trained classifier chose to emphasize.

Static FastText makes this result easier to interpret. Since the embedding layer is fixed, learned attention weights can help bring an existing property of a term to the foreground. In the plain average, its vector contributes on equal terms with the other occurrences in the sentence. In the weighted average, its contribution can be strengthened or weakened before the final decision. The paper’s account of the improvement is compatible with this mechanism. It offers a comparison of classifier accuracy, with no reported analysis of how the individual weights line up with linguistic clues.

The effect of the recurrent readout

The closest contrast in the bidirectional family swaps max pooling for attention. In both versions, the recurrent layers provide contextual evidence at successive positions. Max pooling can preserve different feature maxima from different positions. Attention pools whole contextual vectors according to weights on positions. The observed advantage for max pooling shows that the simpler aggregation was a better readout for the tested recurrent setup. The same result gives a reason to read “attention helped” in the bag-of-words experiment as a claim about that particular use of attention.

The two attention comparisons start from different alternatives. In BOW, attention replaces uniform averaging of word vectors. In the Bi-LSTM, it replaces coordinate-wise max pooling of contextual vectors. The units being weighted are consequently different, and so are the properties of the operations they replace. A gain in the first case and a disadvantage in the second can arise from the compression choices each architecture makes. The comparisons identify the better pairing under the tested conditions while leaving the relative roles of optimization and feature selection unresolved.

The ranking of the pooled bidirectional system ahead of the unidirectional LSTM is broader. The bidirectional system sees context in both directions and pools outputs across positions. The unidirectional one uses its final output. Those differences give distinct possible reasons for the reported result. Better use of later context is one possibility. Direct access to strong activations at earlier positions is another. The paper’s setup ties these possibilities together, so the comparison supports the overall bidirectional pooled design without establishing a separate effect for bidirectionality.

What changes when a convolution is followed by recurrence

The hybrid provides evidence about a particular way of composing layers. It gives the recurrent stage local features from a convolution, allowing the sequence calculation to operate on representations of neighboring words. Its intermediate performance indicates that adding the recurrent stage in this arrangement did not improve on the best CNN. There is an architectural qualification. The plain CNN uses several kernel widths and pools the resulting features directly. The hybrid uses the specified single width before recurrence. The comparison changes the features alongside the procedure used to combine them.

The clearest conclusion is about the designs as implemented on these data. A CNN with several local widths and direct max pooling was more successful than the tested combination of convolution and bidirectional recurrence. The experiments give no matched counterpart in which the same convolutional output is scored with and without the extra recurrent stage under otherwise identical settings. As a result, they leave the isolated contribution of that stage open. The comparison is still relevant to someone choosing among these architectures as complete systems.

The authors’ explanation about word order concerns a larger linguistic hypothesis. To distinguish it from the possible effects of pooling or the use of short inputs, an analysis would need to connect performance to changes in order while holding other aspects of the task steady. Here, order is represented differently in several architectures at once. BOW discards it. The CNN retains it within windows. Recurrence incorporates it as part of sequence processing. The results rank those packages of choices. They offer no manipulation of the word order of the sentences themselves.

What the initialization comparisons can isolate

For word inputs, the random and trainable FastText conditions reveal what happens when the embedding layer starts from different values and remains available to training. The static and trainable FastText conditions ask whether the initial pretrained vectors should stay fixed. These are related decisions. A comparison of random initialization with static FastText changes both the starting representation and whether it can be updated. The two comparisons involving trainable and static FastText provide a way to reason more precisely about where the practical difference could come from.

The stability observation belongs primarily to the question of starting values. The authors associate FastText initialization with steadier behavior across epochs and describe the loss in accuracy from random initialization as modest. Without epoch-by-epoch values or repeated-run variation, the paper gives limited grounds for identifying the cause of the steadiness. It establishes that the authors observed a difference in the course of training. The wording leaves open how frequently a run needed more training, how sensitive that course was to the random draw, and whether every benchmark showed the same pattern.

The decision to freeze or update introduces a separate consideration about the treatment of words that occur outside task training. Freezing maintains a shared pretrained space. Updating gives observed words a way to move in response to the target labels, which can be valuable when general Hindi usage and benchmark usage differ. The paper presents both reasons. It reports no dedicated accuracy comparison on previously unseen words, so the rationale for freezing and the practical benefit of doing so for that subgroup remain distinct.

What the frozen-encoder test separates

The comparison between LASER and BERT keeps the downstream pattern of dense layers and the decision to freeze the upstream representation in common. That makes it a direct comparison of the usefulness of the supplied vectors for the tested classifier. It is not a controlled change to a pretraining objective. The systems differ in their encoder architectures, the languages covered by their pretraining and the size of their vectors, among the properties described by the paper. Any of those differences can affect what is readily available to the downstream classifier.

The authors interpret LASER’s showing as evidence that its vectors preserve discriminative features useful for these tasks. That is consistent with the reported accuracy: the classifier could use the representation to make the benchmark decisions more successfully than it could with the frozen BERT vector. The experiment measures the combined operation of extraction and readout. It cannot identify which knowledge the encoder holds in its internal token representations or whether a different form of extraction would expose that knowledge. This is where the fixed-vector setup defines the scope of the finding.

Limitations

Boundaries the authors identify

The study begins from a limitation of the research setting. Large labeled resources for Hindi are scarce, and the authors use translated datasets to make a comparative evaluation possible. They explicitly focus on short sentence classification. Their explanation for the CNN’s performance concerns that setting. The practical comparison is therefore best understood with the unit of analysis in view. An architecture that detects a short phrase and pools its strongest response may be well suited to these sentences. A longer input could require combining evidence with a different distribution across positions, and longer inputs are outside these experiments.

The authors also delimit how they approach morphology. They discuss earlier work that uses character-level features to handle linguistic variation, while their own comparison focuses on word vectors and sentence architectures. FastText supplies a numerical representation for unfamiliar forms. The paper uses this as part of the input procedure and does not measure which word forms benefit. The design accordingly addresses the effect of a particular way to represent words. It leaves comparisons involving explicit character-level or sub-word features to other work.

The authors recognize a domain tradeoff in using pretrained word embeddings. General Hindi vectors may encode distinctions helpful for review or question classification, and adjusting them in the supervised task can bring them closer to the target use. Keeping them fixed preserves their pretrained relationships, which the authors regard as helpful when the classifier encounters words it did not see during training. The experiment compares the corresponding settings. Its discussion gives a reason for each choice without fixing a universal preference that would carry across other datasets.

The authors describe the relaxed word order of Hindi as a possible reason for the recurrent classifiers’ relative performance. Their phrasing is a hypothesis about the finding. Short length is another explanation raised in the paper, and the different readouts further complicate a linguistic interpretation. The conclusion also points to evaluations involving multiple languages as a better way to examine the distinctive advantages of multilingual sentence embeddings. Every target sentence in the reported comparison is Hindi. The multilingual property belongs to the pretrained encoders.

What the setup leaves unresolved

Translation raises a question about what counts as a valid transfer of a labeled example. The benchmark label was assigned to an English sentence. The Hindi sentence must preserve the relevant part of its meaning for that label to serve as a reliable target. In a question that part is the kind of answer sought. In a review it is the sentiment, including the distinctions in strength relevant to SST-1. Filtering with a system trained on Hindi Wikipedia is a way to address noise in the text. Whether the resulting sentence preserves the label is a separate empirical issue.

The paper describes its filtering procedure in general terms. It gives no threshold, numbers of removed examples, or breakdown of removals by class or split. The dataset figures identify the benchmark partitions, while the account gives no separate totals after filtering. That distinction affects reproducibility because the examples retained in each partition determine what the classifier sees and what its accuracy counts. It also affects interpretation of the results. Classification accuracy on the translated material provides no independent measure of translation quality or label preservation.

The source and genre of the sentences impose another boundary. TREC reflects the kinds of questions included in its benchmark, and the Stanford Sentiment Treebank reflects movie reviews. Even a fluent Hindi translation still originates from those collections. The comparison leaves performance on questions and reviews originally written in Hindi unresolved. It also leaves open how the systems would behave on Hindi texts drawn from the other applications mentioned in the introduction. Those applications motivate interest in classification while having their own categories, input lengths and conventions.

There are limits to what accuracy reveals even within these benchmarks. An aggregate score can hide differences between frequent and infrequent categories or between examples that require different kinds of evidence. The paper gives no class-by-class results or error analysis describing those differences. The discussion states which systems generally did better, and exact margins are unavailable from that account. There is no uncertainty estimate accompanying the stated ordering. A close comparison can therefore be described as the authors describe it, with the practical size and reliability of the gap left open.

Some implementation details that would matter for a close replication are only specified for individual designs or given in outline. The paper names the optimizer and loss in its description of BOW and states the main layer choices for the architectures. The account is more detailed about how sentence representations are formed than about the full training schedule or parameter selection procedure. For the frozen encoders, it specifies the representation widths and the classification layers. The exact extraction choices behind the supplied BERT sentence vector are not elaborated in the architecture description. Such choices can matter for a comparison centered on what a fixed vector makes available.

The reported training stability and speed tradeoff likewise have separate evidence requirements. The authors observe steadier performance across epochs with FastText and see BOW as attractive when speed matters. The architectural reasons for the latter are easy to follow because averaging is a short path from a list of vectors to a sentence representation. The paper supplies no elapsed times or throughput measurements, and it gives no numerical summary of training variability. It therefore supports a qualitative account of training behavior and a qualitative argument for the simpler architecture.

Finally, the study does not estimate the effect of each architectural choice independently. Changing from CNN to LSTM also changes the way that evidence travels from words to the sentence vector. Changing from BERT to LASER changes the representation source at several levels at once. Even within the recurrent family, some variants alter both directionality and pooling. The most interpretable comparisons are those that change a single decision, such as weighting a word average or switching the readout on the bidirectional network. The larger comparisons establish which complete systems worked better under the authors’ conditions.

What came after

The later work MaiBERT, from 2026, cites the Hindi classification comparison. Its stated subject is a pretraining corpus and a language encoder for low-resourced Maithili. The connection is resource availability. The Hindi study uses translated labeled data to compare ways of turning text into decisions. MaiBERT places corpus construction and pretraining at the center of a study for another language. This brings the availability of reusable representations into focus, an input that the Hindi study already treats as an important part of a classification experiment. MaiBERT

The citation establishes a connection between the studies, while the details of how MaiBERT used the comparison are unspecified. Its stated scope describes resources for pretraining. The Hindi paper’s frozen-encoder experiments illustrate one separate question that can arise once such a resource exists, namely how much information a classifier can recover from a reusable representation on a labeled task. The documented connection supports that reading of their shared research problem, with reuse of a benchmark, an architecture or a result left unestablished.

Cite

Cite as Ramchandra Joshi, Ramchandra Joshi, Purvi Goel, Raviraj Joshi and Raviraj Joshi. 2020. Deep Learning for Hindi Text Classification: A Comparison. Lecture notes in computer science.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1007/978-3-030-44689-5_9 · arXiv 2001.10340

@inproceedings{joshi2020deep,
  title = {{Deep Learning for Hindi Text Classification: A Comparison}},
  author = {Ramchandra Joshi, Ramchandra Joshi, Purvi Goel, Raviraj Joshi and Raviraj Joshi},
  booktitle = {Lecture notes in computer science},
  year = {2020},
  doi = {10.1007/978-3-030-44689-5\_9},
  eprint = {2001.10340},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1007/978-3-030-44689-5_9}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/joshi-2020-deep-learning-hindi-text-classification/

References

10 references, from the paper's own bibliography.

  1. Arora, P.: Sentiment analysis for hindi language (2013) OpenAlex ↗ · Scholar ↗
  2. Artetxe, M., Schwenk, H.: Massively multilingual sentence embeddings for zero-shot cross-lingual transfer and beyond. arXiv preprint arXiv:1812.10464 (2018) our card
  3. Conneau, A., Lample, G., Rinott, R., Williams, A., Bowman, S.R., Schwenk, H., Stoyanov, V.: Xnli: Evaluating cross-lingual sentence representations. arXiv preprint arXiv:1809.05053 (2018) OpenAlex ↗ · Scholar ↗
  4. Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018) our card
  5. Joulin, A., Grave, E., Bojanowski, P., Mikolov, T.: Bag of tricks for efficient text classification. arXiv preprint arXiv:1607.01759 (2016) OpenAlex ↗ · Scholar ↗
  6. Kim, Y.: Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882 (2014) our card
  7. Lai, S., Xu, L., Liu, K., Zhao, J.: Recurrent convolutional neural networks for text classification. In: Twenty-ninth AAAI conference on artificial intelligence (2015) OpenAlex ↗ · Scholar ↗
  8. Pennington, J., Socher, R., Manning, C.: Glove: Global vectors for word representation. In: Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP). pp. 1532–1543 (2014) our card
  9. Tummalapalli, M., Chinnakotla, M., Mamidi, R.: Towards better sentence classification for morphologically rich languages (2018) OpenAlex ↗ · Scholar ↗
  10. Zhou, P., Shi, W., Tian, J., Qi, Z., Li, B., Hao, H., Xu, B.: Attention-based bidirectional long short-term memory networks for relation classification. In: Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers). pp. 207–212 (2016) our card