Elamur Research

Improving Sentiment Classification in Slovak Language

Paper · 2019 · Samuel Pecar, Marian Simko and Maria Bielikova

Summary

A customer review can frequently tell you how its writer felt about a service. A tweet may leave the decisive clue in the link it shares or in the conversation it answers. Both kinds of writing appear in this study of Slovak sentiment classification, which asks how well a system can assign a positive, neutral or negative label from the words alone. The authors work with a relatively small collection of customer reviews and a larger collection of tweets. Their main question is whether a classifier can start with representations learned from other Slovak text and use the available sentiment labels more effectively.

The authors vary how the classifier represents words, how it reads them in sequence and whether it learns to give some positions more weight in its decision. Their strongest individual configuration on both collections uses ELMo, which represents a word in light of its surroundings, followed by a recurrent network that reads in both directions and an attention layer that combines information from across the text. ELMo gives the clearest gains among the choices tested. Reading in both directions and adding attention also help in the comparisons the authors make. Pretrained word2vec and fastText bring little change over a randomly initialized word lookup on customer reviews, while both improve results on tweets in the architecture used to compare them.

On the customer-review dataset, Reviews3, the best individual classifier reaches micro F1 of 0.8132 and macro F1 of 0.7693 in the paper’s cross-validation evaluation. Micro F1 measures performance after pooling decisions across classes, while macro F1 gives each class equal weight. The earlier review results available for comparison report micro F1 of 0.7512 for a support vector machine and 0.7296 for a neural classifier. On the Twitter test split, the best individual configuration reaches micro F1 of 0.6978. Averaging the predictions of separately trained copies raises it to 0.7008 and yields macro F1 of 0.6728. The earlier Twitter result comes from a different set of available posts, so the comparison is informative but indirect.

The tweet errors help explain why the choice of input matters alongside the choice of classifier. In the authors’ inspection, some tweets annotated as positive offered little sign of that judgment in their wording. The label could depend on an attached link or on knowledge of the surrounding discussion. The study establishes that better word representations improve prediction of the assigned labels in both collections. It also leaves open how many Twitter labels a reader could recover from the text under the same constraints.

Deep dive: Improving Sentiment Classification in Slovak Language

A study of Slovak sentiment classification compares ELMo, recurrent networks and prediction ensembles on customer reviews and tweets. · about 31 minutes to read

The problem and its context

From an opinion to a category

The paper studies a form of text classification in which the input is a piece of Slovak writing and the output is a sentiment category for that piece. A review or a tweet comes with a human judgment, and the classifier learns to predict judgments of the same kind on other examples. The task asks for the overall label assigned to the item. In a customer review, praise and criticism can both appear, yet the evaluation still expects a single answer for the review. That framing is important because the supplied categories determine what counts as a correct prediction.

The authors motivate the task through the amount of opinionated writing on services such as social networks and review platforms. A collection of reviews groups writing around recognizable experiences with services. A collection of general tweets can contain a wider variety of subjects and reasons for writing. By testing both, the paper can ask whether an architecture that improves classification in the review setting tends to improve it in the social media setting as well. The experiments concern separately trained classifiers for the collections. Performance across the two domains is therefore evidence about the range of settings in which the approach can be trained and evaluated.

The connection between sentiment and wording is easier to see when the writer explicitly describes satisfaction or dissatisfaction. Less explicit cases make the benchmark’s definition more consequential. Reviews3 uses its neutral class partly for mildly positive and mildly negative judgments. The learner therefore encounters examples of favorable or unfavorable language that have a neutral target. Predicting the annotation requires learning the degree of sentiment the dataset treats as sufficient for a positive or negative label. The meaning of a correct response depends on that convention as well as on the writer’s wording.

Human annotation is part of the problem even when the benchmark presents every item with a settled label. The authors explain that agreement on the reviews was limited and connect that observation to the subtlety of many judgments. They also refer to previous work on what annotators contribute to multilingual Twitter sentiment classification. These are reasons to pay attention to how the expected answer was assigned. A difference between the predicted and assigned categories is an error for the evaluation, while the language of the item may admit more than one reasonable reading.

Earlier sentiment research in and around Slovak

The paper places Slovak among languages for which sentiment classification had already been studied but for which the authors saw fewer large annotated resources than for major languages. Its survey mentions Czech social media and aspect-level sentiment, short texts in Croatian, internet comments in Lithuanian, and sentiment evaluation in Russian. Those examples situate the Slovak work within an existing line of research. They also show that the authors’ point about low-resource languages concerns the conditions under which experiments are run, especially the amount of task-specific labeled text available.

