Elamur Research

Give your Text Representation Models some Love: the Case for Basque

Paper · 2020 · Rodrigo Agerri, Iñaki San Vicente, Jon Ander Campos et al.

Summary

A team building a Basque text classifier or tagger can start with a publicly available representation of the language. That saves the cost of training on a large collection of unlabeled text. But the public release may have learned from a relatively small collection of Basque writing, or it may share its vocabulary and parameters with many other languages. Agerri and colleagues ask how much better the same kinds of systems can work when their initial training uses a corpus assembled specifically for Basque.

The authors build the Basque Media Corpus from Wikipedia and several sources of news, with a total of 224.6M tokens in the corpus breakdown. They use it to train FastText word embeddings, which give a word a fixed numerical representation, and Flair embeddings, which give a word a representation that depends on its sentence. They also train BERTeus, a Basque-only counterpart to multilingual BERT. BERTeus learns its own inventory of word pieces from Basque text. In the authors’ examples, those pieces sometimes correspond more readily to recognizable parts of Basque words than the pieces produced by multilingual BERT.

For each of the three approaches, the Basque Media Corpus version beats its public counterpart on the reported test measures. BERTeus has the highest main score on each task. It reaches 76.77 micro F1 on Argia news headline topic classification and 76.14 macro F1 on sentiment classification of culture-related tweets. It achieves 97.76 word accuracy on the Universal Dependencies 1.2 Basque part-of-speech test and 87.06 F1 on the EIEC named entity test. The margins vary. Replacing the official Flair embeddings yields a small gain in part-of-speech accuracy, while changing the FastText source makes a much larger difference to named entity recognition.

The most direct evidence comes from comparisons that keep the downstream setup similar and replace the representation it starts from. The BERTeus comparison tests a broader change. Along with the corpus, the authors change the language coverage, the way the vocabulary is learned, and the masking used during initial training. The result establishes how well that combination worked for Basque across the tested tasks. The experiments leave open how much of the gain belongs to each change.

Deep dive: Give your Text Representation Models some Love: the Case for Basque

Agerri and colleagues train FastText, Flair and BERTeus on a dedicated Basque corpus and compare them with public releases on four language tasks. · about 35 minutes to read

The problem and its context

What a public release brings to a new task

The paper takes up a practical question in natural language processing. A supervised system may have examples of headlines with topics or sentences with grammatical tags, but those annotations supply only part of what the system needs to learn. It also needs a way to represent the words and other pieces of text it encounters. Learning that representation from a separate body of unlabeled writing lets the supervised stage start with information acquired outside the task dataset. The same initial representation can then be used for several tasks whose labels have little in common.

For the groups the authors have in mind, the public release is a natural starting point. Training a representation on raw text can be expensive, while downloading one already trained makes an experiment easier to reproduce and gives another team a way to use the same starting point. The tradeoff concerns the decisions embodied in that release. Its builders chose the sources of text, the amount of text per language, and the units to represent. A Basque task can therefore inherit decisions that were reasonable for a broad release but poorly suited to some of its inputs.

The authors distinguish between the availability of a language and the attention it receives during training. A public distribution can offer a dedicated Basque representation trained on whatever Basque material was easy to collect. Another distribution can cover Basque within a multilingual system. The first arrangement makes space for Basque alone but still depends on the collection behind it. The second makes cross-language use possible while requiring Basque to share vocabulary entries and representational capacity. The paper treats these as different ways a public starting point can fall short.

The comparison is also about what counts as a fair test of a better starting point. If one group changes the initial representation, the task classifier, and the procedure for selecting settings, a higher score describes the whole new system. The authors want a comparison closer to the choice an engineer faces when replacing a public representation. They train counterparts within existing families and keep common task arrangements where possible. That aim explains their choice to work with established architectures even where the related literature points to possible improvements.

From one vector per word to a representation in context

Earlier work discussed in the paper includes Word2vec and GloVe. In the authors’ account, these methods learn from patterns of words occurring near one another in a corpus. They turn each word into a vector, an ordered collection of numerical values that can be supplied to a task system. The same word receives the same vector across its occurrences. A task system can still use surrounding words when it makes a prediction, but the word’s own input vector is fixed before the sentence is considered. Word2vec

FastText also supplies a fixed word vector, while learning from pieces of the word itself. The pieces are character n-grams, stretches of characters of a specified length. Words can share those stretches even if their full spellings differ. The authors see a particular reason to consider this for Basque, whose morphology allows words to accumulate meaningful endings. A representation that uses internal pieces has a way to capture similarities among forms whose full strings would otherwise be treated as separate entries. The paper compares public FastText vectors with vectors learned from a more deliberately assembled Basque collection. FastText

Word form and sentence context provide different kinds of information. The paper illustrates the distinction with the Basque word banku. It can refer to a financial institution, a bench, or a stock or supply. Internal character pieces will be the same across those uses, and a static vector will be identical. The relevant distinction may instead lie in the words nearby. A contextual embedding allows the representation of banku itself to vary across sentences, so the downstream decision can start with a vector that already reflects some of the context.

The authors discuss ELMo and Flair as earlier approaches to contextual representations. Both use recurrent architectures that build up information while moving through a sequence. Flair works at the character level, letting the spelling of a word and the text around it influence the same representation. The paper cites its success on English tagging benchmarks, but its relevance to the Basque study is also practical. The Flair developers already distributed Basque embeddings, giving the authors a public counterpart against which to evaluate their newly trained embeddings. ELMo · Flair

What multilingual BERT shares

