Elamur Research

Evaluation of Sentence Representations in Polish

Paper · 2020 · Slawomir Dadas, Michał Perełkiewicz and Rafał Poświata

Summary

A sentence about a hospital visit can name a medical service and express dissatisfaction with it. A system sorting sentences by subject needs the first kind of information. A system judging sentiment needs the second. Both can start by encoding the same sentence as a vector, a list of numbers that another program can use to make a prediction. Evaluation of Sentence Representations in Polish asks how much useful information different ways of building that vector preserve. The authors bring together tasks that put different demands on the representation, at a time when Polish had fewer sentence-level evaluation resources than English.

The study adds two Polish datasets. One is a manual translation of SICK, with 10,000 sentence pairs that support separate tests of textual entailment and semantic relatedness. Entailment asks what follows from a statement. Relatedness asks how closely two sentences are connected in meaning. The other dataset, 8TAGS, uses material from a Polish social news site to test topic classification, with about 50,000 sentences and 8 categories. Two sentiment tasks drawn from consumer reviews complete the comparison, one for hotels and one for medical services. Semantic similarity

The results depend on the task. ELMo, which gives words representations that depend on their surroundings, leads on both sentiment datasets when the authors use all its layers. Its accuracy is 85.52 for hotels and 78.42 for medical services. Both ELMo variants reach 71.41 accuracy on 8TAGS. The multilingual sentence encoders lead on the sentence-pair tasks. LASER reaches 82.21 accuracy on entailment, while Universal Sentence Encoder achieves the highest Pearson correlation on relatedness, 0.833. Ordinary averages of Polish word vectors provide competitive reference scores, and all three static word-vector methods outperform the tested multilingual BERT setup on all five tasks. Word embeddings

The authors also change how static word vectors are combined. Giving rarer words more weight and removing a shared component yields mixed results. Appending a vector that records the highest value reached in each dimension improves both SICK tasks across all the static methods at the tested size of 300 dimensions per word vector. Larger word vectors also make simple averages more competitive on several tasks. The paper releases its datasets, experimental code and Polish pretrained representations, giving subsequent comparisons a way to test whether a more elaborate approach improves on a well-configured word-vector baseline.

Deep dive: Evaluation of Sentence Representations in Polish

An evaluation of Polish sentence embeddings compares word averaging, contextual representations, and multilingual encoders on five language tasks. · about 32 minutes to read

The problem and its context

What a sentence vector needs to carry

Word representations had already proved useful in tasks such as sequence tagging and machine translation. Many applications, though, work with whole pieces of text. A search system might have to compare a query with passages from a collection. A plagiarism detector may need to compare units larger than words. Encoding each unit as a vector gives the application a fixed set of numbers to work with, even when its inputs vary in length. The practical question is which information survives the move from a sequence of words to those numbers. Information retrieval & search

The answer depends on what happens after encoding. A topic classifier can frequently draw on vocabulary associated with a domain. A sentiment classifier needs evidence about the attitude expressed within that domain. An entailment decision places a different demand on the representation because the direction of the relationship matters. A description that states a specific detail can support a more general description of the same event. The more general description leaves that detail open. A vector useful for recognizing the shared topic can still make that distinction difficult for a classifier to recover. That range of demands explains the paper’s use of several text classification and sentence-pair tasks.

A simple way to encode the sentence is to look up every word in a table of vectors and average the vectors. Each coordinate in the result summarizes the values found in the same coordinate across the words. The sentence can then be read by a classifier that expects a consistent input size. This is a bag-of-words approach, so changing the order of the same static word vectors leaves the average unchanged. The paper studies this inexpensive construction because it provides a substantive comparison for approaches that introduce context or learn directly from whole sentences.

How earlier work built sentence representations

The authors describe Word2Vec, GloVe and FastText as established sources of static vectors. In this family of methods, a word has a reusable representation learned from a corpus. Word2Vec learns from predictive relationships between a word and its neighbors. GloVe draws on co-occurrence counts. FastText extends the word-based approach with representations of character sequences. Each can supply inputs to the same averaging procedure, although the corpus evidence and learning procedure behind those inputs differ. Word2Vec, GloVe, FastText

Earlier work also asked how to get more out of these reusable word vectors. Smooth Inverse Frequency uses estimates of how common words are, followed by a step that removes the dominant shared direction among the resulting sentence vectors. Another approach retains both a mean and a maximum for each coordinate. The paper cites prior experiments in which joining those two summaries helped on some downstream tasks. These proposals put the design choice after the word vectors have been learned. A researcher can change what the sentence vector preserves while keeping the source of its word vectors fixed. Simple Word-Embedding-Based Models and Associated Pooling Mechanisms

Contextual representations move some of that work earlier. A pretrained language model processes text in sequence, and its intermediate states can supply a representation for each occurrence of a word. The states can vary with the surrounding text. The related-work discussion describes ELMo and Flair as examples, alongside systems such as BERT and XLNet. Even if a downstream user ultimately averages the contextual vectors, the input to that average can already carry distinctions induced by the sentence around each word. ELMo, Flair, BERT, XLNet

A separate line of work trains a representation through an objective defined over sentences. In the paper’s account, Skip-Thought learns from a sentence’s neighbors in a document. The system first encodes the sentence and then tries to reconstruct surrounding sentences from that representation. This is self-supervised learning, in the sense that the documents supply the target through their own arrangement. The paper places later work on efficient sentence learning in the same broad line of inquiry. An Efficient Framework for Learning Sentence Representations