In the Slavic-language studies they discuss, the authors identify support vector machines as a common choice. A support vector machine, or SVM, learns a decision boundary from examples represented as features. The Slovak review work already included an SVM approach and a neural approach that investigated text preprocessing. Both earlier review systems also used pretrained word2vec representations. The starting point for the new study therefore included prior use of information learned from other Slovak text. What the authors broaden is the comparison among ways of supplying that information and ways of reading a sequence after the input has been represented.

The survey contrasts those traditional classifiers with developments in neural sentiment research. In the work it cites, attention had been used to help a recurrent network focus on information relevant to a sentiment judgment. One cited example studies sentiment at the level of an aspect, where the target is an opinion about a particular part of what is being discussed. That earlier task supplies an architectural precedent. The Slovak experiment adopts attention for a whole-item decision. Attention-based LSTM for Aspect-level Sentiment Classification

The authors also draw on prior use of ensembles in sentiment analysis. An ensemble gathers decisions from several trained classifiers to make a joint prediction. Where attention changes how one classifier combines evidence within a text, an ensemble changes how several classifiers’ judgments about that text are brought together. Those choices enter at different stages. The paper first compares individual architectures and then asks whether combining runs of the strongest design helps on Twitter.

Why pretraining was a practical option

The authors identify word embeddings as a place to reuse what can be learned from larger collections of text. An embedding supplies a numerical representation that a neural network can process. It can be learned together with the sentiment classifier, beginning with a randomly initialized lookup table, or it can draw on prior training. Prior training gives the classifier an input representation whose construction used text beyond the annotated sentiment examples. The sentiment labels still have to teach the network how to turn those representations into the benchmark’s categories.

The paper discusses recent representation approaches including ELMo, BERT and ULM-FiT. It cites these as examples of a field in which some resources were then much easier to obtain for English than for smaller languages. The authors point to the amount of text and computing equipment required to train such resources. For their own comparison, they make use of representations already available for Slovak. ELMo is among the representations they evaluate. BERT and ULM-FiT belong to the motivation for transfer learning in the paper’s discussion. ELMo · BERT

This distinction sets up the experiment. A lookup table learned during sentiment training gives the authors a reference point for what their architecture can do starting from randomly initialized word vectors. Pretrained Slovak resources let them ask how far that point can move when the input already carries information from other text. Because the paper also varies the recurrent network and attention, it can examine whether better input representations remain valuable as the classifier’s way of processing the sequence changes.

The method, step by step

From tokens to a sentiment decision

The classifier receives the wording of a review or tweet. It begins with tokenization, the division of the text into the pieces that the subsequent stages read. The authors use spaCy’s Slovak tokenizer and escape punctuation to improve its handling of the input. Escaping is the sole preprocessing operation they report for these experiments. The tweet’s wording is the input to the sentiment classifier. The material a tweet links to and the larger situation in which it was written are outside the input described by the paper.

Each position in the resulting sequence gets a numerical representation. A recurrent network then reads the sequence and produces states that carry information about the current position and the surrounding text it has seen. The authors compare a network that reads in one direction with a bidirectional version. They also test an attention layer in the bidirectional architecture. When present, that layer learns how much each position should contribute to the representation used for the sentiment decision.

A linear decoder maps the resulting text representation to scores for the possible classes. The paper applies logarithmic softmax to those scores. This operation puts the scores on a common probability scale and expresses them as log probabilities. The output can then be used both to choose a class and to train the classifier against the annotated answer. In the two datasets evaluated here, the output categories are negative, neutral and positive.

From Slovak text to a sentiment prediction

The steps in order.

From Slovak text to a sentiment predictionStep 1: Escape punctuation before tokenizing1. Escape punctuation before tokenizingStep 2: Represent each token numerically2. Represent each token numericallyStep 3: Read the sequence with a recurrent network3. Read the sequence with a recurrent networkStep 4: Weight token states when attention is used4. Weight token states when attention is usedStep 5: Score sentiment classes with a linear decoder5. Score sentiment classes with a linear decoderStep 6: Apply log softmax and select a label6. Apply log softmax and select a label

Supplying word representations

The lookup configuration starts from a table of trainable vectors. The table’s entries are randomly initialized, and the embedding dimension is 300 in this setup. When the same token appears in different inputs, the lookup operation retrieves the same entry. The recurrent network can then treat that token differently depending on its position and surroundings. This division of labor matters for interpreting the results. Even the lookup configuration processes a sequence in context after the embedding stage.

ELMo supplies a contextualized representation at the input stage itself. A word’s representation can change when it is used in a different sequence. Thus the downstream recurrent network receives information about the particular occurrence before it constructs its own sequence states. The authors use an already pretrained Slovak ELMo resource. Their sentiment experiments test what that particular resource contributes when paired with the downstream architectures, with the available reviews or tweets furnishing the supervision for the final decision.