The paper presents BERT as another route to contextual representation. Its architecture uses the Transformer and attention, in which a position in a sequence can draw information from other input positions. During initial training, BERT learns partly by predicting tokens that have been selected for concealment or replacement. It can then be adapted to a labeled task by updating the pretrained system on task examples, a procedure called fine-tuning. For Basque, the publicly available BERT starting point in the authors’ comparison was multilingual BERT, abbreviated mBERT. Attention Is All You Need

The multilingual release covers 104 languages. The paper gives the scale of the difference in the Wikipedia material available for two of them. English contributes 2.5 thousand million tokens, while Basque contributes around 35 million. The multilingual training procedure oversamples lower-resource languages, giving examples in those languages more opportunities to appear than their raw corpus sizes alone would suggest. The parameters and the inventory of word pieces are still shared. Oversampling changes how often the trainer draws on a language, while the corpus and shared inventory still shape what forms the system has to represent. How Multilingual Is Multilingual BERT?

The capacity to transfer across languages is part of the motivation for a multilingual system. Work cited by the authors considers settings where task data and the language in which the resulting system is used differ. The Basque paper asks a separate question about the case where labeled Basque examples are available and the evaluation is also in Basque. In that setting the public multilingual encoder can be judged directly against a Basque-only alternative. A comparison on that basis addresses how well the two starting points support Basque supervision. It leaves the transfer question to a different experiment.

The paper also discusses CamemBERT, a precedent for collecting a substantial corpus and training specifically for French. As described by the authors, that work used 138GB of French Common Crawl text and found gains over multilingual BERT on French tasks. CamemBERT used RoBERTa, which made the comparison with multilingual BERT less direct for the Basque authors’ purposes. They sought to stay close to BERT’s encoder configuration while changing how Basque was represented in the training material and vocabulary. Across FastText, Flair, and BERT, the common question is whether the public starting point is the best available use of each approach for Basque.

The method, step by step

Assemble the Basque Media Corpus

The project begins with the text used for pretraining, the stage that precedes learning any of the evaluation tasks. The authors wanted a substantial collection and cared about its structure as well as its size. In particular, they wanted clean text with identifiable paragraph and document boundaries. Those boundaries matter to their BERT procedure because it constructs examples that ask whether one segment really continues another. A collection needs to preserve relations among its text segments if those examples are to reflect the original documents.

The Basque Media Corpus, or BMC, joins an encyclopedic source with news from several outlets. Basque Wikipedia accounts for 35M tokens. The breakdown assigns 81M tokens to the newspaper Berria, 28M to EiTB, 16M to the magazine Argia, and 64.6M to local news sites. The corpus breakdown gives 224.6M tokens overall. These numbers describe the unlabeled material used to learn the initial representations. The labeled sets used for the tasks have their own sizes and train or test partitions.

The choice of news matters to what the corpus represents. As the source breakdown makes clear, the addition to Wikipedia is a collection of news writing, including material from individual outlets and local sites. A large news contribution supplies more occurrences of Basque words and constructions and does so within particular kinds of writing. The stated aim of collecting clean, structured text also gives “quality” a concrete meaning in the design. The authors describe the desired properties of the collection. They do not assign each source a quality score or construct controlled versions differing only in the cleanliness of their text.

The same corpus then supplies training text to three approaches. FastText pays attention to words and their character pieces. Flair reads sequences of characters and uses what it learns to encode individual words in context. BERTeus learns a Basque vocabulary of word pieces and trains an encoder on sequences expressed with those pieces. The approaches share a collection of text, while their units and training signals differ.

From Basque text collection to task evaluation

The steps in order.

From Basque text collection to task evaluationStep 1: Collect Basque Wikipedia and news articles1. Collect Basque Wikipedia and news articlesStep 2: Preserve paragraph and document boundaries2. Preserve paragraph and document boundariesStep 3: Train FastText and Flair on the corpus3. Train FastText and Flair on the corpusStep 4: Learn a cased Basque subword vocabulary4. Learn a cased Basque subword vocabularyStep 5: Pretrain BERTeus on Basque text5. Pretrain BERTeus on Basque textStep 6: Fit classifiers and taggers on labeled examples6. Fit classifiers and taggers on labeled examplesStep 7: Compare with public releases on held-out data7. Compare with public releases on held-out data

FastText learns from word forms and their neighbors

A FastText representation starts with the characters within a word. It uses a collection of character n-grams associated with the word, so a piece that occurs across several forms can contribute to their representations. The representation remains static. If the word reappears in a different sentence, the downstream system receives the same FastText vector for that form and must use its task architecture to combine it with surrounding information.

The paper describes two public releases. FastText-Wikipedia was trained on Wikipedia with skip-gram, which uses a word to predict nearby words. Its settings include a context window of 5, character n-gram lengths of 3-6, and 5 negative examples. Negative examples give the training procedure alternatives to distinguish from observed contexts. The window specifies how much neighboring text can contribute to a training example. The character lengths govern the parts of the word from which the representation can learn.

The Common Crawl release was trained using both Common Crawl and Wikipedia. Its procedure uses continuous bag of words, or CBOW, with position weights. In this setup, surrounding words contribute to predicting the word under consideration, and their positions influence their contributions. The reported public settings are a window of 5, character n-grams of length 5, and 10 negatives. The paper describes both official sets of word vectors as having 300 dimensions. FastText vectors for many languages

The authors’ FastText-BMC vectors also have 300 dimensions and use position-weighted CBOW, with the defaults the paper attributes to the original FastText work. Holding the vector width fixed means each representation can occupy the same kind of input to a downstream system. The Common Crawl release is particularly relevant because it also uses position-weighted CBOW. The Wikipedia comparison spans a change in the learning procedure as well as a change in the source material. As a consequence, the downstream study can show the value of choosing the new vectors over either release even where the score differences cannot be assigned exclusively to the text source.