Sentence encoders can also learn from human judgments. The paper discusses the use of the Stanford Natural Language Inference corpus in the development of InferSent and Universal Sentence Encoder. There the training information includes labels supplied for English sentence pairs. In multilingual approaches based on translation, aligned sentences in different languages provide a different source of training signal. A representation produced from a source sentence has to support generating a corresponding sentence in another language. The training procedure therefore puts pressure on the representation to carry information about the whole input. InferSent, Universal Sentence Encoder, Learning Joint Multilingual Sentence Representations with Neural Machine Translation

The growing availability of multilingual corpora and improvements in how parallel text was collected gave this approach greater reach, according to the authors. LASER could encode 93 languages, and the multilingual version of Universal Sentence Encoder supported 16. Both included Polish. Their availability made it possible to ask whether encoders trained for broad language coverage transfer effectively to Polish tasks, alongside representations learned specifically from Polish text. LASER, Multilingual Universal Sentence Encoder

Why evaluate in Polish

The authors situate the paper alongside English work that used downstream prediction and linguistic probes to study sentence vectors. A downstream task asks whether a representation helps produce a useful output, such as a category or a relatedness score. A probe is organized around a particular property of the input and tests whether it can be recovered from the representation. By the time of this study, English research had examples of both approaches and a toolkit, SentEval, for running evaluations. Fine-grained Analysis of Sentence Embeddings, SentEval

The paper also describes an earlier comparison of English and Polish sentence representations that found high correlation across most of its downstream and probing tasks. That result gave the authors a reason to take existing evaluation practices seriously for Polish. They still saw a shortage of Polish datasets, pretrained representations and supporting tools. Cross-lingual initiatives such as XNLI helped with coverage, while the authors identified a continuing need for sentence-level data intended for Polish evaluation. Multilingual & cross-lingual NLP

The study addresses that shortage through complementary data sources. Translating a dataset preserves a connection to an established evaluation: SICK already defined judgments about entailment and relatedness for English pairs. Collecting material from a Polish site supplies sentences originally written for Polish readers and creates a task unavailable from the translated pairs. Existing consumer reviews add a further setting, in which sentence-level labels were already available. That combination turns the comparison into a question about how representations behave across sources of text, kinds of supervision and prediction targets. Evaluation & benchmarks

The method, step by step

The experiment first turns Polish text into vectors and then uses the vectors to predict labels or scores. The word-based approaches begin with a sequence of vectors and require a rule to combine them. The sentence encoders already return a vector for the entire input. Once each sentence has a representation, the downstream network learns from the task’s labeled examples. For relatedness, it receives features calculated from the representations of both sentences. The evaluation scores the resulting predictions against the judgments associated with the task.

How the Polish sentence evaluation works

The steps in order.

How the Polish sentence evaluation worksStep 1: Assemble labeled sentences and sentence pairs1. Assemble labeled sentences and sentence pairsStep 2: Obtain pretrained representations for each approach2. Obtain pretrained representations for each approachStep 3: Encode words or whole sentences3. Encode words or whole sentencesStep 4: Pool word vectors when applicable4. Pool word vectors when applicableStep 5: Construct inputs for the downstream task5. Construct inputs for the downstream taskStep 6: Train the predictor on task labels6. Train the predictor on task labelsStep 7: Score predictions against the recorded judgments7. Score predictions against the recorded judgments

Building the evaluation data

For sentiment, the authors use the Wroclaw Corpus of Consumer Reviews Sentiment, abbreviated WCCRS. It covers hotels, medical services, products and education. All of these domains have sentiment annotation at the document level. Hotels and medical services also have judgments for individual sentences, so those domains become separate tasks in the evaluation. A sentence is assigned to the positive, negative, neutral or ambiguous class. The task is to choose the class that matches the sentence-level annotation, using a vector built from that sentence.

Keeping the hotel and medical tasks separate gives the experiment a way to observe whether the same representation performs well across different kinds of consumer opinion. Both tasks use the same sentiment categories and measure the same type of prediction. The words and situations likely to carry the sentiment can differ with the subject of the review. The separate scores preserve that distinction between domains and let a reader see how far a ranking from hotel reviews carries over to medical services. Sentiment & emotion

For inference and relatedness, the authors translate the English SICK dataset manually into Polish. The corpus contains 10,000 sentence pairs, with an entailment label and a relatedness score for each pair. The translation aims to preserve the meaning of the English sentences, which makes it possible to retain the relationships that the benchmark tests. In some cases, different English sentences led to identical Polish translations. The translators adjusted such cases so that the Polish sentences retained a difference in syntax while preserving their meaning. SICK

SICK-E treats the first sentence as a premise and the second as a hypothesis. An entailment label means that accepting the premise commits the reader to accepting the hypothesis. A contradiction label means that accepting the premise makes the hypothesis false. A neutral label leaves the question open. The classifier must choose among these classes. For SICK-R, the target is a degree of relatedness on a scale from 1 to 5. A pair can have a great deal in common in subject matter or vocabulary and still require a separate judgment about whether one statement follows from the other.