The study also includes pretrained Slovak word2vec vectors associated with the prim dataset of the Slovak National Corpus. Word2vec supplies a word with a representation learned during earlier training, so it differs from the lookup condition in the origin of its vectors. For the comparison in this paper, it provides a way to ask whether a pretrained word representation is already enough to match the gains seen with contextualized input. word2vec

The other pretrained option is fastText for Slovak. It gives the authors another way to fill the same input role using vectors obtained ahead of sentiment training. In the experiments, fastText and word2vec are paired with the same recurrent and attention design. The study can therefore compare their scores with those of ELMo and the lookup table in that architecture. The cited fastText work also figures in the paper’s account of pretrained representations becoming available across languages. Learning Word Vectors for 157 Languages

Taken together, the input options vary both the source and the kind of representation. A randomly initialized lookup leaves the task training to shape the input vectors. Word2vec and fastText bring in information from pretraining. ELMo also brings information about the occurrence in its input context. The paper compares the actual Slovak resources as they are available. As a result, the experiment measures what happens when the authors substitute one resource for another in a downstream design. A comparison designed to isolate contextualization alone would also have to account for the other differences in how those resources were obtained.

Reading the sequence and reducing it to a decision

The recurrent component is based on long short-term memory, or LSTM. Its purpose is to carry information forward as it reads a text, so that each new token can be processed in relation to what the network has already seen. A sentiment decision can depend on how an opinion develops across the text. The sequence reader gives the classifier a way to preserve some of that development in its internal representation.

The unidirectional LSTM builds its sequence states while reading in one direction. In the bidirectional version, abbreviated BiLSTM, recurrent processing also runs in the opposite direction. A position can therefore be represented using information picked up from either side. This difference concerns what the downstream reader can incorporate around each position. It applies whether the original token vectors came from the lookup table or from ELMo.

The paper describes stacked recurrent layers as an architectural possibility and gives 512 as the size used to keep the range of settings manageable. The actual configurations in its comparison use one recurrent layer, either unidirectional or bidirectional. There is a difference between the range of designs the authors considered and the settings for which they report results. The recurrent comparison in the results addresses directionality in those single-layer configurations.

After the recurrent network, the version with self-attention learns an informativeness weight for each position in the sequence. The text representation is built as a weighted sum, so positions receiving more weight contribute more to what the decoder sees. The attention is described in terms of the words of the input and the information they provide for classifying it. The sentiment label supervises the final decision. The authors give no separate annotation saying which positions the classifier should prioritize.

In the versions without attention, the recurrent component still needs to supply a representation for the decoder. The paper concentrates on the layer combinations and describes the weighted aggregation in the attention version. It gives less detail about the exact aggregation in the versions without attention. That level of reporting is sufficient to read the controlled comparison as the authors define it. It leaves some implementation choices unspecified in the architectural account.

The linear decoder is common to the systems. Where the earlier stages determine what information is available about the input, the decoder converts that information into class scores. The log-softmax operation makes those scores suitable for the negative log-likelihood objective. This loss grows as the classifier assigns less probability to the annotated class. During training, the optimization procedure uses that signal to update the trainable parameters. The paper describes the loss and the attention operation in words, without explicit equations.

Which combinations enter the comparison

With the lookup table as input, the authors train a unidirectional LSTM, a bidirectional LSTM and a bidirectional LSTM followed by self-attention. They repeat the same sequence of configurations with ELMo. This arrangement gives the comparison three corresponding architecture settings in which the main change is the input representation. It also lets the authors examine how much adding bidirectionality or attention changes the scores within either input family.

The authors restrict word2vec and fastText to the bidirectional architecture with self-attention. This gives them a common design for comparing all the word representations. It also limits what can be inferred about the static pretrained vectors. Their scores show how the resources fare when used with that specific sequence reader and aggregation method. Performance with a unidirectional reader or with attention removed remains open for those resources.

The recurrent architecture does not vary the output task. Every reported configuration for a dataset predicts the same set of labels from the same kind of input. That constancy is important because a score can otherwise move merely because a problem has been made easier or because the annotation has changed. Here the authors can align configurations on the same dataset while changing identifiable parts of the classifier.

How the classifiers learn and how their predictions are combined

The training procedure assigns examples to training, validation and test portions. Training examples provide the annotated targets used to update the classifiers. The validation portion has the role of a separate development set, and the test portion is reserved for evaluation. The authors use an 8:1:1 ratio in that order for both collections. Reviews3 is small enough that they use cross-validation, which repeats evaluation across partitions of the dataset. Twitter uses a single split with that ratio.

