---
title: "Portuguese Word Embeddings — paper by Hartmann et al. (2017)"
description: "Hartmann and colleagues compare Portuguese word embeddings on analogies, grammatical tagging, and sentence similarity, finding…"
canonical: "https://research.elamur.ai/free/en/papers/hartmann-2017-portuguese-word-embeddings-evaluating-word/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/hartmann-2017-portuguese-word-embeddings-evaluating-word/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2017](https://md.research.elamur.ai/free/en/papers/2017/) / Portuguese Word Embeddings: Evaluating on Word Analogies and Natural Language Tasks

# Portuguese Word Embeddings: Evaluating on Word Analogies and Natural Language Tasks

Paper · 2017 · Nathan Hartmann, Erick Fonseca, Christopher Shulby et al.

**Authors:** Nathan Hartmann, [Erick Fonseca](https://md.research.elamur.ai/free/en/authors/erick-fonseca/), Christopher Shulby, [Marcos Treviso](https://md.research.elamur.ai/free/en/authors/marcos-treviso/), Jéssica Silva and [Sandra Aluísio](https://md.research.elamur.ai/free/en/authors/sandra-aluisio/) · **Year:** 2017 · **Venue:** Proceedings of the 11th Brazilian Symposium in Information and Human Language Technology · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 11th Brazilian Symposium in Information and Human Language Technology · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/W17-6615/)
- [PDF](https://aclanthology.org/W17-6615.pdf)

## Summary

A word representation can solve a vocabulary puzzle and still be a poor choice for a system that reads sentences. Hartmann and colleagues test this possibility by training [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/), vectors of numbers that represent words based on the contexts in which they appear. The authors want to know whether a quick test of those vectors can tell a researcher which ones to use in an application. For Portuguese, that means assembling enough text to train several kinds of vectors and evaluating them on benchmarks that cover Brazilian and European usage.

The authors train 31 sets of embeddings on a collection of 1,395,926,282 tokens drawn from sources that include news, subtitles, an encyclopedia, and literary writing. They compare FastText, GloVe, Wang2Vec, and Word2Vec at several vector sizes. Their first evaluation asks the vectors to complete analogies, such as recovering the capital of a country or supplying an inflected form. They then put the same representations into systems that assign grammatical labels to words and rate how close sentence pairs are in meaning. The tasks are paired deliberately. Analogies about grammatical forms are compared with [part-of-speech tagging](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/), and analogies about meaning are compared with sentence-level [semantic similarity](https://md.research.elamur.ai/free/en/concepts/semantic-similarity/).

The rankings change across those tests. GloVe leads on the combined analogy benchmark for both Portuguese variants and on its semantic portion, while FastText reaches the highest scores on the syntactic portion. Wang2Vec provides the highest reported part-of-speech accuracy on revised Mac-Morpho, 95.94%, and its Skip-Gram vectors reach a Pearson correlation of 0.60 on the Brazilian ASSIN sentence-similarity test. The European ASSIN results give a more qualified picture. Wang2Vec Skip-Gram at 600 dimensions matches the earlier baseline’s reported mean squared error of 0.83, while its correlation of 0.54 is below the baseline’s 0.55.

The paper makes the embeddings and the scripts for preparing the corpus and running the evaluations publicly available. The authors favor Wang2Vec for its performance across tasks and view 300 dimensions as a practical tradeoff given the memory cost of larger vectors. Some individual scores still improve above that size. The broader finding concerns how to choose embeddings. An analogy benchmark can show that a particular relationship is recoverable from the geometry of the vectors. The tagging and similarity experiments show how much that kind of success tells a practitioner about these particular uses.

## Deep dive: Portuguese Word Embeddings: Evaluating on Word Analogies and Natural Language Tasks

Hartmann and colleagues compare Portuguese word embeddings on analogies, grammatical tagging, and sentence similarity, finding different winners. · about 34 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### What a word vector needs to preserve

A system that processes a sentence needs some way to represent its words before it can assign a grammatical label or compare the sentence with another. A word embedding gives each vocabulary entry a position in a space with many dimensions. A position is written as a list of real numbers. The hope is that patterns of use in a large body of text will leave useful regularities in the space. Training the vectors requires running text, while an application can later bring its own examples annotated for the task it needs to perform. This makes word vectors a reusable input to [natural language processing](https://md.research.elamur.ai/free/en/concepts/natural-language-processing/).

The value of that input depends on which regularities it preserves. A tagger must tell which grammatical role a word plays in its current context. A method that compares sentences must find evidence about what they mean. Word forms, neighboring expressions, and patterns of use can supply evidence for both, with different demands on the representation. The paper treats syntax, meaning, and the structure of words as related but distinguishable sources of information. The study’s tests ask how far evidence about any of them carries from a simple diagnostic into a full task.

The paper places its embedding methods in a tradition that includes work by Bengio and by Collobert and their colleagues. It uses a broad distinction, drawn from the comparison by Baroni and colleagues, between methods that work from a matrix of word co-occurrences and methods that learn by predicting words from local context. A co-occurrence matrix organizes evidence about which words tend to appear near which others. A predictive method turns nearby words into inputs or answers in a learning problem. Both can use the same running text, even though they pose different problems to the learner and give it different opportunities to record regularities. [Baroni and colleagues’ comparison](https://md.research.elamur.ai/free/en/papers/baroni-2014-don-t-count-predict-systematic/)

Latent Semantic Analysis and Hyperspace Analogue to Language appear in the paper as examples of the matrix tradition. [GloVe](https://md.research.elamur.ai/free/en/concepts/glove/) belongs to the same broad family and gives the study an example built around global co-occurrence information. Word2Vec is the principal predictive comparison. Its architectures ask either which word belongs in the middle of a context or which neighboring words are likely around a given center word. The remaining approaches let the study examine two other choices, preserving the order of nearby words and giving words components based on their spelling. These choices matter for what information is available at training time and how the learner can use it.

#### What an analogy can test

The paper describes word analogies as a common kind of intrinsic evaluation, meaning a test that works directly with the vectors. An analogy gives the system a completed pair and the opening word of another pair. The task is to supply the missing word so that the relationship in the completed pair also holds in the new pair. In a geographical analogy, a country and its capital establish the relationship. In a test about verb forms, one pair might establish the relationship between a verb in the present and the same verb in the past. The representation is tested by asking whether an operation on the known vectors puts the result near the vector of the intended answer. [Word2Vec](https://md.research.elamur.ai/free/en/papers/mikolov-2013-efficient-estimation-word-representations-vector/)

This is an economical way to ask a specific question about the geometry of a vocabulary. The evaluator can use established answers, and the procedure requires no tagger or sentence-scoring system. In the paper’s account of earlier work, intrinsic evaluation also includes comparing vector-based word similarities with word-similarity judgments, as in WS-353. Analogy completion has a different focus from a direct word-pair similarity test. The analogy requires a relationship to transfer across pairs. A pairwise similarity judgment concerns the relationship between the words in that pair.

An extrinsic evaluation measures what happens when the vectors are put to work in a larger procedure. The paper mentions tagging, parsing, sentiment analysis, and comparing sentences as examples. Each adds decisions that the intrinsic test does without. A tagger decides which grammatical label applies at each position in a sentence. A sentence comparison system has to combine the information attached to individual words before it can return a score for a pair. Differences between vector sets can matter at any stage where the surrounding procedure relies on them.

The case for testing embeddings inside applications was already part of the research discussion. The paper takes up the concern that the convenience of a word-level test can encourage researchers to give its result more weight than it warrants. An analogy shows success at recovering a specific word through a specified relation. The practical question is whether settings that succeed at that operation also help with particular decisions in running text. The authors design their experiment so that a comparison of those outcomes is possible. [Faruqui and colleagues on embedding evaluation](https://md.research.elamur.ai/free/en/papers/faruqui-2016-problems-evaluation-word-embeddings-word/)

#### Why Portuguese makes the comparison concrete

Rodrigues and colleagues had already collected Portuguese text for training Skip-Gram vectors and adapted the Word2Vec analogy material. Their benchmark supplied separate Brazilian and European versions. This gave Hartmann and colleagues an existing set of questions and an opportunity to check a common training resource against both versions. The previous study also supplied part of the material that went into the new training collection. As a consequence, the present comparison extends an existing Portuguese evaluation instead of choosing its own relations to suit the representations under study.

The paper recounts an earlier comparison by Sousa that used Portuguese Wikipedia articles selected around educational subjects and institutions. That study compared GloVe with the two Word2Vec architectures on the Portuguese analogies. It also describes the work of Fonseca and colleagues, who used a neural tagger to compare Word2Vec Skip-Gram, Hyperspace Analogue to Language, and the method of Collobert and colleagues. These studies give examples of choosing vectors through different kinds of evidence. The corpus, selection of embedding techniques, and evaluation procedure together define what each of those comparisons can tell a reader. [Collobert and colleagues’ neural approach](https://md.research.elamur.ai/free/en/papers/collobert-2011-natural-language-processing-almost-scratch/)

A separate question was whether to train on Brazilian and European text together. The paper draws on earlier Portuguese work associating larger corpora with better embeddings, including a tagging study that compared Brazilian-only, European-only, and mixed training material. The authors take that work as grounds for assembling a single large corpus across variants. They also seek variety in what people write about and how they write. An encyclopedia, a news story, and a subtitle supply different contexts, even when they contain the same words.

The organizing idea is to match each kind of analogy with an application that seems to call on related knowledge. The benchmark’s syntactic group includes operations on inflected forms and suffixes. The tagger also has a reason to exploit these cues, alongside the words surrounding the item it is labeling. The semantic questions use relations such as country and capital or kinship. Sentence similarity likewise involves meaning, although its output depends on what the words express in combination. These parallels make the proposed comparison plausible. The experiment tests how far the parallels extend.

### The method, step by step

#### From source collections to a shared vocabulary

The authors begin by bringing together Portuguese text from several genres. The largest component is LX-Corpus, much of it European Portuguese. It contributes 714,286,638 tokens in the corpus table after the changes made for this study. A separate Wikipedia collection contributes 219,293,003 tokens, and GoogleNews accounts for 160,396,456. SubIMDB-PT contributes 129,975,149 tokens from subtitles. The subtitles provide dialogue-like material alongside the written registers represented in news and encyclopedic prose.

Brazilian news from G1 contributes 105,341,070 tokens, while PLN-Br contributes 31,196,395. The collection also includes public-domain literature with 23,750,521 tokens and Lacio-web with 8,962,718. Lacio-web itself covers several genres, including literary, scientific, and legal material. Smaller sources include Brazilian Portuguese fiction, science writing for children, textbooks, and questions used in school assessment. The corpus table reports 1,395,926,282 tokens overall and 3,827,725 types. A token is an occurrence in the text. A type is a distinct entry, so a word that recurs contributes to the token count each time it appears.

The choice to pool the material serves both scale and variety. The resulting training collection brings different spellings, vocabulary, and usage contexts into the same learning problem. The benchmark can then test the shared representation against questions or sentences identified with either Portuguese variant. The authors also adapt LX-Corpus to their own preparation procedure. They remove its Wikipedia section and revise how it is split into tokens. The paper gives 1,723,693,241 tokens as the earlier LX-Corpus count and 714,286,638 for the component retained in this work. Those figures describe the corpus before and after the changes as a whole.

#### How the text is prepared

The authors use [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/) to decide which strings receive separate entries and normalization to consolidate some kinds of strings. Whitespace and punctuation guide token boundaries. Hyphens need additional care because in Portuguese they can join a verb to a clitic pronoun. A clitic depends on a neighboring word for its written or spoken attachment. The study keeps a form such as `machucou-se` intact. The combined string can therefore receive its own single vector. That decision also determines what counts as a vocabulary match if a downstream corpus separates the verb and pronoun.

The preparation procedure maps web addresses to `URL` and email addresses to `EMAIL`. It replaces numerals with zeros, so different digit values can share a normalized representation. It also maps types with fewer than five occurrences to `UNKNOWN`. The resulting unknown entry can be learned from contexts that would otherwise be distributed among several rare forms. The authors adopt these transformations on the premise that a smaller vocabulary can yield better-supported vectors for the entries it retains.

To reduce noisy material, they keep only sentences with 5 or more tokens across the component corpora. This is a decision about which token sequences are available for learning, as distinct from the decision to collapse rare words. Sentence filtering removes the whole short sequence from the training material. A vocabulary mapping still lets a retained sentence contribute its contexts, with the affected item represented by a shared symbol. Both decisions affect the text seen by all the embedding methods.

From Portuguese text to embedding evaluation The steps in order.

#### What the training methods learn

GloVe begins with a matrix that summarizes co-occurrence information from word neighborhoods. A cell concerns a particular pair of entries. Training fits vector interactions and bias terms to the logarithm of the co-occurrence quantity described in the paper. The authors write this relation as follows, with a dot to make the vector product explicit.

```
P(wᵢ, wⱼ) = log(Mᵢⱼ) = wᵢ · wⱼ + bᵢ + bⱼ
```

Here `i` and `j` identify the words, and `Mᵢⱼ` is the corresponding matrix entry, described by the authors in terms of the probability that those words occur near each other. `wᵢ` and `wⱼ` are their vectors, and `P(wᵢ, wⱼ)` labels the pairwise quantity fitted in the equation. `log` takes the logarithm of the matrix entry. The `·` operation multiplies corresponding vector coordinates and adds the products, giving a scalar. `bᵢ` and `bⱼ` are the respective bias terms, which are added using `+`. The equality signs express the relation that the training procedure seeks to fit. In this account, random initial vectors are adjusted using the information in the matrix. [GloVe’s training method](https://md.research.elamur.ai/free/en/papers/pennington-2014-glove-global-vectors-word-representation/)

Word2Vec uses prediction as its learning problem. Continuous Bag-of-Words, or CBOW, is given the words around a missing middle word and attempts to predict that word. Its context is a bag in the sense that the architecture combines neighboring words without attaching a distinct role to each position. The set of surrounding words can carry strong evidence about the center, even when contributions from before and after the center are pooled. Skip-Gram reverses the prediction direction. It takes the center word as input and uses it to predict surrounding words.

This arrangement creates training examples from words already present in the corpus. In CBOW, a particular occurrence supplies its surrounding words and a known answer at the center. In Skip-Gram, the occurrence supplies the center and the words around it supply the answers. The paper describes both as fast log-linear architectures, each using a single weight matrix in addition to the embeddings. The repeated prediction problems shape the vectors that will eventually be passed to the evaluators.

Wang2Vec changes how the Word2Vec architectures handle position. In Continuous Window, the context word vectors are placed end to end in the order in which their words appear. Thus an occurrence on one side of the center supplies input in a different place from an occurrence on the other side. The paper groups this architecture under CBOW in its results because the prediction still goes from the surrounding words to the center. The arrangement of the input gives that prediction access to a distinction that the ordinary bag of context words discards. [Wang2Vec’s order-aware architectures](https://md.research.elamur.ai/free/en/papers/ling-2015-two-too-simple-adaptations-word2vec/)

Structured Skip-Gram preserves the other prediction direction and attaches different parameters to different relative positions. The prediction for a neighboring word therefore depends on where the neighbor belongs around the center. Continuous Window makes order explicit in the input. Structured Skip-Gram makes position explicit through the parameters used for the predictions. Both introduce information about local order while retaining the general learning tasks that make the comparison with Word2Vec meaningful.

FastText gives each word access to vectors for pieces of its spelling. These pieces are character [n-grams](https://md.research.elamur.ai/free/en/concepts/n-gram/), sequences of adjacent characters of a chosen length. The word representation sums contributions from its character sequences, with surrounding words supplying learning evidence. Related forms can therefore draw on some common components. This is a way to exploit [morphology](https://md.research.elamur.ai/free/en/concepts/morphology/), the internal structure and variation of word forms, through spelling patterns available directly in the corpus. The experiments compare both CBOW and Skip-Gram configurations for FastText. [FastText’s subword method](https://md.research.elamur.ai/free/en/papers/bojanowski-2017-enriching-word-vectors-subword-information/)

#### How the representations are compared

The authors vary the number of coordinates in an embedding across 50, 100, 300, 600, and 1,000 dimensions. This varies the space available to represent each entry and the amount of memory required for the vectors. The design includes GloVe and the CBOW and Skip-Gram variants of the predictive approaches. Wang2Vec’s CBOW configuration is available at 50, 100, and 300 dimensions. The authors report that its implementation encountered the vanishing gradient problem at 600 and 1,000 dimensions. A gradient provides the signal used to update the trainable parameters. When that signal becomes too small, it can prevent effective training. Wang2Vec Skip-Gram remains in the comparison at the larger sizes.

The same vector sets enter the analogy evaluation directly. The benchmark specifies a relation and an expected word. The evaluator combines the vectors of the words supplied in the question, then looks for the word closest to the resulting direction. As an example, the paper applies this operation to an analogy between a king and a queen.

```
rei − homem + mulher ≈ rainha
```

Each Portuguese word in the expression stands for its vector. `rei` means king, `homem` means man, `mulher` means woman, and `rainha` means queen. The `−` operation removes the coordinates of the man vector from those of the king vector, and `+` adds the coordinates of the woman vector to the result. The `≈` sign indicates the intended retrieval outcome. The resulting vector should be close in direction to the queen vector. The paper illustrates closeness with cosine similarity, which measures how closely two vectors point in the same direction.

In the tagging experiment, the tagger learns to assign grammatical categories from labeled running text. The researchers use nlpnet with the revised Mac-Morpho corpus. They keep the tagger’s settings fixed while changing the vectors it receives. The configuration uses 20 training epochs, or passes through the tagger’s training material, 100 hidden neurons, and an initial learning rate of 0.01. The hidden neurons are the intermediate units that transform the input into evidence for a tag. The learning rate sets the scale of a training update. The tagger also receives capitalization, prefix, and suffix features, so the word vectors contribute alongside information taken directly from the form of each word.

In the experiment on sentence similarity, the researchers use ASSIN, a dataset in which each pair of sentences is rated for similarity on a 1–5 scale. The earlier system used for comparison fit a linear regressor, a procedure that learns to predict a numerical score from input features. One feature was cosine similarity between the sentences’ [TF-IDF](https://md.research.elamur.ai/free/en/concepts/tf-idf/) representations, which weight words according to their occurrence in a text and their frequency across texts. The other feature was cosine similarity between sentence vectors made by adding the embeddings of their words. Hartmann and colleagues keep the embedding feature for their comparison. Each sentence pair becomes a single cosine value for the regressor to map to a predicted score.

The two downstream procedures give the embeddings different jobs. In nlpnet, they help a trained tagger assign a label to a word whose role depends on context. In ASSIN, they are summed before the system compares the two sentences. An embedding can supply a useful cue to the tagger when it comes together with an affix or a neighboring word. In the similarity procedure, its contribution is through the direction of the sentence vector after summation. These operations matter for interpreting how each task responds to a change in vectors. The authors release the trained embeddings and make the preprocessing and evaluation scripts available in the `portuguese_word_embeddings` repository.

### Experiments and results

#### Relations between words

The analogy benchmark from Rodrigues and colleagues has Brazilian Portuguese and European Portuguese versions, called PT-BR and PT-EU in the results. Its five semantic categories include common country and capital pairs, the broader set of country and capital pairs, country and currency, city and state, and family relations. These questions range from geographical knowledge to relationships encoded in ordinary vocabulary. The evaluator uses the expected entry for each analogy to measure the percentage of successful completions. The paper reports syntactic, semantic, and combined scores separately for each variant.

The nine categories called syntactic cover adjective and adverb forms, adjective opposites, comparatives, superlatives, infinitives and present participles, country names and nationality adjectives, infinitives and past forms, noun number, and verb number. The label is broad enough to cover several relationships that concern word formation or inflection. It also includes adjective opposites, for which the change in meaning is important. The grouping makes it possible to compare with previous analogy results while giving an imperfect division between grammatical form and meaning.

At 300 dimensions the reported combined analogy scores put GloVe first in both variants. The PT-BR score is 46.7, and the PT-EU score is 46.2. FastText Skip-Gram at the same size reaches 45.4 in PT-BR and 44.8 in PT-EU. Wang2Vec CBOW reaches 45.1 and 43.5, respectively. These combined results compress important differences across the two portions of the test. An evaluator concerned with one relation family can draw a different conclusion from someone using the aggregate to select vectors.

The syntactic scores favor FastText Skip-Gram. Its 300-dimensional setting reaches 58.7 for PT-BR and 58.5 for PT-EU. At that size, Wang2Vec Skip-Gram reaches 53.3 in PT-BR and 53.4 in PT-EU. GloVe has 45.8 in PT-BR and 45.9 in PT-EU. FastText’s lead on these questions is consistent with the test’s emphasis on relationships among word forms. The combined GloVe lead should therefore be read at the level at which it is reported, across the analogy benchmark.

The semantic scores favor GloVe. At 600 dimensions it has 48.5 on the PT-BR semantic questions and 43.8 on the PT-EU ones. Wang2Vec is the stronger predictive alternative in this part of the study. Its 300-dimensional CBOW vectors reach 40.3 in PT-BR and 36.9 in PT-EU, while the FastText Skip-Gram vectors of that size reach 32.2 and 31.1. Comparing settings at a fixed size makes the difference between the architectures easier to see.

Semantic analogy accuracy on PT-BR at 300 dimensions GloVe leads the semantic comparison while order-aware Wang2Vec is the closest alternative shown.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Word2Vec CBOW | 4.6 |
| FastText CBOW | 8.4 |
| FastText Skip-Gram | 32.2 |
| Wang2Vec Structured Skip-Gram | 33.9 |
| Wang2Vec Continuous Window | 40.3 |
| GloVe (this paper) | 45.8 |

The authors illustrate an individual result with the king and queen analogy. At 600 dimensions, GloVe returns `rainha` as the nearest word, with cosine similarity 0,62. Word2Vec CBOW at the same size returns `esposa`, meaning wife, with cosine similarity 0,50, and puts `rainha` in 7th place, with similarity 0,41. The answer returned by Word2Vec has a relevant association with the words in the question. The benchmark still asks for the word that expresses the specified relation. This illustrates the difference between producing a plausible neighbor and ranking the intended answer first.

The paper also reports the context for scores from earlier Portuguese studies. Rodrigues and colleagues reported an analogy accuracy of 52.8% for their Skip-Gram embeddings on the syntactic and semantic benchmark. Sousa’s best approach, Word2Vec CBOW with 300 dimensions, reported 21.7% on the syntactic items, 17.2% on the semantic items, and 20.4% overall in that study’s setting. Those figures come from earlier training setups with their own text collections. The comparisons within Hartmann and colleagues’ study give the methods a shared prepared corpus and show which choices work better under that common condition.

#### Grammatical labels in running text

The tagging experiment measures accuracy on revised Mac-Morpho, the percentage of evaluated tokens whose predicted grammatical category matches its assigned category. Two difficulties motivate the evaluation. A word may take different categories according to the context in which it appears, and a tagger must still make a decision when it encounters a word it has never seen in its training examples. The experiment compares embedding settings within nlpnet under the fixed configuration. Accuracy describes the resulting tagger, with both the vectors and its other features available.

Wang2Vec Skip-Gram has the highest reported accuracy, 95.94% at 1,000 dimensions. It also achieves 95.89% at 300 dimensions and 95.88% at 600. At 300 dimensions, the Continuous Window version reaches 95.83%. This makes both order-aware architectures competitive at a size for which the study has results from every family. The larger comparisons retain Structured Skip-Gram and have no corresponding Continuous Window result.

The usual Word2Vec Skip-Gram configuration reaches 95.82% at 600 dimensions and 95.81% at 1,000. Word2Vec CBOW has 95.65% at 600 dimensions and 95.62% at 1,000. Wang2Vec Skip-Gram at 300 dimensions therefore scores above both Word2Vec architectures at the largest size evaluated. At 300 dimensions, the Word2Vec accuracies are 95.58% for CBOW and 95.66% for Skip-Gram. The difference between methods persists when dimensionality is held fixed.

FastText Skip-Gram and GloVe improve with size over the settings reported for the tagger, but their highest scores are lower than Wang2Vec’s. FastText Skip-Gram reaches 95.49% at 1000 dimensions as listed in the tagging table, and GloVe reaches 95.57% at 1,000. FastText CBOW reaches 94.27% at 1000 dimensions. The FastText comparison is particularly informative alongside the analogy results. FastText Skip-Gram has a clear lead on the test of syntactic and morphological relationships between words, yet the tagger gives the highest accuracy to the order-aware architecture.

The authors also flag a comparison with the earlier Mac-Morpho work under a different vocabulary preparation. They report that the tagging accuracies here are below those obtained by Fonseca and colleagues and point to clitic segmentation as a probable explanation. Keeping the joined form during embedding training can create lookup failures when the tagger expects separately tokenized components. Within the current experiment, all methods are affected by the shared preparation, and the results describe their performance under that condition.

#### Similarity between sentences

The ASSIN evaluation uses separate training and test sets for PT-BR and PT-EU. The reference values apply to pairs of sentences. Pearson correlation, written as ρ in the results, measures how strongly the predictions and reference scores vary together in a linear way. A higher value means closer agreement in that pattern of variation. Mean squared error, or MSE, averages the squared differences between predictions and references. A lower value means that the estimated scores are closer to the reference values under that error measure. These metrics give different information about how well the regressor behaves.

The baseline is the embedding-only version of the earlier ASSIN system by Hartmann. It uses Word2Vec Skip-Gram with 600 dimensions, learned from Wikipedia, G1, and PLN-Br. For PT-BR it scores 0.58 in Pearson correlation and 0.50 in MSE. For PT-EU it scores 0.55 in correlation and 0.83 in MSE. The earlier system performed better when its embedding feature and TF-IDF feature were used together. The baseline values here refer specifically to the version whose predictions are based on the embedding feature, which makes it relevant to the authors’ replacement experiment.

On the PT-BR test, Structured Skip-Gram with 1,000 dimensions has the highest reported correlation, 0.60, and an MSE of 0.49. The 600-dimensional version has a correlation of 0.59 and the same reported MSE of 0.49. At 300 dimensions it reaches 0.58 and 0.50, matching the baseline values as reported. Word2Vec CBOW, trained in this study with 1,000 dimensions, also reaches 0.58 and 0.50. Those results put the larger Wang2Vec Skip-Gram settings ahead of the baseline on this test, with the two metrics agreeing on the improvement and MSE shared across the two larger sizes.

Pearson correlation on the ASSIN PT-BR sentence-similarity test The larger Structured Skip-Gram settings have the highest reported correlations among the displayed comparisons.

**The numbers**

| System or setting | Pearson correlation |
| --- | --- |
| GloVe 1,000 dimensions | 0.51 |
| FastText Skip-Gram 300 dimensions | 0.55 |
| Earlier Word2Vec Skip-Gram baseline | 0.58 |
| Wang2Vec Structured Skip-Gram 300 dimensions | 0.58 |
| Wang2Vec Structured Skip-Gram 600 dimensions | 0.59 |
| Wang2Vec Structured Skip-Gram 1,000 dimensions (this paper) | 0.60 |

On the PT-EU test, the authors identify 600-dimensional Wang2Vec Skip-Gram as their best configuration. It has an MSE of 0.83 and a correlation of 0.54. At 1,000 dimensions it still scores 0.54 in correlation, with an MSE of 0.85. The earlier baseline has a correlation of 0.55, also reached by the newly trained Word2Vec CBOW at 600 and 1,000 dimensions. Those CBOW settings each have an MSE of 0.86. The results thus support the authors’ preference for Wang2Vec at 600 dimensions on European sentence similarity when judging by squared error. The correlation column favors the baseline and these Word2Vec CBOW settings.

GloVe and FastText stay below the earlier embedding-only baseline overall on both ASSIN variants. On the Brazilian test, GloVe at 1,000 dimensions reports 0.51 correlation and 0.56 MSE. FastText Skip-Gram at 300 dimensions produces 0.55 and 0.53. On the European test, GloVe at 1,000 dimensions reaches 0.46 and 0.94, and FastText Skip-Gram at 1,000 dimensions reaches 0.54 and 0.86. The latter result is close to Wang2Vec’s in correlation while leaving a distinction under MSE. GloVe’s comparatively weak showing on ASSIN is striking beside its lead on semantic word analogies.

#### What the rankings mean across tasks

The authors expected a strong score on the morphosyntactic analogies to accompany high accuracy in grammatical tagging. They expected a similar alignment between semantic analogies and sentence similarity. The leading settings make both expectations doubtful for these experiments. FastText excels at the benchmark’s word-form relations and trails the strongest settings in the tagger. GloVe excels at semantic analogies and falls behind the comparison method for ASSIN. Wang2Vec gives strong downstream results while its analogy performance depends on both the relation group and the architecture chosen.

A useful comparison is therefore between what each result asks the vectors to do. The analogy result concerns a particular arrangement of word vectors around relation examples. The tagging result measures the accuracy of grammatical decisions made with contextual and word-form features. The ASSIN result concerns a numerical judgment derived from an aggregate of the vectors in each sentence. A representation that gives a clean word-level relation in space can contribute differently when its vectors are used as inputs to those other operations. The paper reads the changes in ranking as evidence for evaluation in the task of interest.

### What the ablations show

The paper presents no formal component-removal ablation of a single architecture. It offers comparisons of architecture families, dimensions, Portuguese test variants, and evaluation procedures, along with an example showing how two vector sets rank the same analogy answer.

#### Context and word order

The closest comparisons for studying word order are between the corresponding Word2Vec and Wang2Vec architectures. Both ordinary CBOW and Continuous Window predict a center word using its context. Continuous Window preserves position by concatenating its inputs in order. At 300 dimensions on the PT-BR semantic analogies, Word2Vec CBOW scores 4.6 and Wang2Vec Continuous Window scores 40.3. For PT-EU the scores are 4.5 and 36.9. FastText CBOW also scores relatively low in this evaluation, reaching 8.4 in PT-BR and 9.1 in PT-EU at that size. Among the tested center-prediction approaches, the ordered one stands out on these relations.

The same comparison yields other differences that put the semantic scores in context. At 300 dimensions on PT-BR syntactic analogies, Wang2Vec Continuous Window scores 49.9 against Word2Vec CBOW’s 24.7. At the same size in the tagger, their scores are 95.83% and 95.58%. A large separation on both sets of analogy questions is accompanied by a narrower separation in the tagger’s aggregate accuracy. For the two Skip-Gram architectures at 300 dimensions, Wang2Vec yields 95.89% and Word2Vec yields 95.66% in tagging. The ordered versions have an advantage within each prediction direction in this comparison.

The pattern varies across downstream settings. At 300 dimensions on ASSIN PT-BR, Wang2Vec Continuous Window reaches 0.53 correlation and 0.55 MSE, and Word2Vec CBOW reaches 0.55 and 0.53. Structured Skip-Gram reaches 0.58 and 0.50, against 0.52 and 0.56 for ordinary Skip-Gram. The comparison between related architectures thus depends on how direction and position enter the learning problem, as well as on how the resulting vectors are used. The word-order change also changes how the architecture organizes its inputs or parameters. The results describe those implementations as tested.

The authors suggest that the position of a negation word illustrates why order can matter even for meaning. A method that learns from an unordered collection of context words pools evidence from different arrangements. A position-aware method can give those arrangements different effects during learning. This is an explanation for why an order-sensitive approach might do well on semantic analogies. The reported analogy categories do not directly test whether the vectors recover the interpretation of particular negated sentences. The explanation remains a hypothesis about what the training signal provides.

FastText gives another comparison between information supplied during training and information used by a downstream task. Character sequences can make related word forms easier to connect. That training bias has a natural fit with analogy questions about plurals and verb inflection. The tagger also uses form, but it has to resolve context-dependent uses and is already given prefix and suffix features. Its aggregate accuracy is a measure of how all the features work together. The study does not report accuracy by inflection category, or a tagging run with the affix features removed. That leaves open how often FastText supplies useful form information and how much of that information overlaps with the tagger’s own features.

#### Dimensions and diminishing returns

Varying dimensions while keeping an embedding method fixed gives a clearer picture of the cost of making vectors larger. GloVe’s PT-BR semantic analogy scores rise from 13.7 at 50 dimensions to 45.8 at 300 and 48.5 at 600. At 1,000 dimensions the semantic score is 45.9. Its PT-BR combined score is already highest, among its settings, at 300 dimensions with 46.7. The same architecture can therefore have different preferred sizes depending on whether the goal is the semantic subset or the aggregate benchmark.

FastText Skip-Gram shows a similar dependence on the metric. Its PT-BR syntactic score is 58.7 at 300 dimensions, 55.1 at 600, and 45.1 at 1,000. In tagging, the values at those sizes are 94.82%, 95.25%, and 95.49%. For this architecture, moving beyond the size with its strongest syntactic analogy performance helps the tagger, even as analogy accuracy declines. The shared training corpus makes it possible to see the divergence without comparing vector sets drawn from completely different sources.

Wang2Vec Skip-Gram gives the authors a practical reason to favor moderate dimensionality. Its top tagger accuracy, 95.94%, comes at 1,000 dimensions, while the 300-dimensional setting already reaches 95.89%. On the Brazilian ASSIN test the corresponding correlations are 0.60 and 0.58. On the European test, the MSE is 0.85 at both 300 and 1,000 dimensions, with 0.83 at 600. The effect of increasing dimension is specific to the task and measure. The authors judge that the improvements they obtain generally fail to justify the extra memory above 300 dimensions. Their conclusion is about the practical balance in these experiments.

#### What changes when the test changes

The ASSIN setup retains the sentence-vector feature from the earlier system and drops the TF-IDF feature from the current comparison. That makes the system easier to interpret as an evaluation of the embeddings. Changes in its input feature follow from the word vectors and their sums, given the same sentence pairs. The earlier work found a benefit from combining the features. The current study does not repeat that comparison across its new embeddings, so its results cannot rank their contributions to the combined system. A setting that is especially good at supplying complementary information to TF-IDF could behave differently there.

Testing both Portuguese variants gives a separate check on whether a pattern recurs across benchmark versions. GloVe leads the reported combined analogy comparisons in both, and FastText Skip-Gram has the strongest syntactic analogy setting in each. On ASSIN, the preferred Wang2Vec size depends on the test variant, and the competing settings trade places depending on which metric is used. Since the embeddings were learned from a shared corpus, the difference shows how the same vector sets fare on different evaluation material. It does not measure the effect of changing the proportion of the language varieties in training.

The analogy example also helps explain what aggregate accuracy hides. The ordinary CBOW setting ranks the intended queen answer among its candidate words, while its highest-scoring answer expresses an association of a different kind. The scoring procedure gives decisive weight to which candidate comes first. A practical task may use graded information from many parts of the vector space, and tagging can use clues from outside that space. Seeing how the vectors fail on a particular question is informative about the shape of that failure. A single example gives no estimate of how common the same pattern is across relation categories.

### Limitations

#### Limits the authors identify

The authors treat their tagging comparison as a fixed-configuration experiment. They choose a common nlpnet setup with capitalization, prefix, and suffix features, and leave extensive hyper-parameter optimization outside the study. The choice helps make a comparison in which the embedding is the changing input. It also means a reader cannot infer each setting’s best achievable tagging accuracy. A larger network or some other training settings could change how well the tagger uses a particular vector set.

They explicitly point to a probable tokenization problem in the tagging setup. Embedding training kept verbs joined to clitic pronouns, and the authors associate that choice with many out-of-vocabulary items in the tagger. An out-of-vocabulary item is a word form whose string has no matching entry in the embedding vocabulary. The authors offer this mismatch as an explanation for the lower accuracies compared with the earlier tagging work. The paper gives no tagging comparison with clitics split during embedding training, so that explanation has the status of a diagnosis instead of a measured recovery.

The training limitation for large Wang2Vec Continuous Window settings matters for the size comparisons. Vanishing gradients in the implementation left the 600-dimensional and 1,000-dimensional versions unavailable. The high-dimensional order-aware results therefore concern Structured Skip-Gram. The successful Continuous Window scores at smaller sizes still show how that architecture works under the reported training conditions. They leave the relationship between its performance and larger dimensions open.

The ASSIN experiment deliberately uses the vector-sum feature by itself. This follows from the purpose of exchanging one vector set for another under a shared procedure. The authors acknowledge that the earlier sentence-similarity system did better with TF-IDF also available. Likewise, they describe their conclusion about 300 dimensions as a judgment based on performance and memory, made from the range of settings they evaluated. Their suggested future work includes varying tokenization and normalization, and trying [lemmatization](https://md.research.elamur.ai/free/en/concepts/lemmatization/) for categories such as verbs. Lemmatization maps inflected forms to a shared dictionary form and could reduce the vocabulary required for training and use. They also call for evaluation on more downstream tasks.

#### Limits that follow from the design

The downstream evidence comes from two particular procedures. The tagger uses lexical representations with other features and labeled examples from revised Mac-Morpho. The sentence-similarity system uses word-vector sums and a linear mapping from cosine similarity. These are places where embeddings can matter in different ways, but other procedures could expose different properties of the same vectors. A sentence encoder that explicitly uses word order, for instance, would give the word representations a different role from the sum used here. The paper establishes a change in ranking under the reported procedures.

The ASSIN scoring procedure also restricts how the order learned by Wang2Vec can be expressed. During training, Wang2Vec distinguishes word positions. At evaluation time, summing the same sentence words in a different order gives the same sum. Whatever value the order-aware learning has for ASSIN therefore reaches the similarity score through the resulting word vectors. The evaluation does not directly measure the ability to interpret the order of the evaluated sentence. The tagger and similarity results should be understood as evidence about different uses of vectors learned from ordered local context.

In the analogy tests, each semantic category measures a specified relationship and expects a word. A high score on country and capital questions can coexist with weaker results on kinship, and neither question requires comparing whole sentences. Conversely, an embedding can help a sentence pair receive a useful score even if the geometry fails to put the canonical answer first in a word analogy. The paper reports how the rankings differ over its evaluations. It does not report a statistical correlation coefficient between the analogy scores and task scores across configurations. Its reported Pearson correlations concern reference judgments and predictions on ASSIN.

The shared corpus also limits conclusions about variation in Portuguese. It combines texts with different provenance and has a large contribution from a predominantly European collection. Both analogy variants and both ASSIN variants are evaluated, but the study does not train matching Brazilian-only and European-only embedding sets as part of that comparison. Consequently, differences between PT-BR and PT-EU scores can be read as results on the respective benchmarks. They cannot by themselves isolate dialect composition, topic, vocabulary, or any other particular cause. The evidence that mixing variants can be useful comes in part from the earlier study on which the authors based their corpus choice.

The baseline on ASSIN and the Word2Vec settings trained in this study also use different training collections. Holding the embedding-only scoring procedure in common makes the baseline practically relevant. It still bundles choices about where the vector training material came from and how it was prepared. The comparisons among embeddings trained for the current study carry more weight when attributing an observed difference to an architecture. Even within those comparisons, order handling, prediction direction, and parameterization can change together.

Finally, the reported tables give point scores. The paper supplies no uncertainty estimates across training runs for the small separations between the leading tagging settings. Those rankings describe the observed runs. The same caution applies to ties as reported in ASSIN, where settings share displayed values for correlation or error. The authors’ memory judgment reflects the extra size implied by more dimensions, and the paper reports no measured memory-use curve for these deployments. The available scores support a practical preference, while leaving both the stability of small differences and the exact resource tradeoffs open.

### What came after

#### Building resources and extending intrinsic evaluation

Later citing work takes up the questions of how to build word representations for a language and how to evaluate the resulting resource. *Learning Word Vectors for 157 Languages* addresses the construction side at multilingual scale. Hartmann and colleagues study a mixed corpus within Portuguese and compare vector behavior across variants of the language. The later work’s scope is vectors across languages. The relationship is the shared concern with making lexical representations available beyond a single familiar setting. Its citation establishes a connection to the Portuguese study, while the extent of any reuse of the corpus preparation or evaluation procedures is unspecified. [Learning Word Vectors for 157 Languages](https://md.research.elamur.ai/free/en/papers/grave-2018-learning-word-vectors-157-languages/)

*NPVec1* addresses construction and evaluation for Nepali. This gives the closest parallel in how the research problem is posed. A word embedding resource is something to be built, then examined for what it represents. In the Portuguese study, that examination includes the effects of embedding method and dimension under a shared preparation procedure. The Nepali work takes up the language-specific resource problem with a different language as its subject. The connection concerns that pairing of construction and evaluation. The citing relationship alone leaves the details of any shared tests or training choices open. [NPVec1](https://md.research.elamur.ai/free/en/papers/koirala-2021-npvec1-word-embeddings-nepali-construction/)

The Polish study on Wordnet-based evaluation takes up the measurement side. It evaluates distributional representations for Polish through Wordnet, a lexical resource, while the Portuguese paper’s intrinsic test is formed from completed and incomplete word pairs. Both lines of work place an external lexical standard beside patterns learned from running text. The difference in evaluation material changes what evidence a comparison can use. This is a direct continuation of the question raised by the Portuguese paper about which tests reveal the properties that a reader cares about in a representation. [Wordnet-based Evaluation for Polish](https://md.research.elamur.ai/free/en/papers/piasecki-2018-wordnet-based-evaluation-large-distributional/)

Work on idiomaticity narrows the question to a particular property of expressions. Probing for [idioms and multiword expressions](https://md.research.elamur.ai/free/en/topics/multiword-expressions/) asks what a vector space can reveal about phrasing whose interpretation depends on the expression as a whole. The Portuguese paper’s ASSIN procedure combines word vectors by summation, so the relationship between a whole expression and its component words is relevant to understanding that kind of downstream use. The idiomaticity study brings the property itself into focus as the subject of a probe. The bibliographic connection supports this reading of the research questions, with the particular procedures and findings of that later probe left unspecified. [Probing for idiomaticity](https://md.research.elamur.ai/free/en/papers/garcia-2021-probing-idiomaticity-vector-space-models/)

*MaiBERT* takes up resource construction for low-resourced Maithili, with a pretraining corpus as part of its stated contribution. That focus connects to an early decision in the Portuguese study, where collecting and preparing a usable body of text is a substantial part of the research. The original Portuguese experiments turn that collection into a vocabulary of vectors and evaluate it as such. The Maithili work is about a corpus for pretraining and the resulting language system. The common concern is how to establish a training resource for the language under study. Reuse of the Portuguese vectors or their benchmarks is unspecified. [MaiBERT](https://md.research.elamur.ai/free/en/papers/yadav-2026-maibert-pre-training-corpus-language/)

#### Evaluating Portuguese in particular applications

The biomedical work by Dalloux and colleagues investigates supervised detection of negation and its scope in French and Brazilian Portuguese. Scope concerns which material is affected by a negation. Hartmann and colleagues mention the position of negation to explain why context order can matter for meaning. In the later biomedical work, detecting negation and finding its scope are themselves the tasks. That makes the application a concrete example of the kind of behavior for which the Portuguese paper argues that task-specific evidence matters. The connection gives no architecture comparison or measured effect for the Hartmann embeddings in the biomedical corpora. [Negation and scope in biomedical corpora](https://md.research.elamur.ai/free/en/papers/dalloux-2020-supervised-learning-detection-negation-its/)

Lopes’s work takes up [named entity recognition](https://md.research.elamur.ai/free/en/concepts/named-entity-recognition/) in Portuguese clinical text. The task concerns identifying mentions of entities in running text. Like part-of-speech tagging, it examines decisions about spans or words in context. The clinical setting and the labels it needs define a different problem from assigning grammatical categories under the Mac-Morpho setup. The later work thus belongs to an application of the same general research question, how representations of Portuguese words contribute to a particular text-processing task. The citation alone leaves the precise role of the released embeddings unspecified. [Contributions to Clinical Named Entity Recognition in Portuguese](https://md.research.elamur.ai/free/en/papers/lopes-2019-contributions-clinical-named-entity-recognition/)

Dias and colleagues study cross-domain author gender classification in Brazilian Portuguese. The domain change in that task gives it a different emphasis from testing a shared set of Portuguese embeddings on analogy lists. A cross-domain evaluation asks how a classification procedure behaves when the kinds of text available across stages of the task differ. Hartmann and colleagues use multiple genres as a source of training contexts. The later study puts cross-domain classification itself at the center of the evaluation, continuing the emphasis on judging a method in the setting where it has to make decisions. [Cross-domain Author Gender Classification in Brazilian Portuguese](https://md.research.elamur.ai/free/en/papers/dias-2020-cross-domain-author-gender-classification/)

The public-agency security news study explores [sentiment analysis](https://md.research.elamur.ai/free/en/topics/sentiment-emotion/) within a particular news dataset. Sentiment analysis is one of the possible extrinsic evaluations named by Hartmann and colleagues, whose own task experiments focus on grammatical categories and sentence similarity. The later study takes up that application on a defined collection of texts. The connection is at the level of the evaluation problem, where success has to be established against the labels and texts relevant to the dataset. The citing record gives no comparative result for any of the Portuguese vector sets. [Sentiment Analysis in a Public Agency Security News Dataset](https://md.research.elamur.ai/free/en/papers/lobo-2026-exploring-sentiment-analysis-approaches-public/)

The HAREM work takes an audit and reassessment of Portuguese named entity recognition as its subject. Its focus on reproducibility connects to a feature of the earlier Portuguese study, where released vectors and evaluation scripts let others refer to identifiable training and comparison choices. The audit addresses a different benchmark and a different kind of decision about words in text. Its relationship to the earlier work is part of a broader Portuguese evaluation effort in which resources, test procedures, and the claims supported by them are all objects of investigation. The available account establishes the subject of the reassessment and the citation, with the role of particular embedding settings left open. [Twenty Years of HAREM](https://md.research.elamur.ai/free/en/papers/nunes-2026-twenty-years-harem-reproducible-audit/)

## Cite

Cite as Nathan Hartmann, Erick Fonseca, Christopher Shulby, Marcos Treviso, Jéssica Silva and Sandra Aluísio. 2017. Portuguese Word Embeddings: Evaluating on Word Analogies and Natural Language Tasks. Proceedings of the 11th Brazilian Symposium in Information and Human Language Technology.

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

```bibtex
@inproceedings{hartmann2017portuguese,
  title = {{Portuguese Word Embeddings: Evaluating on Word Analogies and Natural Language Tasks}},
  author = {Nathan Hartmann, Erick Fonseca, Christopher Shulby, Marcos Treviso, Jéssica Silva and Sandra Aluísio},
  booktitle = {Proceedings of the 11th Brazilian Symposium in Information and Human Language Technology},
  year = {2017},
  url = {https://aclanthology.org/W17-6615/}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