The topic dataset comes from headlines and short descriptions of articles shared on wykop.pl. Users on the site can attach tags to an article. The authors select material associated with 8 popular tags, take sentences from that material and use the relevant tag as the sentence’s topic label. They keep sentences assigned to only one of the selected categories, so the resulting classification task has a single target for each retained sentence. The sentences are cleaned, broken into tokens and filtered to a length of more than 30 characters. Tokenization

The resulting 8TAGS collection contains about 50,000 sentences. Its classes include history, film, work and technology, as well as sport, food, medicine and motorization. The labels come from how users categorized the source material. This differs from the review judgments, which were assigned to sentences, and from SICK’s annotation of a relationship between sentences. Those differences matter when interpreting success. For 8TAGS, the vector needs to support prediction of the tag inherited from the article. In SICK, it needs to support a judgment about the supplied pair.

Obtaining the word vectors

The authors train Word2Vec, GloVe, FastText and ELMo on a Polish corpus totaling 1.5 billion tokens. The corpus combines Polish Wikipedia with books and articles in Polish. The three static methods use a common training setup and vectors of 300 dimensions in the main comparison. This makes it possible to compare their default sentence representations using the same corpus and word-vector size. ELMo learns a contextual representation and has a separate training configuration.

The static vocabulary includes lemmatized words appearing 3 or more times in the corpus. A lemma is the dictionary form used to group related inflected forms of a word. The vocabulary also includes the numbers from 0 to 10,000 and a pre-defined set of Polish given names and surnames. The frequency cutoff therefore describes how ordinary word entries are selected, with separate provisions for numbers and names. Pretraining a representation for often occurring lemmas provides a common basis for the three static methods. Lemmatization

For Word2Vec, the authors use skip-gram with negative sampling. Skip-gram trains a representation by using a target word to predict words in its local context. The negative-sampling objective lets training contrast observed word and context combinations with sampled alternatives. The paper describes the continuous bag-of-words objective as another Word2Vec option. That objective predicts the target from its context. The Polish comparison uses the skip-gram variant, so a score attributed to Word2Vec refers to that particular source of word vectors. Distributed Representations of Words and Phrases

GloVe begins with a matrix of weighted co-occurrences. These counts summarize which words appear near one another within a fixed context. The method learns vectors whose dot products, formed by multiplying and summing corresponding coordinates, approximate the co-occurrence information used for training. The evaluation uses the resulting vectors as entries in a word lookup. At that stage, GloVe and Word2Vec can be pooled in the same way even though their training procedures drew on corpus context differently. GloVe: Global Vectors for Word Representation

FastText represents a word using its own vector together with vectors for its character n-grams. An n-gram here is a sequence of adjacent characters of a specified length. Training learns representations for the word and for these shorter pieces, and the word embedding combines them by addition. The shorter pieces also give FastText a way to estimate a representation for a word absent from the training vocabulary. This capability belongs to the word-vector stage. Once the sentence has a sequence of word vectors, the same pooling choices can be applied as for GloVe or Word2Vec. N-gram

The random baseline also supplies a vector for each word in its vocabulary. Its entries are generated randomly, so they have no learned arrangement reflecting which words occur in similar contexts. Each entry can nonetheless serve as a consistent numerical identifier for its word. The downstream network can potentially learn that particular combinations of these identifiers are associated with labels. In this sense, the baseline tests what a classifier can do with word identity cues that have been placed in an arbitrary geometry.

Producing contextual word representations

For ELMo, the authors follow the earlier work’s hyper-parameter setting with 4096 hidden units and train for 10 epochs. An epoch is a pass through the training data. The architecture accepts characters and produces representations at different depths. Its initial word representation comes from the characters of the word itself. The following recurrent layers include information from its context, using bidirectional long short-term memory. A recurrent layer processes a sequence by carrying information through successive positions, and a bidirectional setup allows the representation to use context on both sides.

The experiment extracts ELMo vectors in two ways. The first uses the hidden state from the top layer for each word. The second joins the states from all the layers, including the initial context-independent representation. Joining, or concatenating, vectors places their coordinates end to end. The outputs from the lower layers remain directly accessible in the combined vector. Appending them also changes the size of the downstream input, an important detail when interpreting the comparison between the variants.

Flair also uses characters. The public Polish versions chosen for the experiment are pl-forward and pl-backward. They process the character sequence in opposite directions. The method reads a hidden state at a word boundary to obtain a word representation, then joins the forward and backward outputs. As with ELMo, the experiment subsequently averages the word representations. The contrast between the two approaches therefore includes differences in how they generate information at word positions, even though both use sentence averaging afterward.

For BERT, the authors select the official BERT Multilingual Cased release. BERT uses a transformer, whose attention mechanism lets internal representations draw on other positions in the input. The paper describes its pretraining through prediction of missing words and prediction of whether sentences follow one another. It evaluates BERT within the contextual word-representation group, where sentence vectors are obtained by averaging. The comparison concerns the public multilingual release under that extraction procedure.

Averaging and changing what pooling preserves

For the static embeddings, the authors normalize each word vector to unit length before taking the arithmetic mean. A word vector’s length is the magnitude of its coordinates considered together. Without normalization, a vector of large magnitude can pull the average farther in its direction than a vector of smaller magnitude. Putting the vectors at equal length gives each word occurrence the same weight in the mean. For the contextual representations, the authors describe taking the mean of the generated word representations.