The authors use Adam to optimize the negative log-likelihood loss. They also apply dropout, which temporarily suppresses some activations during training and reduces the network’s opportunity to depend on the same internal signals every time. They report dropout of 0.5 after the embedding layer and 0.3 after the recurrent and attention layers. The settings form part of a largely standard training setup. The study’s comparisons are organized around the components of the architecture rather than a broad search over training settings.

For the Twitter ensemble, the authors train 3 instances of the same architecture with different initializations. Each has its own training run. With voting, each instance proposes a label and the joint decision is based on the votes. With averaging, the instances’ predicted probabilities are averaged for each class. The resulting scores determine the prediction. Probability averaging retains information about alternatives that an instance considered plausible, whereas a vote communicates its selected category.

The two ensemble rules are applied to predictions from the same kind of classifier. Their comparison therefore asks how best to use the judgments of separately trained instances, rather than testing whether different architectures complement each other. The paper makes the experiment code available and reports releasing tweet identifiers by split to support reproduction of the Twitter evaluation.

Experiments and results

The customer-review benchmark

Reviews3 contains 5320 customer reviews of services. Human annotators assigned the sentiment labels, and the paper reports that 2 annotators worked on the reviews. The dataset has 431 negative, 2911 neutral and 1978 positive items. Neutral is the largest class, and the negative class is relatively small. The authors explain the neutral category in part through the presence of mildly favorable and unfavorable reviews and the difficulty of reaching agreement on some of those items.

Because of the collection’s size, the paper evaluates the classifiers with cross-validation using the stated 8:1:1 training, validation and test proportions. The reported review scores should be read as results of that procedure. The authors compare them with previously published customer-review scores from an SVM system and a neural system that studied preprocessing. Both earlier systems drew on pretrained word2vec representations from the prim dataset. The available baseline scores are micro F1, which defines the common metric for the historical comparison.

The Twitter benchmark

The Twitter dataset contains general Slovak tweets with manual sentiment labels. The authors work with posts they were still able to obtain through Twitter’s standard API. Their available collection contains 50,710 items, made up of 12,815 negative, 10,817 neutral and 27,078 positive tweets. Positive is the largest class here. This differs from Reviews3, where neutral is the largest class and the negative examples make up the smallest category.

The Twitter experiments use a fixed 8:1:1 training, validation and test split. The earlier Twitter study evaluated several classifiers, and the best one cited by the paper is called TwoPlaneSVMbin. The earlier result is a point of reference from the original study. Because some posts could no longer be obtained, its evaluation population differs from the one used for the new experiments. The paper explicitly flags that difference in its comparison.

The domain and evaluation procedure both change between Reviews3 and Twitter. The review evaluation spans partitions, while the Twitter comparisons are made on the held-out portion of the authors’ fixed split. The category distributions also differ. These facts matter when reading higher scores on one collection than the other. Comparisons among classifiers within a collection share more of their conditions than a comparison between the two collections does.

Why the paper reports micro and macro F1

F1 summarizes precision and recall. For a sentiment category, precision asks how often predictions of that category are correct. Recall asks how frequently examples annotated with the category are recovered. F1 combines the two in a way that requires both to be strong for the combined score to be high. This is useful for sentiment labels because a classifier could make very few predictions of a category and be right about most of them while still overlooking many of the examples assigned to that category.

Micro F1 pools decisions across categories before summarizing precision and recall. A category with many examples therefore has more influence through its contribution to the pool. Macro F1 computes a score for each category and gives those class scores equal weight when averaging them. The authors report both because the category counts are uneven in Reviews3 and Twitter. The two measures give readers a pooled result and a view in which success on a less frequent class has equal influence.

Neither aggregate tells a reader which particular class changed most. Macro F1 can improve because the classifier handles one class much better, or because smaller improvements occur across several classes. Micro F1 can move in the same direction under several different patterns of mistakes. The two scores are useful checks on the scope of a result, and the confusion analysis later in the paper makes the types of mistakes more concrete for Twitter.

Results on Reviews3

The strongest review classifier combines ELMo, a bidirectional recurrent layer and self-attention. Its micro F1 is 0.8132 in the Reviews3 cross-validation evaluation. The earlier SVM result is 0.7512 and the earlier neural result is 0.7296 on the same reported metric. The authors describe their best review result as an improvement of more than 6 points over prior performance. They can make the historical comparison on micro F1 because the prior review papers did not report macro F1 for it.

Classifiers compared on Reviews3 by micro F1

The ELMo classifier with bidirectional reading and attention leads the comparison with the earlier review systems.

Classifiers compared on Reviews3 by micro F1Earlier neural classifier: 0.7296Earlier neural classifier0.7296Earlier SVM classifier: 0.7512Earlier SVM classifier0.7512ELMo with bidirectional LSTM and attention (this paper): 0.8132ELMo with bidirectional LSTM andattention (this paper)0.8132
The numbers
System or settingmicro F1
Earlier neural classifier0.7296
Earlier SVM classifier0.7512
ELMo with bidirectional LSTM and attention (this paper)0.8132