For the classification tasks, the paper evaluates FastText within a Flair classifier. This comparison asks how much the classifier can do with the different static embeddings as inputs. Flair also names a kind of contextual embedding, so the distinction matters. A classifier implemented in the Flair system can receive FastText vectors without using Flair’s contextual string embeddings. In the experiments these are different choices of representation, even when they are tested in the same software.

Flair reads up to a word from both directions

The official Basque Flair embeddings were pretrained on 36M tokens drawn from OPUS and Wikipedia. The authors use the BMC instead and train character-based embeddings with a hidden size of 2048, a training sequence length of 250, and mini-batches of 100. A hidden state is the numerical record a recurrent network carries as it proceeds through a sequence. Its size describes the width of that record. A mini-batch groups training sequences for an update. The paper reports 5 epochs, meaning passes over the full training corpus, and 48h of training for each Flair run of this kind on a Titan V GPU.

The language prediction procedure operates on a stream of characters. In the forward direction, a long short-term memory network, or LSTM, learns to predict the next character as it moves through that stream. It updates its state at each position. To represent a word in a particular sentence, Flair reads the forward state at the word’s final character. The state at that point can carry information from the characters in the word and from the earlier part of the sentence.

A backward LSTM reads from the end toward the beginning. For the same word, Flair takes its state at the word’s first character, after the backward network has passed through the following text and the word itself. Flair places the forward and backward vectors together to form the contextual string embedding. Thus a change in either side of the sentence can affect the vector associated with a given word. This differs from the use of character pieces in FastText. In Flair, what surrounds the word can change the representation extracted for that occurrence, even though the spelling is the same.

Context brings a difficulty of its own. Some sentences provide little evidence for the role of a particular name, even when the text around the name is represented well. The paper describes pooled contextualized embeddings as a way to bring information from other occurrences into the task representation. Contextual vectors for occurrences of a word are kept in memory. A pooling operation combines information from those occurrences, giving the task system a broader basis for representing the word than its immediate use alone. The operation belongs to the stage that uses the pretrained Flair embeddings. It leaves the preceding character prediction training as described above. Pooled contextualized embeddings

The downstream architecture depends on the output the task requires. For tagging, the paper uses a bidirectional LSTM with a conditional random field, or CRF. The LSTM processes the sequence in both directions, and the CRF scores label sequences so that the choice at a word can take neighboring labels into account. This is useful when a system has to produce a coherent series of tags, such as the start and continuation of a multiword entity. The architecture is drawn from earlier sequence tagging work cited by the authors. Bidirectional LSTM-CRF tagging

For classification, the bidirectional LSTM produces a representation of the whole input, which a linear layer uses to score the possible classes. The paper specifies a single layer of size 128, word reprojection, and dropout of 0.3068 for this classifier. Reprojection maps the input word vectors to another numerical representation within the system. Dropout prevents part of the network’s activations from being used during a given training pass, with the aim of making the learned predictor less dependent on particular internal signals. The authors compare the official and BMC Flair embeddings as separate inputs. Earlier Flair work recommends combining contextual embeddings with static vectors for strong results, a combination the authors set aside to make their comparison easier to interpret.

BERTeus first learns how to divide Basque words

For BERTeus, the authors define the units that the encoder will receive before training the encoder itself. Subword tokenization divides text into reusable pieces that can be smaller than a whole word. The inventory can retain a familiar word or stem as a single piece and split other forms across several pieces. One reason for using sub-words is that a vocabulary of limited size can then represent many different written forms. The list of pieces and the algorithm that chooses among possible segmentations determine what the encoder sees at its input.

BERTeus uses a cased vocabulary of 50,000 tokens. A cased vocabulary preserves distinctions of letter case. The authors learn it from the full BMC with a unigram segmentation procedure, which uses scores for individual pieces to evaluate ways of dividing a string. They chose this method because the original WordPiece implementation used for BERT was unavailable to them. They describe increasing the planned vocabulary size from 30,000 to 50,000 in light of Basque’s agglutinative structure, in which several meaningful components can occur within a written word. They set character coverage to 99.95 percent so that particularly rare characters need not all be included. Unigram subword segmentation

The paper gives two illustrations of the difference between the segmentations. For etxerantz, meaning “to the house,” mBERT splits the form into Et, xer, ant, and z. BERTeus divides it into Etxera and ntz. For medikuarenera, glossed as “to the doctor,” mBERT gives Medi, kua, rene, and ra. BERTeus gives Mediku, aren, and era. The latter example makes the authors’ intuition concrete because the doctor stem and meaningful endings are easier to identify among the BERTeus pieces.

The examples also clarify what the vocabulary learner does. It learns a segmentation from text without requiring an analysis of every word into linguistic units. A recognizable division may emerge from pieces learned on Basque writing, and a less transparent division can still encode the spelling. The authors use these words to illustrate what gives a Basque-specific vocabulary practical interest. Their design supplies the encoder with those chosen pieces throughout pretraining and fine-tuning. Whether the illustrated improvement in segmentation explains better task predictions is a separate question.

Train the encoder on missing text and segment order

BERTeus follows the BERT BASE encoder arrangement reported in the paper. Its architecture has a hidden size of 768, 12 self-attention heads, and 12 Transformer encoder layers, and its total parameter count is reported as 110 million. An encoder layer updates the representations of the input positions. Attention lets those updates draw on other positions, and the heads give a layer multiple ways to weigh information across the sequence. The stack can therefore represent a token in relation to the other tokens in its input. The authors keep this general configuration close to BERT so that their comparison centers on choices about pretraining and language coverage.