s = (∑ᵢ vᵢ) / n

Here, s is the sentence vector, vᵢ is the vector for the word at position i, and n is the number of vectors being averaged. ∑ᵢ sums the vectors over those positions, coordinate by coordinate. / divides every coordinate of the sum by n, and = identifies the resulting vector as s. In the normalized static baseline, vᵢ already has unit length when it enters the formula. Repeating a word contributes another occurrence to the sum.

The mean records what each coordinate looks like across the words as a group. It can make a sentence with several similar word vectors fall in a region associated with those words. A coordinate value that is strong for a single word can become less prominent once the rest of the words contribute to the average. The experiment considers two ways to change this summary for static embeddings. One alters the influence of each word and then adjusts the resulting sentence vectors as a collection. The other stores coordinate-wise maxima alongside the means.

The weighting method is Smooth Inverse Frequency, or SIF. It starts from a frequency estimate for each word and gives a larger weight to a less frequent word. Its weighting expression is:

q(w) = a / (a + p(w))

Here, w denotes a word, q(w) is the weight applied to that word’s vector, and a is the smoothing parameter. p(w) is the word’s estimated probability, obtained by dividing its frequency in a corpus by the total token count of that corpus. + adds this probability to the smoothing parameter, / divides a by that sum, and = assigns the result to the weight. As the estimate p(w) increases, the denominator increases and the word’s influence in the weighted average falls.

The authors then assemble the weighted sentence vectors into a matrix and remove the part of each vector that projects onto the first principal component. A principal component describes a direction in the collection of vectors. The first is the direction that accounts for the most variation under principal component analysis. Subtracting each sentence’s projection onto that direction changes how differences among sentences are represented. The evaluated SIF condition includes both the frequency weighting and this removal step.

The other approach is called max pooling in the paper’s results. For each coordinate, it finds the largest value among the word vectors in a sentence. It then concatenates the vector of these maxima with the ordinary mean. The maximum at one coordinate can come from a different word than the maximum at another coordinate. The method thereby preserves evidence that some word reached a high value along a particular dimension, while retaining the mean as a summary of how the words collectively use that dimension.

Using encoders trained on sentences

The authors also evaluate LASER and multilingual Universal Sentence Encoder, abbreviated USE. Each supplies a representation at the sentence level, so neither requires the experiment’s word pooling procedures. LASER learns through translation from a source sentence into two target languages. The version available to the public supports 93 languages and was trained on a parallel corpus containing 223 million sentences. The authors use the official release and pass the Polish sentences through it.

USE has a transformer architecture and uses a mixture of supervised and self-supervised training objectives. The authors select the multilingual large configuration available from TensorFlow Hub. It supports 16 languages, including Polish. Both LASER and USE can produce a vector for a Polish sentence directly, with different training procedures behind their outputs. Their scores in this study represent the performance of those particular public configurations.

Training predictors from the representations

The evaluation adapts SentEval to Polish data and representations. To tackle the classification tasks, the authors train a neural network consisting of one 50-unit hidden layer and a softmax output layer over 10 epochs. The hidden layer transforms the input before prediction. Softmax converts the output values into probabilities across the task’s classes. The learned classifier can therefore use combinations of coordinates when deciding which class best matches the input. Its performance measures how much task-relevant information the representation makes available to that prediction procedure.

Relatedness uses a different setup because the target is a graded judgment about a pair. The authors transform the continuous target score into a probability distribution over relatedness values. To construct the network input, they take the difference between the two sentence vectors and concatenate it with their dot product. The difference gives a separate comparison for each coordinate. The dot product gives a scalar summary of how the vectors align. The paper reports Pearson correlation between the resulting predicted scores and the original scores.

In the main comparison, each method uses its default sentence representation under this setup. The follow-up pooling experiment keeps the static word vectors at 300 dimensions and changes how they are combined. Another experiment trains static word vectors of 100, 300, 500 and 800 dimensions and repeats the pooling comparisons. The authors release the adapted evaluation code, the new datasets and their pretrained Polish versions of Word2Vec, GloVe, FastText and ELMo.

Experiments and results

How to read the scores

The main comparison covers WCCRS Hotels, WCCRS Medicine, SICK-E and 8TAGS as classification tasks. The accuracy for each reports how often the predicted class matches the recorded label. The values in the paper’s classification tables are on a percentage scale. SICK-R is evaluated through Pearson correlation. That metric measures the strength of the linear association between predicted relatedness scores and the recorded judgments. Its decimals describe a relationship across scores, so they answer a different question from the accuracy figures.

The reported comparisons provide several reference points. The random vectors show what the downstream procedure can obtain from arbitrary word representations. The averaged static vectors show what changes when the word representations carry learned information from Polish text. The contextual systems and the multilingual sentence encoders then give competing ways of obtaining richer input. The scores below are the paper’s reported task results. The comparison tables give the task and metric for each column, with no separate split designation attached to the scores.

Sentiment in hotel and medical reviews

For WCCRS Hotels, ELMo using all layers gives the highest accuracy, 85.52. The top-layer variant gives 83.20. LASER reaches 81.21 and Flair reaches 80.82. FastText, the strongest static approach on this task under default averaging, reaches 80.31. Together these results place several ways of constructing a sentence vector in a fairly narrow range below ELMo. They also show that a static representation learned from Polish text can be a demanding reference for a multilingual sentence encoder on hotel sentiment.