The best configuration also has the strongest macro F1 among the authors’ own review runs, at 0.7693. With ELMo retained and attention removed, the bidirectional configuration records micro F1 of 0.8101 and macro F1 of 0.7681. The unidirectional ELMo run records micro F1 of 0.8007 and macro F1 of 0.7613. All those scores refer to Reviews3. They show that the advantage of using ELMo is already visible with the unidirectional architecture and that the strongest reported scores come from combining it with the added layers.

The lookup configurations form the same ordering. The unidirectional run reaches micro F1 of 0.7481 and macro F1 of 0.6960. Using the bidirectional reader gives micro F1 of 0.7687 and macro F1 of 0.7308. Adding attention gives micro F1 of 0.7813 and macro F1 of 0.7337. Within this family, both changes move both metrics in the favorable direction. The size of the movement depends on the metric and the component being added.

For the bidirectional architecture with attention, the pretrained static vectors land close to the lookup configuration on pooled review performance. The word2vec run reports micro F1 of 0.7838 and macro F1 of 0.7491. The fastText run reports micro F1 of 0.7819 and macro F1 of 0.7446. Their macro scores are above that of the corresponding lookup configuration. The paper characterizes the overall improvement from these resources on reviews as limited, a judgment especially clear in the micro F1 comparison. ELMo remains ahead of either resource on both measures.

The comparison with prior work and the comparison among the new configurations support different conclusions. The earlier results establish where previously reported review performance stood. The parallel runs within the paper give more direct evidence about which of the new architectural choices is associated with the strongest scores under its procedure. In particular, several routes through the current architecture improve on the earlier neural result, while the best review result belongs to the combination using ELMo and both downstream additions.

Results on Twitter

The best individual Twitter configuration is again the one that combines ELMo with bidirectional recurrence and attention. In the architecture comparison its test micro F1 is 0.6978 and its macro F1 is 0.6695. The ELMo bidirectional configuration without attention scores 0.6671 micro F1 and 0.6487 macro F1. The unidirectional ELMo configuration scores 0.6594 micro F1 and 0.6386 macro F1. The ordering matches what the authors observe for Reviews3, with a clearer separation on Twitter between the ELMo runs with and without attention.

With the randomly initialized lookup table, the Twitter results are lower. The unidirectional test scores are 0.5804 micro F1 and 0.5565 macro F1. The bidirectional configuration reaches 0.5866 micro F1 and 0.5614 macro F1. Its counterpart with attention reaches 0.5967 micro F1 and 0.5747 macro F1. Reading the ELMo and lookup results alongside one another shows why the authors emphasize the word representation. ELMo leads with each of the recurrent settings that the two input families share.

Word representations on the Twitter test split by macro F1

ELMo leads when the bidirectional reader and attention layer are held fixed.

Word representations on the Twitter test split by macro F1Randomly initialized lookup: 0.5747Randomly initialized lookup0.5747Pretrained word2vec: 0.5908Pretrained word2vec0.5908Pretrained fastText: 0.6188Pretrained fastText0.6188Pretrained ELMo (this paper): 0.6695Pretrained ELMo (this paper)0.6695
The numbers
System or settingmacro F1
Randomly initialized lookup0.5747
Pretrained word2vec0.5908
Pretrained fastText0.6188
Pretrained ELMo (this paper)0.6695

The chart uses the common bidirectional architecture with attention. The corresponding Twitter micro F1 scores are 0.5967 for lookup, 0.6107 for word2vec, 0.6468 for fastText and 0.6978 for ELMo. In contrast to their close micro F1 results on reviews, both static pretrained representations improve on the lookup baseline on Twitter in this architecture. FastText leads word2vec on both metrics there, while the order between those representations is reversed on Reviews3. Their relative performance depends on the collection in which the authors test them.

What combining predictions adds

In the Twitter ensemble experiment, using votes yields test micro F1 of 0.6994 and macro F1 of 0.6710. Averaging the predicted probabilities yields 0.7008 micro F1 and 0.6728 macro F1. Both combinations exceed the individual micro F1 of 0.6978 that appears in the same comparison. By the reported measures, probability averaging is the stronger of the two ways the authors combine the runs.

Individual and combined Twitter predictions by test micro F1

Both combinations improve on the individual result, with probability averaging giving the highest score.

Individual and combined Twitter predictions by test micro F1Individual ELMo classifier with attention: 0.6978Individual ELMo classifier withattention0.6978Voting ensemble: 0.6994Voting ensemble0.6994Probability-averaging ensemble (this paper): 0.7008Probability-averaging ensemble (thispaper)0.7008
The numbers
System or settingmicro F1
Individual ELMo classifier with attention0.6978
Voting ensemble0.6994
Probability-averaging ensemble (this paper)0.7008