The input to the masking task is a sequence of tokens, which can be written using the notation in the paper.

x₁, x₂, …, xₙ

Each x is a token in the sequence. Its subscript gives its position. The ellipsis stands for the intervening positions, and n denotes the sequence length.

The masked language prediction task first selects 15% of the tokens as candidates. Of the selected tokens, 80% are replaced with the special marker [MASK], 10% are replaced with a randomly drawn vocabulary item, and 10% are kept as they are. The correct original tokens supply the targets regardless of which of those treatments occurred. The procedure creates a task from unlabeled writing because the original text already contains the answers. A position can contribute a prediction target even when the visible input lacks a mask marker there.

BERTeus uses whole-word masking to decide which pieces belong together in this process. When a written word spans several sub-words, the masking selection operates on the word’s pieces as a group. The system must then recover the relevant pieces with the aid of surrounding information. Selecting sub-words independently could leave adjacent parts of the same word visible and make the prediction easier for a different reason. The authors cite earlier experience with whole-word masking in an upgraded BERT LARGE release. They do not compare alternative masking schemes within BERTeus.

The other training task is next sentence prediction. The paper describes constructing examples with segments A and B. A is the initial segment and B is the candidate continuation. In 50% of the examples, B is the actual next segment in the corpus. For the remaining examples, B is drawn at random from the collection. The encoder learns to distinguish the genuine continuation cases from the randomly paired ones. Keeping this task follows the original BERT setup, even though the authors cite work that questioned the need for it. XLNet

The paper describes the joint objective as the sum of mean likelihoods for the two tasks. In compact form, that description is:

J = mean(Lₘₗₘ) + mean(Lₙₛₚ)

J denotes the joint objective. Lₘₗₘ denotes the likelihood terms for recovering the original tokens in masked language prediction. Lₙₛₚ denotes the likelihood terms for deciding whether a continuation is genuine in next sentence prediction. The subscripts identify the two tasks. Each mean averages the terms for its task, the parentheses delimit what is averaged, the plus sign adds the two averages, and the equals sign defines J as that sum.

Schedule pretraining before adapting to labeled tasks

The optimizer is Adam, with a reported learning rate of 1e − 4 and settings of β₁ = 0.9 and β₂ = 0.999. The β values govern how the optimizer combines current and earlier information about its updates. The paper reports L2 weight decay of 0.01, warmup followed by linear learning-rate decay, and dropout of 0.1 on all layers. Warmup increases the learning rate early in training, after which the schedule gradually reduces it. Weight decay constrains parameter growth during training. These choices describe the initial training of the encoder, before it sees the evaluation labels.

Computational cost motivates the schedule for sequence length. During self-attention, the work grows quadratically with the length of the input sequence. The authors use sequences of length 128 for 90% of the pretraining steps and length 512 for 10%. They report 1, 000, 000 steps with a batch size of 256. They use Cloud v2 TPUs for the first 90% of steps and Cloud v3 TPUs for the rest. The long-sequence stage allows the encoder to train with more context per input while limiting the part of the run that incurs the higher cost.

After pretraining, the authors fine-tune BERTeus and mBERT on the training examples for each Basque task. This is different from passing a set of fixed FastText vectors into a task classifier. The BERT comparisons adapt the pretrained encoder to the labeled problem. The evaluation retains the resulting distinction between families. Within each family the authors ask what happens when the starting representation changes, and across families the comparisons are between task systems that consume and adapt their representations in different ways.

Experiments and results

What the scores measure

The evaluation covers topic and sentiment classification, where a whole input receives a class, and grammatical and entity tagging, where the system predicts labels over a sequence. Each reported result averages five runs with random initialization. The Flair setup uses development data for tuning and leaves that data out of fitting. Test data is reserved for final evaluation. For the BERT comparisons the authors fine-tune on the task training sets. Their part-of-speech and entity experiments use the Transformers software. Transformers

For the classification datasets, the authors report micro and macro F1. F1 balances precision, how many predictions of the relevant class are correct, with recall, how many examples of that class the system recovers. Micro F1 pools decisions across examples before scoring, allowing frequent classes to contribute more decisions. Macro F1 gives the classes equal weight by averaging their individual F1 scores. Both describe performance on the held-out classification task, but they can rank systems differently when classes occur at different rates or when the distribution of errors changes.

The tagging measures follow the tasks’ outputs. Part-of-speech tagging uses word accuracy, the proportion of word positions assigned the correct grammatical category. The named entity evaluation reports precision, recall, and F1 with the CoNLL evaluation script. It evaluates the entities recovered from the tag sequences, so boundaries and entity types matter together. Although the paper’s cross-task table has a general caption referring to micro F1, the task-specific table identifies the part-of-speech figures as word accuracy.

Topic classification on Argia headlines

The Basque Headlines Topic Classification dataset, abbreviated BHTC, contains 12k short news descriptions collected from the Basque weekly Argia. Each is assigned one of twelve topics. The paper reports a 70% training split, with 15% for development and 15% for testing, and makes the dataset available under a Creative Commons license. The short inputs matter to the task because the classifier has to infer the topic from a headline or brief description. It cannot draw on the article body as additional evidence.

The conventional baseline uses logistic regression on TF-IDF features. Those features weight terms by their occurrence in the input and how widely they appear across documents. The baseline scores 63.00 micro F1 and 49.00 macro F1 on the topic test. The FastText and Flair comparisons use the same Flair classifier settings, with a maximum of 50 epochs, a learning rate of 0.1, mini-batches of 64, and patience of 3. Patience controls how long training continues without an improvement under the stopping criterion. Fine-tuning runs for three epochs on both BERT versions using batches of 16 and a 2e-5 learning rate.