Within the static group, GloVe gives 80.05 on the hotel task and Word2Vec gives 78.19. The multilingual USE result is 79.47, between those two scores. Multilingual BERT gives 76.83. The random baseline gives 65.83. A classifier can therefore recover some useful signal even from the arbitrary vector assignments. The stronger scores with trained vectors show the value of the tested representations under the same task setup, with the contextual ELMo features giving the strongest result for this review domain.

WCCRS Medicine produces a somewhat different ranking. ELMo with all layers still leads, with 78.42 accuracy. ELMo using the top layer and LASER both reach 78.17. Flair reaches 75.46 and USE reaches 73.78. The near agreement among the leading results makes the performance on medical reviews a more closely grouped comparison than the hotel results. In both domains, LASER scores above USE, so the relative standing of the two multilingual sentence encoders is consistent across these particular sentiment tasks.

The best static result on medical sentiment comes from Word2Vec at 73.23, followed by FastText at 72.64. GloVe and multilingual BERT both give 72.54. The random baseline gives 60.64. FastText’s lead among the static approaches on Hotels thus does not carry over to Medicine. The two tasks share the same sentiment label set, and the ranking changes with the domain. For a reader selecting a baseline, the results give a direct reason to examine review sources separately even when their labels have the same names.

Topic classification from article text

On 8TAGS, the ELMo variants tie at 71.41 accuracy. Word2Vec gives 70.27 with the default mean. USE gives 69.92, and GloVe gives 69.78. These results put a sentence encoding method and two static word-vector approaches close to the strongest contextual scores. The tag prediction task therefore provides a case where access to a more elaborate representation yields a modest lead over the best default word-vector average.

Default representations on 8TAGS topic classification accuracy

Both ELMo variants share the highest accuracy, with Word2Vec close behind.

Default representations on 8TAGS topic classification accuracyELMo, all layers (this paper): 71.41ELMo, all layers (this paper)71.41ELMo, top layer: 71.41ELMo, top layer71.41Word2Vec: 70.27Word2Vec70.27USE: 69.92USE69.92GloVe: 69.78GloVe69.78FastText: 69.24FastText69.24Flair: 65.62Flair65.62Multilingual BERT: 65.05Multilingual BERT65.05LASER: 64.91LASER64.91Random word vectors: 31.95Random word vectors31.95
The numbers
System or settingaccuracy %
ELMo, all layers (this paper)71.41
ELMo, top layer71.41
Word2Vec70.27
USE69.92
GloVe69.78
FastText69.24
Flair65.62
Multilingual BERT65.05
LASER64.91
Random word vectors31.95

The comparison between the multilingual sentence encoders reverses the sentiment ranking. USE reaches 69.92 on 8TAGS and LASER reaches 64.91. Flair and multilingual BERT also finish below the default averages of the Polish static embeddings. For a label attached to an article and inherited by its headline or description, a vector that retains domain vocabulary may already give the classifier much of what it needs. That is one explanation consistent with the strengths of the static baselines. The task scores give the ordering, while the contribution of particular words remains unmeasured.

The random score on 8TAGS is 31.95. This establishes the result of the arbitrary-word-vector baseline for the topic data. The jump in performance with learned representations is visible across the methods the authors compare. The strongest competitors near the top use different routes to a sentence vector, which makes 8TAGS particularly helpful for seeing what the choice of a baseline changes. The most informative comparison is with a trained word-vector average as well as with random word vectors.

Inference and relatedness on translated SICK

For SICK-E, LASER gives 82.21 accuracy and USE gives 82.14. Their results are close and put both encoders ahead of the contextual and static word-based methods under default pooling. Flair leads the contextual group at 78.43, followed by ELMo with all layers at 77.15. Word2Vec leads the static group at 75.42, with FastText at 75.19. The rankings for entailment differ from the rankings on single-sentence classification, even though the comparison still starts from the same families of representations.

Default representations on Polish SICK-E entailment accuracy

The multilingual sentence encoders lead, and Flair has the highest accuracy among the contextual word-based approaches.

Default representations on Polish SICK-E entailment accuracyLASER (this paper): 82.21LASER (this paper)82.21USE: 82.14USE82.14Flair: 78.43Flair78.43ELMo, all layers: 77.15ELMo, all layers77.15Word2Vec: 75.42Word2Vec75.42FastText: 75.19FastText75.19ELMo, top layer: 74.05ELMo, top layer74.05Multilingual BERT: 73.83Multilingual BERT73.83GloVe: 73.81GloVe73.81Random word vectors: 72.77Random word vectors72.77
The numbers
System or settingaccuracy %
LASER (this paper)82.21
USE82.14
Flair78.43
ELMo, all layers77.15
Word2Vec75.42
FastText75.19
ELMo, top layer74.05
Multilingual BERT73.83
GloVe73.81
Random word vectors72.77

The random baseline’s 72.77 accuracy on SICK-E is relatively close to some of the default word-based results. This is a reminder that random word vectors and random predictions are different baselines. A learned classifier operating on word-derived inputs can exploit regularities in the evaluation data even when the geometry of the individual word vectors was assigned at random. The experiment establishes the resulting score. It leaves open which properties of the text and which label patterns account for it.