The tables in the paper give two macro F1 entries for the individual ELMo configuration on Twitter. The comparison of architectures gives 0.6695. The ensemble comparison lists 0.6636 beside the same configuration name and the same micro F1 of 0.6978. The paper gives no explanation for the difference. Each macro score should be read with its own table. The ensemble scores exceed either entry, while the appropriate size of a macro F1 improvement depends on which individual result is used.

The historical Twitter result for TwoPlaneSVMbin is micro F1 of 0.6840. It is lower than the scores for the strongest individual configuration and the two ensembles, on their respective evaluation sets. The paper marks the historical figure to indicate the difference in available tweets. A test of both approaches on exactly the same posts would be needed to interpret their score ordering as a controlled comparison between classifiers. The improvement from combining current runs is easier to interpret because it is measured within the authors’ Twitter setup.

What the ablations show

The representation comparison has the broadest support

The paper varies selected components of a shared architecture. Some comparisons substitute one component for another while retaining the rest of the design, and others add a component to a condition already tested. This supplies evidence about the parts the authors discuss in their conclusion. It gives each comparison a specific scope. For example, the attention experiment asks about adding attention after a bidirectional reader, while the ELMo comparison can be made with several recurrent settings.

The strongest pattern is the performance of ELMo against the randomly initialized lookup table. On Reviews3, the unidirectional comparison puts ELMo at micro F1 of 0.8007 against 0.7481 for lookup. The corresponding Twitter test comparison is 0.6594 against 0.5804. Because both of these comparisons use a unidirectional LSTM without attention, they show that neither bidirectional recurrence nor the attention layer is required for the input representation to bring a substantial improvement in the reported setup.

The ELMo advantage also persists with a bidirectional reader and then with bidirectional reading plus attention. The consistency of the ordering matters more than a single best run for the question the authors pose. If ELMo had led in only one arrangement, the result would have established a narrower relationship between a representation and a particular reader. Its lead across the matched conditions makes the case that choosing the input representation accounts for much of the performance pattern across the experiments.

The static pretrained resources sharpen that interpretation. They give the authors ways to use a representation learned before the sentiment task while keeping the bidirectional and attention stages the same. The Reviews3 micro F1 values for those resources remain close to the random-start lookup baseline. On Twitter, the static pretrained options offer a clearer benefit. ELMo nonetheless leads both of them on each collection. The result supports the choice of ELMo among the resources tested. The architecture controls do not also control the resources’ pretraining data and procedures, so the specific contribution of contextualization remains entangled with other differences among the pretrained inputs.

Reading in both directions

The directionality comparison is available for both lookup and ELMo. In each case the authors can compare the unidirectional configuration with a bidirectional configuration that also omits attention. This is a clearer test than jumping straight from a unidirectional classifier to one with both bidirectionality and attention. The intermediate setting lets the reader associate the first movement in the scores with the change in the recurrent component.

The scores improve in the bidirectional conditions on both datasets and according to both metrics. The increase is visible in Reviews3’s lookup comparison, where micro F1 moves from 0.7481 to 0.7687 and macro F1 from 0.6960 to 0.7308. The corresponding change with ELMo starts from a higher score and produces a smaller movement on both metrics. The results demonstrate the usefulness of bidirectional processing at the tested size. They leave open how its contribution would change under other recurrent capacities or other training settings.

ELMo already varies token representations with context, and the bidirectional reader still improves the reported results with that input. The two parts have different roles. ELMo supplies a contextual representation derived from prior training. The recurrent layer in the classifier processes those inputs for the sentiment task. The results are compatible with the idea that both stages provide helpful context in different ways. The paper measures the outcome of the combination and does not inspect the internal representations to attribute particular decisions to either stage.

Adding attention to a bidirectional reader

For lookup and ELMo, the attention comparison holds the input type and bidirectionality fixed. The authors then add the learned weighted aggregation. With ELMo on Reviews3, micro F1 moves from 0.8101 to 0.8132, and macro F1 moves from 0.7681 to 0.7693. Those results account for attention’s place in the best review configuration while showing that most of that configuration’s performance is already present before the attention layer is introduced.

The ELMo Twitter comparison has a larger separation between the two conditions. The bidirectional reader with no attention records 0.6671 micro F1 and 0.6487 macro F1. Adding attention gives 0.6978 and 0.6695 in the architecture comparison. Lookup also improves when attention is added, although the score pattern there is different. The effect of an added component is best read with its dataset and input type attached. Statements about attention’s contribution to the whole study otherwise conceal the variation the results actually show.