Macro F1 on the BHTC Argia headline test

BERTeus leads the comparison, and each Basque Media Corpus representation improves on its public counterpart.

Macro F1 on the BHTC Argia headline testTF-IDF logistic regression: 49.00TF-IDF logistic regression49.00FastText-Wikipedia: 54.98FastText-Wikipedia54.98FastText-Common-Crawl: 3.73FastText-Common-Crawl3.73FastText-BMC: 60.14FastText-BMC60.14Flair-official: 55.83Flair-official55.83Flair-BMC: 59.38Flair-BMC59.38mBERT: 48.38mBERT48.38BERTeus (this paper): 63.46BERTeus (this paper)63.46
The numbers
System or settingMacro F1
TF-IDF logistic regression49.00
FastText-Wikipedia54.98
FastText-Common-Crawl3.73
FastText-BMC60.14
Flair-official55.83
Flair-BMC59.38
mBERT48.38
BERTeus (this paper)63.46

BERTeus also leads the topic test in micro F1 at 76.77, compared with 68.42 for mBERT. The FastText-BMC classifier reaches 69.45 micro F1, while the classifiers using the official Wikipedia and Common Crawl vectors reach 65.00 and 28.82, respectively. Flair-BMC scores 68.61 micro F1, compared with 65.25 for official Flair. The paired comparisons therefore all favor the BMC-trained version, although the public alternatives begin at very different levels.

The two F1 measures reveal differences that an overall ranking would conceal. mBERT has a higher micro F1 than TF-IDF logistic regression but a lower macro F1. FastText-BMC scores above mBERT on both measures in this task setup. Flair-BMC is close to the FastText-BMC classifier on both measures, and BERTeus has the strongest macro F1 as well as the strongest micro F1. The authors’ strongest practical comparisons here thus include a simple supervised baseline, a contextual encoder, and static vectors used within a supervised sequence classifier.

The Common Crawl result is conspicuously low on this dataset, including its macro F1 of 3.73. The figures establish how that release performed with this classifier and split. The paper does not give a class-by-class account of this run or an analysis of what in the representation or task training produced the pattern. The official Wikipedia result is the stronger of the two public FastText comparisons for these headlines, and FastText-BMC improves on it as well.

Sentiment classification on the Behagune tweets

The sentiment task classifies Basque tweets about culture as positive, negative, or neutral. The dataset contains 2,936 examples. The paper reports an 80% training split, with 10% for testing and 10% for development. Its overall class distribution is 32% positive, 54% neutral, and 14% negative. In a collection where the neutral class is the largest and the negative class the smallest, micro F1 is influenced more by the decisions made on neutral items, while macro F1 gives the smaller class equal influence.

The comparison reuses the topic classifier settings for the FastText and Flair inputs and the topic fine-tuning settings for both BERT versions. The previous baseline is a support vector machine, or SVM, which separates classes using the available text features. It scores 74.02 micro F1 and 69.87 macro F1 on this benchmark. The baseline is a relevant point of comparison because an improvement on the public release of a representation can still fall short of the strongest earlier supervised result.

Macro F1 on the Behagune sentiment test

BERTeus leads the earlier sentiment baseline and the other pretrained alternatives when the classes receive equal weight.

Macro F1 on the Behagune sentiment testSVM baseline: 69.87SVM baseline69.87FastText-Wikipedia: 66.72FastText-Wikipedia66.72FastText-Common-Crawl: 58.89FastText-Common-Crawl58.89FastText-BMC: 68.14FastText-BMC68.14Flair-official: 67.73Flair-official67.73Flair-BMC: 69.05Flair-BMC69.05mBERT: 66.02mBERT66.02BERTeus (this paper): 76.14BERTeus (this paper)76.14
The numbers
System or settingMacro F1
SVM baseline69.87
FastText-Wikipedia66.72
FastText-Common-Crawl58.89
FastText-BMC68.14
Flair-official67.73
Flair-BMC69.05
mBERT66.02
BERTeus (this paper)76.14

On the sentiment test, BERTeus reaches 78.10 micro F1 and mBERT reaches 71.02. The paper reports BERTeus gains over the SVM baseline of 4.08 points in micro F1 and 6.27 in macro F1. The authors attribute the stronger macro result in particular to better classification of positive and negative tweets. That interpretation fits the scoring rule, under which those classes have equal influence with neutral in the class average. The results give the larger macro gain as a direct benchmark comparison, while the paper does not provide separate class scores from which to examine the contribution of each.

FastText-BMC gives 72.19 micro F1, compared with 71.10 for FastText-Wikipedia and 66.16 for FastText-Common-Crawl. Flair-BMC gives 72.95 compared with 72.74 for official Flair, a small change on this measure. Their macro scores show a clearer separation. Both BMC embedding versions remain below the SVM baseline in micro and macro F1, even as they improve on the corresponding public embeddings. BERTeus is the entry that improves on the previous baseline on both sentiment measures.

Part-of-speech tagging on the Basque treebank

Part-of-speech tagging assigns a grammatical category to a word in context. The Basque dataset used here is the Universal Dependencies 1.2 treebank, a collection of annotated sentences derived from part of the Basque Dependency Treebank. It contains 5274 sentences and 60,563 tokens and consists mainly of literary and journalistic text. It supplies training, development, and test partitions. By using this version, the authors can compare with a published result on the same benchmark.