The multilingual encoders also lead on SICK-R. USE achieves 0.833 Pearson correlation and LASER achieves 0.825. The strongest contextual result is 0.789 from ELMo using all layers. GloVe and top-layer ELMo each reach 0.756. The other static values are 0.746 for Word2Vec and 0.729 for FastText. Flair gives 0.743, multilingual BERT gives 0.698, and the random baseline gives 0.628. These scores assess how predicted degrees of relatedness vary with the original judgments.

The two SICK tasks share a source of sentence pairs, but their strongest word-based methods differ. Flair’s lead within the contextual group on entailment goes to ELMo with all layers on relatedness. Among the static approaches, Word2Vec leads on entailment and GloVe on relatedness. Even the two multilingual sentence encoders reverse their order, with LASER ahead for entailment and USE ahead for relatedness. That is a useful distinction for a reader interested specifically in graded resemblance or specifically in a directional inference label.

What the default comparison establishes

ELMo’s principal strength in the main results is its performance on the single-sentence classification tasks. Its all-layer version leads on both sentiment domains and shares the top score on 8TAGS with top-layer ELMo. The sentence encoders’ principal strength is their performance on the paired-sentence tasks. This distribution of results makes the benchmark more informative than an overall winner would be. The choice of a representation depends on which prediction the downstream system needs to make.

Multilingual BERT is weaker than the authors expected. Its scores lie below the best static approach on each task, and its medical sentiment score ties GloVe. This result is specific to the multilingual release and the evaluation procedure. The static methods were learned from Polish text and the authors evaluate their averaged vectors directly. A reader can conclude that the tested contextual BERT setup offers no improvement over the strongest default static baseline on these tasks. Explaining the result requires further comparisons, including ones that hold the training conditions closer together.

The static systems themselves are competitive without giving a single consistent winner. Word2Vec leads the default static group for medicine, entailment and topics. FastText leads that group for hotel sentiment, and GloVe leads it for relatedness. Those relative positions justify carrying all three methods into the pooling experiments. If the apparent winner can change with the task even under the same aggregation, then comparison with a single default word-vector approach can leave open how strong that family of representations could be.

What the ablations show

Using all of ELMo’s layers

The ELMo comparison changes which hidden states enter the representation of each word. Both settings draw on the same architecture and apply average pooling afterward. The top-layer setting draws on the final contextual state. The all-layer setting appends the lower states, including the initial word representation from characters. This gives the predictor access to information at different stages of processing. It also enlarges the input, so the comparison evaluates the combined consequences of adding those layer outputs.

The all-layer setting improves hotel sentiment from 83.20 to 85.52 accuracy and medical sentiment from 78.17 to 78.42. Entailment accuracy rises from 74.05 to 77.15. The relatedness correlation rises from 0.756 to 0.789. On 8TAGS, each version reaches 71.41. In the tested configuration, information supplied by the lower layers is helpful across several tasks, while the topic result is unchanged. The experiment gives a practical comparison of the two extraction choices. It leaves the individual contributions of particular layers open.

The pattern also qualifies what can be inferred from ELMo’s standing in the main comparison. Its lead in hotel sentiment depends in part on the choice to expose all the layers. On 8TAGS, the same choice brings no measured advantage over the top layer. A task can therefore be comparatively forgiving about which contextual features it receives even when another task, using the same sentence pooling, benefits from a richer input. The paper tests these choices directly instead of treating the final state as the only natural representation.

Changing the pool while holding word-vector size fixed

The static comparison tests mean pooling, SIF, and the combination of mean and maximum. The source word vectors have 300 dimensions in each setting. This keeps word-vector dimensionality fixed within each embedding family and moves the experimental change to sentence construction. SIF combines changes in word weighting with common-component removal. The mean-plus-max setting keeps the mean and appends more features. Each is a comparison of a complete pooling configuration against ordinary averaging.

SIF produces modest gains in some places and losses in others. With Word2Vec, it raises 8TAGS accuracy from 70.27 to 71.32 but lowers medical sentiment accuracy from 73.23 to 70.37. With GloVe, it changes the relatedness correlation from 0.756 to 0.758 and hotel sentiment accuracy from 80.05 to 80.24. For FastText on SICK-E, accuracy falls from 75.19 to 65.39. This last comparison is a pronounced drop within an otherwise mixed set of changes and is particularly relevant when assessing how much a reweighting procedure can alter the results for a given embedding.

The SIF results vary with the underlying word vectors even within a single task. For SICK-R, the small improvement with GloVe accompanies declines from 0.746 to 0.729 for Word2Vec and from 0.729 to 0.721 for FastText. For 8TAGS, each SIF variant gives a higher accuracy than its own averaging baseline, though the clearest gain is with Word2Vec. The evidence supports a task- and embedding-dependent effect. It does not tell which of the weighting and component-removal steps is responsible for any given score change.

Combining mean and maximum produces a more consistent result on the SICK tasks. On entailment, it takes Word2Vec from 75.42 to 79.47 accuracy, GloVe from 73.81 to 77.56, and FastText from 75.19 to 78.50. For relatedness it also improves each of the three underlying embeddings. The strongest of the tested static relatedness configurations at 300 dimensions is Word2Vec with mean and max, at 0.792 Pearson correlation. The repeatability across different sources of word vectors is the clearest evidence for this pooling choice in the fixed-size experiment.