The study demonstrates an improvement from an architecture that uses attention. Attaching a meaning to its weights would require additional analysis. The paper does not report a comparison between the attention weights and human judgments about the particular words responsible for a label. Its later inspection examines the kinds of tweets classified incorrectly. That inspection helps explain why some decisions are hard from text alone, while the attention comparison concerns the quality of predictions with the component present.

The architecture comparison has other limits of coverage. There is no corresponding attention run with a unidirectional reader, and the static pretrained inputs appear only in the bidirectional attention setup. Consequently, the evidence supports the changes along the tested progression. It leaves the interaction between attention and directionality incompletely measured. It also leaves open whether the benefit of attention would have the same shape for word2vec or fastText if runs with attention removed were available.

Combining runs of the same design

The ensemble experiment changes the decision procedure after training several instances. All use the same architecture, so the improvement can arise from differences in the predictions reached by separate training runs. Voting lets agreements among the selected labels settle the joint judgment. Averaging leaves room for the confidence assigned to each class to affect the outcome. In the reported Twitter comparison both help, and probability averaging leads on the two aggregate metrics.

The incremental nature of the gain is visible from the individual micro F1 of 0.6978 and the ensemble values of 0.6994 and 0.7008. The paper’s representation and architecture experiments already reach the level from which this refinement starts. The ensemble experiment then shows that predictions from several runs can improve on that individual result. It does not, by itself, establish the stability of the ordering between voting and averaging across repeated sets of runs or across another collection. The authors evaluated the ensemble only for Twitter.

When the written tweet leaves the label unclear

The authors include a confusion matrix for their best-performing Twitter classifier. A confusion matrix groups predictions by the assigned label and the label returned, making it possible to see how mistakes are distributed across categories. The paper draws attention to errors involving positive sentiment. This includes items labeled positive for which the classifier returned another category, as well as items predicted as positive that carried a different label. The observation covers both failure to recover positive examples and incorrect use of the positive category.

The accompanying manual inspection looks at particular mislabeled or misclassified tweets. The authors report finding tweets labeled positive whose wording offered little visible indication of that sentiment. In some instances they attribute the positive label to information in a link attached to the tweet. In others, the expected interpretation may require knowledge such as the political situation or the responses surrounding the post. In those cases the input contains the text associated with the judgment, while part of the evidence for the judgment may lie elsewhere.

This analysis concerns the relationship between the assigned label and the available input. A classifier can make mistakes because it fails to recognize evidence in the text. It can also fail to recover a label that the text only weakly supports. A metric treats both as prediction errors. The authors’ inspection puts the second possibility on the table for Twitter, but it does not determine how much of the overall error each possibility accounts for. The confusion matrix shows the categories involved, while the manual observations offer plausible explanations for some of those errors.

The authors also suggest that the wider subject matter and expressive purposes of tweets may help explain their lower performance compared with reviews. That interpretation concerns the kinds of judgments the texts invite. It should be distinguished from the actual class distribution. Reviews3 has a large neutral category, in part because it includes mild sentiment there. The explanation about how evaluative the genres tend to be does not imply that most reviews in this benchmark carry an explicitly positive or negative annotation.

Limitations

Limits identified by the authors

The paper identifies the small size of Reviews3 as a constraint. Its response is cross-validation, which lets the evaluation use different portions of the available collection as held-out data across runs of the procedure. This makes fuller use of the labeled reviews. The underlying evidence still comes from that collection, with its particular services, class balance and neutral category. The authors also point to limited agreement between review annotators, which makes the target more dependent on how the labels were defined and assigned.

For Twitter, the authors explicitly qualify their comparison with the earlier study because some posts were unavailable. The paper’s split identifiers help specify which accessible posts were included in its evaluation. The original classifier’s reported score concerns a different evaluation population. The authors’ experiment can show how their proposed systems compare with one another on the retrieved posts. The comparison with the earlier Twitter result remains conditional on the difference in data.

The authors identify missing information around some tweets as another constraint. Links, responses and relevant real-world circumstances can bear on the assigned sentiment. Their classifiers use the text of the item itself. If the evidence for an annotation falls outside that text, the training procedure gives the classifier a target whose rationale may be unavailable at prediction time. The authors propose further manual evaluation to estimate what people can do on the same kind of dataset. The error inspection is a reason to conduct that evaluation, and the paper reports no resulting estimate of human performance under the text-only conditions.

The authors also describe their architectural and training choices as standard settings with limited fine-tuning. They see scope for better results from exploring those choices further and from pretraining ELMo on a larger collection. Within the study, the reported score belongs to the combination of the resources and settings actually used. The extent to which a different training setup or a larger pretraining corpus would change the comparison remains an open question.