The earlier system uses Byte Pair Embeddings in an LSTM tagger. The embeddings are learned after Byte Pair Encoding segments text by repeatedly combining frequent pairs of adjacent symbols into new units. This makes the baseline relevant to the authors’ interest in representing internal word structure, while using a different way of learning sub-words from the unigram procedure adopted for BERTeus. Its published test word accuracy is 96.10.

The FastText-BMC system reaches 96.14 word accuracy on the part-of-speech test. The scores with FastText-Wikipedia and FastText-Common-Crawl are 94.09 and 91.95. Official Flair already gives 97.50, and Flair-BMC reaches 97.58. The mBERT tagger scores 96.37, while BERTeus achieves the highest word accuracy in the comparison at 97.76. The Flair results show that the official Basque embeddings were already a strong starting point for this task. The BMC version has a small lead over that release, and both Flair entries are above the previous published baseline. BERTeus finishes ahead of both.

Accuracy compresses the full set of tagging decisions into a measure that is easy to compare on a fixed split. It does not reveal which grammatical categories changed most. The difference between Flair releases is already small in the reported average, and the paper gives neither a breakdown by tag nor the spread across runs. The well-defined comparison is word accuracy on the designated test set, with the Basque-specific version ahead within each of the three representation families.

Named entity recognition on EIEC

Named entity recognition identifies spans of words that function as named entities and assigns a type to each span. The authors evaluate on EIEC, a Basque corpus with manually established target annotations. It contains 44K tokens and 3817 unique entities on the training side, and 15K tokens and 931 entities on the test side. Its types are Location, Person, Organization, and Miscellaneous. The training material contains 156 Miscellaneous entities and around 1200 entities for each of the other types. The paper emphasizes that Miscellaneous is comparatively sparse.

The published baseline uses a perceptron with shallow features and clustering information built from unigram matching. It scores 80.66 precision, 73.14 recall, and 76.72 F1 on EIEC. The official Flair and mBERT entries both exceed this baseline in F1. The official FastText entries have much lower recall than precision, so their F1 scores trail the previous result in spite of recovering some entities correctly.

Entity F1 on the EIEC named entity test

BERTeus achieves the highest entity F1, while FastText-BMC improves substantially on both official FastText releases.

Entity F1 on the EIEC named entity testPublished perceptron baseline: 76.72Published perceptron baseline76.72FastText-Wikipedia: 59.23FastText-Wikipedia59.23FastText-Common-Crawl: 55.53FastText-Common-Crawl55.53FastText-BMC: 70.56FastText-BMC70.56Flair-official: 80.82Flair-official80.82Flair-BMC: 83.48Flair-BMC83.48mBERT: 81.52mBERT81.52BERTeus (this paper): 87.06BERTeus (this paper)87.06
The numbers
System or settingF1
Published perceptron baseline76.72
FastText-Wikipedia59.23
FastText-Common-Crawl55.53
FastText-BMC70.56
Flair-official80.82
Flair-BMC83.48
mBERT81.52
BERTeus (this paper)87.06

FastText-BMC gives 74.12 precision and 67.33 recall. The official Wikipedia entry gives 72.42 precision and 50.28 recall, while the official Common Crawl entry gives 72.09 precision and 45.31 recall. The higher recall with the new vectors is the prominent change in those comparisons. The system finds more annotated entities without a drop in reported precision. Its F1 still falls below the earlier published baseline. That makes the result evidence about the value of the embedding substitution within the family, alongside a separate judgment about which full taggers lead the benchmark.

Flair-BMC reaches 84.32 precision and 82.66 recall. Official Flair gives 81.86 precision and 79.89 recall. BERTeus reaches 87.95 precision and 86.11 recall, compared with 81.24 precision and 81.80 recall for mBERT. Both precision and recall increase when the BMC Flair embeddings replace the public ones and when BERTeus replaces mBERT. The paper calls attention to the balance of precision and recall for Flair-BMC and BERTeus. Their F1 gains reflect improvements in recovering annotated entities as well as in the correctness of their entity predictions.

What the ablations show

What the matched comparisons isolate

The paper offers matched comparisons, two illustrative tokenizations, and an entity error example. It has no component-by-component ablation that isolates the effects of corpus size, text quality, vocabulary learning, and masking. Its most consistent controlled comparison is the substitution of an existing representation with a Basque Media Corpus counterpart inside the corresponding task setup. This tests a practical choice between available representations. The extent to which it explains the advantage depends on what changed during pretraining.

The Flair comparison comes closest to the question of changing the corpus while keeping the type of representation stable. The official and BMC versions both read character strings and yield contextual embeddings. The study evaluates them with the same downstream approach. A gain can therefore be obtained without introducing a new tagging architecture or combining Flair with additional static vectors. The corpus replacement changes size and source composition together. The Flair results support the usefulness of training on the authors’ collection without resolving which property of the collection mattered most.

For FastText, the paper compares the vectors in common task setups, and the width of the vectors stays the same. The official Wikipedia release was produced using skip-gram, while FastText-BMC uses position-weighted CBOW. The official Common Crawl vectors use position-weighted CBOW as well, but the paper describes that release and the BMC run in terms of their respective configurations. The gains over both releases show that the new vectors are a dependable alternative across these particular evaluations. No comparison retrains the public vectors on exactly the same schedule and changes just the corpus, or gives the BMC setup a matched quantity of public-source text.

The breadth of the gains still matters. BMC FastText performs better than both public alternatives on the tested classifications and taggings. This includes the sentiment task, whose inputs are tweets about culture even though the BMC sources are encyclopedic and journalistic. The result suggests that the advantage can carry across some differences between pretraining sources and task inputs. It does not make all such differences interchangeable. The same vectors perform quite differently across the two tagging tasks when judged against their established baselines.