Static pooling methods at 300 word dimensions on Polish SICK-R Pearson correlation

Appending maxima to the mean improves relatedness correlation for every static embedding tested.

Static pooling methods at 300 word dimensions on Polish SICK-R Pearson correlationWord2Vec, mean: 0.746Word2Vec, mean0.746Word2Vec, SIF: 0.729Word2Vec, SIF0.729Word2Vec, mean and max (this paper): 0.792Word2Vec, mean and max (this paper)0.792GloVe, mean: 0.756GloVe, mean0.756GloVe, SIF: 0.758GloVe, SIF0.758GloVe, mean and max: 0.786GloVe, mean and max0.786FastText, mean: 0.729FastText, mean0.729FastText, SIF: 0.721FastText, SIF0.721FastText, mean and max: 0.785FastText, mean and max0.785
The numbers
System or settingPearson correlation
Word2Vec, mean0.746
Word2Vec, SIF0.729
Word2Vec, mean and max (this paper)0.792
GloVe, mean0.756
GloVe, SIF0.758
GloVe, mean and max0.786
FastText, mean0.729
FastText, SIF0.721
FastText, mean and max0.785

The benefits of appending maxima are less consistent on the other tasks. Word2Vec reaches 79.86 on hotel sentiment with mean and max, up from 78.19 with averaging. GloVe moves from 80.05 to 78.25, and FastText from 80.31 to 80.18. On 8TAGS, each mean-plus-max configuration scores below its own averaging baseline. Coordinate-wise peaks can provide accessible information for comparing two sentences, as the SICK results suggest. The results for sentiment and topics show that keeping these peaks need not improve classification of individual sentences.

Part of the interpretation concerns what remains available after pooling. An average captures how a coordinate behaves across all words. A maximum gives a direct indication that some word reached a high value, which can help a predictor use a feature that was less prominent in the average. The experiment establishes the advantage of exposing both views to the predictor for SICK. Since the combined vector also contains more coordinates, it gives limited evidence about whether the improvement comes specifically from the maxima or from the larger amount of information made available to the downstream network.

Changing the size of the word vectors

The authors also train static embeddings at 100, 300, 500 and 800 dimensions and compare the pooling procedures at those sizes. This change acts before aggregation. A larger set of coordinates allows the word representation to preserve more distinctions, which can in turn affect what the downstream average or maximum retains. The paper reports that increasing vector size can improve the baseline results. The largest word-vector averages approach ELMo on entailment, relatedness and topic classification, and exceed the multilingual encoders on hotel sentiment and 8TAGS.

The dimensionality experiment also traces how the benefit of pooling depends on the size of its inputs. The authors find a clearer advantage for mean and max on SICK at smaller dimensions. The advantage diminishes at higher dimensions, though the combination remains competitive with the multilingual sentence encoders. Their discussion places the best static configuration with max pooling just 1% below the multilingual encoders on SICK. The detailed comparisons at 300 dimensions give the corresponding exact scores task by task. The broader trend comes from the sweep across sizes.

Across that sweep, SIF again gives no consistent improvement. This matters because it shows that the mixed fixed-size results are part of a broader pattern observed in the paper. By comparison, the consistency of mean plus max across the two SICK targets survives the change in dimensionality, with a smaller apparent contribution at the upper end. The authors’ case for a strong static baseline rests on the interaction of these settings. Its strength depends both on giving the original word vectors enough capacity and on selecting a pooling rule appropriate to the target.

These controlled comparisons also show why it matters to identify the precise baseline when reading the headline sentence-encoder results. The results for LASER and USE on SICK are clear against the default mean-pooled static representations. A word-based system using larger vectors and an expanded pooling procedure presents a closer comparison. The evaluated configurations thus answer different questions about static embeddings: how competitive the ordinary average is at the main size, what can be gained by changing its sentence features, and how far the performance moves when the word representations themselves become larger.

Limitations

Qualifications the authors identify

The authors frame the evaluation around limited Polish resources. The available sentence-level data yield a suite with topic classification, two review domains and two prediction targets derived from one translated collection. That is a broader basis for comparison than any of those tasks alone. Its scope remains the Polish texts and label definitions in those datasets. The conclusions are strongest for prediction under those conditions, where the paper has direct comparisons among the representations.

The translation procedure required judgment when an English distinction disappeared in Polish. The authors explain how they modify some pairs so that both their meaning and their syntactic contrast are retained. The resulting benchmark retains the intended relationships of SICK, with local adaptations to keep some pairs informative in Polish. For a cross-language comparison, those choices matter because a Polish sentence pair can realize a relationship through different wording or structure. The paper identifies the translation problem and describes its response at the level of the data preparation procedure.

The authors also qualify several findings by task. They regard SIF as having uncertain benefit for the tested Polish applications. They describe the multilingual sentence encoders as strongest on the SICK tasks while noting their changing order between sentiment and topic prediction. They suggest that a sequential predictor built on ELMo could further improve classification. That is a proposed architecture based on the strong results from averaged contextual features. The measured results come from the predictor and pooling setup actually evaluated.