Limits of the experimental design

The review and Twitter experiments offer two views of Slovak sentiment classification. Their differences span more than genre. Label frequencies change, the reasons for assigning a neutral label can differ, and the two evaluations use different partitioning procedures. The fact that the authors obtain stronger scores on Reviews3 cannot establish which of those differences matters most. Their observations about links and surrounding circumstances give a concrete explanation for some tweet errors. They do not isolate the cause of the cross-dataset score gap.

The use of micro and macro F1 makes the class imbalance visible in the evaluation, but the paper gives limited evidence about how each architectural choice affects each class. The Twitter confusion matrix concerns the strongest classifier, and the scores for the architectural comparisons are pooled or averaged. This makes it possible to say that the best configurations improve the aggregate measures. A claim about which class most benefited from ELMo or which kind of sentiment becomes easier to detect with bidirectional recurrence would need class-specific comparisons across configurations.

The comparison of word representations likewise supplies evidence about complete resources as used. The lookup table starts with random entries. The available pretrained resources were learned through different procedures, and ELMo changes the way token representations depend on context. Since these differences arrive together, the paper can identify a winning representation under its conditions with more confidence than it can isolate a single property responsible for the win. The consistency across recurrent settings strengthens the result for ELMo without resolving that distinction.

Several reported comparisons involve nearby point estimates. The result tables give neither variability across repeated runs for each architecture nor uncertainty intervals for the scores. The smallest gaps establish an ordering in the reported experiments. Their stability under a different initialization, a new partition or another sample of comparable text is unknown. This matters for the narrow differences between some review configurations and for the ordering of the Twitter ensemble rules. The corresponding evidence for ELMo is broader because its lead appears across both collections and across the available matched architectures.

The discrepancy between the two individual Twitter macro F1 entries further limits the precision of an estimate of the ensemble’s incremental gain. The architecture table and the ensemble table agree on micro F1, and the ensemble leads on that measure. Macro F1 also favors the ensemble using either of the reported individual entries. The paper leaves the reason for the different values unresolved. Giving each result with its comparison preserves the measured ordering without assuming that the two individual entries are interchangeable.

Finally, the architecture is tested through training and evaluation within each domain. Testing the same design on reviews and tweets shows that it can be trained for both with favorable results. The paper provides no cross-domain experiment in which a classifier trained on one collection is evaluated on the other. It therefore leaves open how far a trained Slovak sentiment classifier transfers across domains, or how it would behave when the target labels reflect another annotation convention.

What came after

No later study building on this paper is documented. The paper itself identifies directions for continuing the investigation, especially where its two kinds of evidence diverge. The architecture experiments show gains from changing the representation and combining predictions. The tweet inspection identifies cases in which more effective processing of the same input may still leave the classifier without evidence available to the annotator. The authors regard those as grounds for different kinds of follow-up.

One direction is multilingual and cross-lingual learning. The authors point to using knowledge from multiple languages to address the shortage of annotated resources. In the experiments reported here, the transfer comes through representations already available for Slovak. A cross-lingual investigation would ask whether training information from other languages also helps the Slovak task. The paper presents this as a research direction and cites related work on combining multilingual and multitask learning. It reports no cross-lingual result for Reviews3 or Twitter.

A second direction concerns the conditions under which a label can be recovered. The authors propose further manual evaluation to learn how readers fare when they have only the tweet text. This follows closely from the error analysis. If people have difficulty reproducing some of the original annotations from that input, the result would help interpret what a text-only classifier is being asked to learn. The paper identifies linked material and surrounding events as possible sources of evidence, while leaving their prevalence and their effect on human agreement unmeasured.

The authors also point toward greater pretraining coverage for Slovak ELMo and a fuller investigation of training settings. Their reason for considering a larger pretraining collection is that the multilingual resource they used had been trained with limited data. These suggestions follow from the observation that the input representation affects results across both domains and several downstream configurations. Whether more pretraining text, greater tuning effort or access to more of a tweet’s context would yield the largest improvement is beyond the reported experiments.

Cite

Cite as Samuel Pecar, Marian Simko and Maria Bielikova. 2019. Improving Sentiment Classification in Slovak Language. Proceedings of the 7th Workshop on Balto-Slavic Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/w19-3716

@inproceedings{pecar2019improving,
  title = {{Improving Sentiment Classification in Slovak Language}},
  author = {Samuel Pecar, Marian Simko and Maria Bielikova},
  booktitle = {Proceedings of the 7th Workshop on Balto-Slavic Natural Language Processing},
  year = {2019},
  doi = {10.18653/v1/w19-3716},
  url = {https://doi.org/10.18653/v1/w19-3716}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/pecar-2019-improving-sentiment-classification-slovak-language/