The paper’s cross-task discussion also highlights that FastText-BMC, used inside the Flair document classifier, exceeds mBERT on the topic and sentiment tests. That is a comparison between complete predictors, including different ways of using their initial representations. It makes the practical point that the choice between static vectors and a multilingual contextual encoder can turn on the task and on the text behind the representation. For evidence about the effect of an input substitution, the within-family results are cleaner. For evidence about what a user could expect from the evaluated systems, the across-family comparisons are relevant in their own right.

What the BERT comparison changes together

At the encoder level, BERTeus stays close to BERT BASE. This rules out an explanation framed simply as a switch to a different broad kind of encoder. The comparisons then combine a larger, Basque-focused training collection with a Basque-only vocabulary and parameters dedicated to that language. They also include the unigram vocabulary procedure, the selected vocabulary size, and whole-word masking. These choices work together in BERTeus and are evaluated together against the public multilingual release.

The authors view the larger, better-suited corpus and the language-specific segmentation as important contributors. The paper gives tangible evidence of what the latter changes. The medikuarenera example shows that the stem can survive as a recognizable piece alongside separate endings. In the mBERT segmentation that stem is divided across pieces. The etxerantz example shows a longer piece retained in the Basque-specific segmentation as well. An encoder trained on these units receives a different account of where recurring pieces of words begin and end.

Those examples show the input change directly. They cannot establish how frequently a more recognizable segmentation occurs in a corpus or how much of the final score it explains. There is no quantitative survey of linguistic segment boundaries across the vocabulary and no task experiment that exchanges the tokenizers while holding the other pretraining choices constant. The vocabulary is interesting as a plausible contribution precisely because the authors can show that some individual words reach the encoder differently. A numerical attribution to that change would require another comparison.

Whole-word masking has a related but distinct role. The vocabulary determines which pieces represent the word. Masking determines which information remains visible while the encoder learns to recover the pieces. Selecting a whole word’s sub-words together reduces opportunities to identify a missing piece from other visible pieces within the same word. The paper describes this motivation and cites an example of earlier success with the strategy. The Basque experiments do not measure its contribution separately. Keeping next sentence prediction, in contrast, deliberately retains a pretraining feature of the original BERT setup, in spite of the authors’ awareness that earlier work questioned its necessity.

A concrete example of entity typing

The paper compares mBERT and BERTeus on a sentence from EIEC in which the United States and Western Europe are described as giving support on an issue involving Chechnya. The names ordinarily evoke places. In this use, the annotation treats the two spans as organizations because they stand for collective actors in the event. This is an instance of metonymy, where an expression refers to something associated with its usual referent.

The systems agree about the spans for the United States and Western Europe. Their disagreement concerns the type assigned to those spans. mBERT marks both as locations. BERTeus labels both organizations, in agreement with the reference annotation. Both systems also agree with the location label for the mention of Chechnya. The example therefore illustrates a challenge beyond spotting names. A recognizer must use the way a name functions in a sentence to choose between plausible categories for the same expression.

That example gives the aggregate F1 result an interpretable instance of changed behavior. It shows that BERTeus can make the intended contextual distinction in this case. It supplies no estimate of how often either system makes the same distinction across EIEC, and it cannot establish which pretraining choice made the difference. The paper has no separately scored set of metonymic mentions. The example belongs alongside the precision and recall results as a description of one error and its correction.

The authors also note that the separation between public and BMC-trained versions is more pronounced on entity recognition than on part-of-speech tagging. They suggest that the small EIEC collection could help explain this pattern and explicitly call for more experimentation. The benchmark comparison makes the variation in gains visible. The tasks differ in their training material and annotation targets, and they use different metrics. The reported comparisons therefore leave the proposed explanation open.

Limitations

Limits identified by the authors

The authors designed the experiments to compare corresponding public and Basque-specific releases. They say they did not optimize every system for its best attainable result on each dataset. Their treatment of Flair makes this intention concrete. Prior work recommended combining Flair’s contextual embeddings with static vectors, while this evaluation keeps the Flair embeddings as a distinct option so the public and BMC versions can be compared. The scores describe the documented setups. They leave open how a more extensively adapted Flair system would rank.

The same choice guided BERTeus. The authors retained a BERT BASE-style encoder and kept next sentence prediction to preserve comparability. They acknowledge that newer pretraining variants reported stronger results in other contexts and that task-specific adaptation might yield further gains. Their claims of improved Basque benchmark performance concern the tested systems at the time of the paper. The design leaves both a stronger possible training recipe and a more thoroughly tuned downstream pipeline for future work.

They also mark the explanation for the larger gains on named entity recognition as tentative. EIEC is small, but the paper does not vary the amount of EIEC training material or repeat the analysis across several annotated collections of different sizes. A direct test of the proposed size effect would require observations the paper does not report. The authors’ suggestion is best read as a possible interpretation of the variation across tasks.

Limits visible in the experimental design

A central limit is that the study evaluates a collected corpus as a package. A larger, structured Basque corpus is useful in these comparisons, but the roles of volume, source, and cleanliness cannot be estimated individually. The study has no size-matched versions of the BMC and public corpora, no repeated training with progressively more BMC text, and no experiment removing individual sources. This matters if the goal is to understand how to reproduce the result with a different collection. The paper identifies effective inputs and documents their origins. It provides little evidence about how much of each kind of input is needed.

Argia illustrates why source and task sometimes deserve separate attention. The BMC includes Argia material, and the topic benchmark comes from Argia headlines. Sharing an outlet can give the pretrained system familiarity with its subject matter and style. The paper’s corpus and dataset descriptions identify the source relationship, but they do not establish whether the benchmark headlines or their corresponding articles appear in the unlabeled training material. Evidence of common provenance alone cannot settle that question. The result directly describes classification of held-out labeled headlines in the reported setup.