The study distinguishes the computational character of table-based word embeddings from contextual representations, which require running a pretrained neural network to obtain hidden states. The authors regard averaged static embeddings as strong in view of that difference. Their results are predictive scores, so the practical tradeoff between accuracy and computation remains qualitative in this comparison. The reported vector sizes and forms of pooling give some of the relevant configuration details. A comparison of runtime or resource use would answer a separate question.

Limits of the experimental setup

The main comparison tests complete configurations that differ along several axes. The static embeddings and ELMo were trained by the authors on their Polish corpus. Other systems came from public releases, with their own objectives, training data and architectures. Contrasts such as Polish ELMo against multilingual BERT therefore measure the results of those packages as used here. They cannot isolate the effect of multilingual training. The paper’s suggestion that multilingualism may have a cost for the tested BERT setup is an interpretation of the ranking, rather than a controlled estimate of such a cost.

There is a similar issue with attributing the SICK lead to how the sentence encoders were trained. LASER and USE take sentences as inputs and learn representations by objectives different from those of the static and contextual word systems. Their default results support choosing them for these pair tasks under the paper’s evaluation. Establishing whether a sentence-level objective itself accounts for the advantage would require controlling other factors that also differ between the systems. The narrowing gap with stronger static baselines shows that pooling and dimensionality also matter to that comparison.

Every measured score depends on the downstream predictor and the features it receives. For classification, the predictor has a single hidden layer and a specified training duration. For relatedness, the representation of a pair includes a vector difference and dot product. These choices determine which relationships are easy for the predictor to use. A high score shows that task-relevant information can be recovered in this setup. A lower score leaves open how the same pretrained representation would perform under a different extraction procedure, a different pair construction or end-to-end fine-tuning.

The aggregate metrics leave finer distinctions open. Accuracy combines correct predictions across the classes, so the results cannot show which sentiment judgments or topic tags contributed most to a method’s lead. Pearson correlation captures how the relatedness scores vary together and leaves questions about the absolute size of individual errors open. The tables provide point scores rather than estimates of variation over reruns. Close values such as 82.21 and 82.14 on SICK-E establish the observed ordering, with the stability of that ordering left unmeasured.

The datasets also constrain what a successful prediction means. An 8TAGS label comes from a tag attached to article material, and the selection favors sentences that fit a single selected category and pass the length filter. Its accuracy reflects those choices. Performance on short, ambiguous or multiply tagged material remains open. In WCCRS, the sentence-level evaluation covers hotels and medical services. The results speak to those two domains. Product reviews and education have document-level annotation in the corpus and fall outside this sentence evaluation.

Finally, the two SICK scores are separate views of the same source of sentence pairs. They show that the tested encoders do well when predicting both a categorical inference and a graded relationship on that material. Their agreement is evidence across targets within SICK. Generalization to sentence-pair data gathered independently in Polish remains open. This matters particularly when interpreting the mean-plus-max findings, which are strongest on the two tasks that share this collection. The experiment establishes a consistent benefit across embeddings and targets there, with the breadth of that benefit beyond SICK still to be determined.

What came after

A multilingual embedding benchmark

MMTEB: Massive Multilingual Text Embedding Benchmark (2025) cites the Polish evaluation and takes up embedding evaluation at a multilingual scale. The earlier study asks how representations with different training histories, including multilingual ones, perform when the language and tasks are made explicit. MMTEB’s scope carries that benchmarking question across languages. It treats multilingual text embeddings as a subject of evaluation in their own right, extending the scale of the comparison beyond a study centered on a single language.

That relationship is clearest at the level of the evaluation question. The Polish study demonstrated that access to a Polish sentence vector from a multilingual release is only the starting point for assessment. Measured performance changes with the prediction target and with the competing representations. A multilingual benchmark addresses that general problem at a broader scope. The citation places the earlier evaluation in this line of work. Specific reuse of its datasets, pooling tests or classifier is unconfirmed.

A benchmark centered on Polish

PL-MTEB: Polish Massive Text Embedding Benchmark (2026) also cites the study and retains Polish as the focus of the benchmark. The earlier work made Polish sentence-level evaluation possible across several tasks by combining a translated benchmark, a topic dataset collected from Polish material, and existing review annotations. PL-MTEB continues the Polish benchmarking direction at the level of text embeddings. The citation identifies a connection between that later benchmark and the earlier effort to make representation quality measurable on Polish data.

The two later works extend different aspects of the original question. MMTEB places the emphasis on multilingual coverage. PL-MTEB places it on benchmark coverage within Polish. In the original study, these concerns meet when a multilingual encoder is judged alongside Polish-specific word and contextual representations on the same tasks. The observed rankings make language support, task choice and baseline strength distinct parts of that evaluation. The later benchmark titles show the change in scope, while the citations establish the connection to the Polish sentence-representation study.

Cite

Cite as Slawomir Dadas, Michał Perełkiewicz and Rafał Poświata. 2020. Evaluation of Sentence Representations in Polish. Proceedings of the Twelfth Language Resources and Evaluation Conference.

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

@inproceedings{dadas2020evaluation,
  title = {{Evaluation of Sentence Representations in Polish}},
  author = {Slawomir Dadas, Michał Perełkiewicz and Rafał Poświata},
  booktitle = {Proceedings of the Twelfth Language Resources and Evaluation Conference},
  year = {2020},
  url = {https://aclanthology.org/2020.lrec-1.207/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/dadas-2020-evaluation-sentence-representations-polish/