The multilingual comparison also has a defined scope. It uses supervised Basque evaluation to compare a Basque-only encoder and mBERT, whose shared capacity supports many languages. The experiments establish the value of specialization under the tested conditions. They do not weigh that value against the usefulness of a common encoder across languages or evaluate transfer with little or no labeled Basque data. They also do not evaluate what the same corpus collection and training strategy would yield in other less-resourced languages. Basque provides the case studied, including its morphology, public resources, and available benchmarks.

The averages across five runs give a more informative headline measure than one randomly initialized result. The results tables give means without corresponding dispersion or intervals. Consequently the direction of the reported mean changes is clear, while the size of run-to-run variation is unavailable. This is especially consequential for the small gaps between the Flair versions on sentiment micro F1 and part-of-speech word accuracy. The paper’s broader pattern spans several tasks and representation families, but an individual close ranking warrants an interpretation tied to the reported mean.

Finally, the aggregate measures have limited diagnostic reach. The sentiment task provides a class distribution and the authors’ observation that BERTeus helps on positive and negative classes, but it does not supply class-specific scores. The entity test has an infrequent Miscellaneous class, and its aggregate F1 does not show whether the gain extends to that class. Word accuracy likewise leaves the behavior on individual grammatical tags unresolved. The reported metrics suffice to compare systems under the benchmarks’ scoring rules. More specific claims about reliability on rare outputs, difficult constructions, or unfamiliar kinds of text require evidence at that level.

What came after

Later papers that cite the Basque study take up different parts of the problem it posed. Some emphasize access to training text or task annotations. Others emphasize whether multilingual systems should be judged separately on the languages they cover, or put shared representations to use in a new research setting. The citations establish a connection to the Basque paper. For these later works, the documented topics identify the questions they pursued without establishing which BMC resources or training procedures, if any, they reused.

Parsing with Multilingual BERT, a Small Corpus, and a Small Treebank takes up the combination of a shared encoder, a limited text collection, and scarce syntactic annotation. Its focus is parsing, the recovery of grammatical structure from a sentence. A treebank supplies examples of that structure, while a text corpus supplies language material for a different part of the pipeline. That distinction echoes the Basque study’s use of a separate pretraining collection and a grammatically annotated benchmark. The later work’s stated setup keeps multilingual BERT at the center and addresses what it can support under limited resources. Parsing with Multilingual BERT

The Maltese study puts pretraining data quality and quantity explicitly at the center of its question. It introduces a corpus and BERT resources for Maltese. This is close to the Basque paper’s decision to treat the initial text collection as part of the research contribution. The Basque comparisons showed what happened after a deliberate collection replaced public starting points, with corpus properties changing together. The later work’s stated focus makes quality and quantity themselves the objects of study in another language. Its connection is clearest at the level of the resource-building question. Pre-training Data Quality and Quantity for Maltese

Testing the Predictions of Surprisal Theory in 11 Languages brings a multilingual perspective to a question in psycholinguistics. Surprisal concerns how unexpected a word is given its context. The later study sets out to test predictions about surprisal across languages, which is a different purpose from classifying headlines or tagging a treebank. The connection is the importance of language coverage when a computational representation is part of the measurement. In the Basque paper the representation affects supervised predictions. In a multilingual test of surprisal theory, the stated scope places the ability to examine contextual expectations across languages at the center of the investigation. Testing the Predictions of Surprisal Theory

Lost in Translation considers large language systems in non-English content analysis. That setting brings the suitability of language technology into an applied research workflow, where the output of an analysis may depend on how well the system handles the language of the source material. The Basque paper offers a concrete antecedent in its comparisons on news topics and tweet sentiment, both of which turn collections of text into categories. The later work’s stated subject is wider than these Basque classification tasks. Its connection lies in treating the language of the texts as consequential to the analysis. Lost in Translation

IberoBench introduces a benchmark for evaluating large language systems in Iberian languages. It continues the evaluation side of the Basque paper’s approach. Agerri and colleagues use labeled target-language datasets to make performance differences visible across tasks. IberoBench places the construction of a benchmark for a group of languages at the center of its contribution. The stated scope establishes the direction of that later work without specifying reuse of the Basque headline, tweet, treebank, or entity datasets. IberoBench

Beyond Multilinguality focuses on typological limitations in multilingual systems for Meitei. Typology concerns structural properties that languages can share or differ on. The connection to the Basque study is its attention to the forms a language takes and the possibility that shared multilingual resources fit some of those forms poorly. In the Basque paper, split words provide an illustration of that issue, while the task scores reflect the combined differences between the systems. The Meitei work makes the relationship between multilingual coverage and the structure of a particular language its stated topic. Beyond Multilinguality

Cite

Cite as Rodrigo Agerri, Iñaki San Vicente, Jon Ander Campos, Ander Barrena, Xabier Saralegi, Aitor Soroa and Eneko Agirre. 2020. Give your Text Representation Models some Love: the Case for Basque. 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{agerri2020give,
  title = {{Give your Text Representation Models some Love: the Case for Basque}},
  author = {Rodrigo Agerri, Iñaki San Vicente, Jon Ander Campos, Ander Barrena, Xabier Saralegi, Aitor Soroa and Eneko Agirre},
  booktitle = {Proceedings of the Twelfth Language Resources and Evaluation Conference},
  year = {2020},
  url = {https://aclanthology.org/2020.lrec-1.588/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/agerri-2020-give-your-text-representation-models/