---
title: "Exploring the Power of Romanian BERT for Dialect Identification"
description: "Zaharia and colleagues test Romanian BERT on dialect identification and show how performance changes from long news articles to short…"
canonical: "https://research.elamur.ai/free/en/papers/zaharia-2020-exploring-power-romanian-bert-dialect/"
---
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/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/zaharia-2020-exploring-power-romanian-bert-dialect/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2020](https://md.research.elamur.ai/free/en/papers/2020/) / Exploring the Power of Romanian BERT for Dialect Identification

# Exploring the Power of Romanian BERT for Dialect Identification

Paper · 2020 · George-Eduard Zaharia, Andrei-Marius Avram, Dumitru-Clementin Cercel et al.

**Authors:** George-Eduard Zaharia, Andrei-Marius Avram, [Dumitru-Clementin Cercel](https://md.research.elamur.ai/free/en/authors/dumitru-clementin-cercel/) and [Traian Rebedea](https://md.research.elamur.ai/free/en/authors/traian-rebedea/) · **Year:** 2020 · **Venue:** Proceedings of the 7th Workshop on NLP for Similar Languages, Varieties and Dialects · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 7th Workshop on NLP for Similar Languages, Varieties and Dialects · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2020.vardial-1.22/)
- [PDF](https://aclanthology.org/2020.vardial-1.22.pdf)

## Summary

A news article can contain several hints about where it was written. A short social media post may contain none. Zaharia and colleagues ask how well a system can distinguish Romanian from Moldavian writing when it learns from news articles and is then tested on much shorter texts. They study this question for the Romanian Dialect Identification shared task at VarDial 2020. The practical motivation extends to tasks such as opinion mining, where the location associated with a text can help explain the attitudes expressed in it.

The authors start with Romanian BERT, or Ro-BERT, which was pretrained on Romanian text, and compare it with multilingual BERT. Their strongest dialect classifier processes long articles in overlapping windows, averages the resulting token representations, and projects the average to a score for the binary decision. They also try training with small changes to the input representations and building a classifier that combines contextual, word-level, and character-level information. The predictions are evaluated on the news test split of the Moldavian and Romanian Dialectal Corpus, known as MOROCO, and on the shared task’s separate test set, drawn mostly from social media.

The windowed classifier leads the authors’ alternatives on both tests. On the MOROCO-RDI news test, it reaches 96.23% macro-F1, with micro-F1 and weighted-F1 both at 96.25%. Macro-F1 gives the dialects equal weight, while weighted-F1 gives greater weight to the dialect with more examples. On the RDI shared-task test, the same approach scores 64.80% weighted-F1 and places fifth among 8 teams. The results table gives its macro-F1 there as 64.75%, consistent with the abstract and introduction, although the accompanying results discussion reverses the micro and macro labels for this system.

The error examples help explain what changed between the tests. A word linked to Moldavian usage can give the classifier a useful clue, and names that escaped masking can point to the source of the text. Other posts contain a generic phrase or little beyond placeholders for names. The paper shows that adapting Romanian BERT improves dialect classification on the news benchmark and gives the team its best shared-task submission. The much lower shared-task scores show how little the news evaluation alone says about performance on short posts.

## Deep dive: Exploring the Power of Romanian BERT for Dialect Identification

Zaharia and colleagues test Romanian BERT on dialect identification and show how performance changes from long news articles to short social media posts. · about 32 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

#### Predicting a variety from a piece of writing

The system sees a passage of text and must assign it to the Romanian or Moldavian class. This is a form of [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/). The two labels name closely related varieties, so the task can turn on details that a broader language identification system could ignore. A passage may be perfectly intelligible to readers on either side of the distinction and still contain a word or a construction associated with one of the labels. It may also be so short or so generally worded that a reader would struggle to identify its variety from the text alone.

The paper frames dialect identification as information that could help another analysis. In opinion mining, for instance, the authors suggest that a writer’s location can matter when interpreting attitudes towards a subject. That motivates the classification problem without making location and dialect interchangeable. The experiments give the system text and ask it to recover the dataset label. They do not give it a verified account of the writer’s residence, linguistic background, or reasons for choosing a particular expression.

The authors describe Romanian as an under-resourced language despite the availability of several resources for distinct purposes. They point to CoRoLa as a reference corpus for contemporary Romanian, alongside a biomedical corpus, a Romanian speech corpus, and a Romanian WordNet. They also discuss a corpus specifically annotated for names of entities. These resources illustrate different kinds of coverage. A collection of speech, a lexical resource, and a collection of texts with entity labels can each support Romanian language research, but the assignment of a dialect label to a short written passage calls for a different kind of evidence. The resource the paper names for entity annotation is [RONEC](https://md.research.elamur.ai/free/en/papers/dumitrescu-2020-introducing-ronec-romanian-named-entity/).

The benchmark that makes the dialect experiment possible is MOROCO. Its creators gathered news from websites in Romania and Moldavia and used the sites’ top-level domains to assign dialect labels. That makes it possible to assemble a substantial collection without having someone inspect every passage for dialect features. It also fixes the meaning of the benchmark label. A classifier succeeds when it predicts the label associated with the source, even if the words in a particular document could naturally occur in either variety. The corpus and its tasks originate in [MOROCO](https://md.research.elamur.ai/free/en/papers/butnaru-2019-moroco-moldavian-romanian-dialectal-corpus/).

#### Why the shared task is a different test

The paper separates the binary dialect task on MOROCO, which it calls MOROCO-RDI, from the Romanian Dialect Identification shared task, abbreviated RDI. The distinction matters because both evaluations ask for the same kind of label. In MOROCO-RDI, the training examples and the test examples are news texts of much the same kind. The shared task draws its evaluation material mostly from social media. The paper describes its validation material as long texts and the shared-task test items as short entries based on tweets.

A system that learns from articles can collect evidence across a passage. A distinctive term may occur only in one paragraph, and a recurring expression may become persuasive when it occurs in several. With a short post, the system may have essentially a headline, a question, or a fragment. A spelling or word choice can still be informative, but only if it appears. When the text changes source and shrinks at the same time, the classifier must cope both with fewer words and with a potentially different distribution of the words and constructions it sees.

News also exposes the classifier to cues that belong to the publishing environment. A public figure’s name can correlate with one country, a subject can be covered disproportionately by one collection of sites, and a website can contribute recurring turns of phrase. The corpus creators replaced named entities with a placeholder to reduce reliance on clues of the first kind. That preprocessing decision gives the study a more specific question to ask of the remaining text. It also matters when the classifier encounters a very short item, because masking a substantial part of an already short passage can remove much of what the reader could use.

#### What earlier dialect classifiers used

The paper describes Romanian dialect work that used recurrent neural networks with word representations. A recurrent network processes elements of a sequence in order and carries information forward as it goes. Long short-term memory networks and gated recurrent units use gates to regulate what information remains available. Such designs give a classifier a way to use the order of words and the context around them. The paper cites [Gated recurrent units](https://md.research.elamur.ai/free/en/papers/cho-2014-learning-phrase-representations-rnn-encoder/) as one of the approaches used in this line of work.

Other approaches in the Romanian literature start from similarities between samples or recurring patterns of characters. The paper describes an ensemble using a triplet loss with convolutional networks. Training with a triplet asks the system to bring a reference example closer to a positive example in its learned representation and move it farther from a negative one. The paper also cites work coupling a support vector machine, which separates classes using their features, with character n-grams. An [n-gram](https://md.research.elamur.ai/free/en/concepts/n-gram/) is a run of neighboring units. Character n-grams can register spelling patterns and parts of words even when an entire word is uncommon.

Some of the Romanian studies the authors discuss use MOROCO for related tasks such as cross-dialect topic identification. There the label concerns what a text is about, and the challenge is to train on one variety and recognize topics in the other. Dialect identification keeps the variety itself as the target. The related work provides examples of useful architectures and representations, but a topic classifier and a dialect classifier have different reasons to pay attention to the same expression. A feature that helps recognize a news topic across varieties may offer little evidence about which variety a document belongs to.

The authors also draw on research about Arabic dialects. The line of work around the [MADAR shared task](https://md.research.elamur.ai/free/en/papers/bouamor-2019-madar-shared-task-arabic-fine/) included recurrent techniques and BERT-based approaches. Other studies used character and word n-grams with multinomial Naive Bayes, or compared logistic regression and support vector machines with recurrent networks. The paper also discusses string kernels, which compare texts through character patterns, and a convolutional approach that works directly with characters. Together these studies illustrate why a dialect classifier can start either from a learned representation in context or from recurring pieces of the written form. The n-gram approach appears in [Fine-Grained Arabic Dialect Identification](https://md.research.elamur.ai/free/en/papers/salameh-2018-fine-grained-arabic-dialect-identification/), and the string-kernel approach in [UnibucKernel Reloaded](https://md.research.elamur.ai/free/en/papers/butnaru-2018-unibuckernel-reloaded-first-place-arabic/).

The examples from German dialect identification widen that set of options. The paper reports earlier work using traditional classifiers and ensembles on interview transcriptions. It also describes work combining character-level convolution, string-kernel regression, and ensembles in connection with Swiss German tweets. Those studies play a contextual role in Zaharia and colleagues’ argument. Different languages and kinds of text can make different features valuable, and character-based techniques were an established alternative when the authors considered how to augment a contextual encoder.

The authors’ main choice is to use an already pretrained encoder and adapt it to the dialect labels. A [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/) uses attention to let the representation at a position draw on other positions in the input. BERT supplies a bidirectional encoder, so a token can be represented using context on either side. At the time of the study, the authors could start either from multilingual BERT or from a Romanian-specific counterpart and then ask which served their task better. These are the lines of work represented by [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/) and [The Birth of Romanian BERT](https://md.research.elamur.ai/free/en/papers/dumitrescu-2020-birth-romanian-bert/).

### The method, step by step

#### Start with an encoder that has already seen text

The starting point is a system that can turn a sequence of tokens into numerical representations. A token is a unit of input after the text has been segmented. It may correspond to a whole word or to part of one. A representation, often called an embedding, is a vector of numbers that the classifier can use in its calculations. The same token can acquire different contextual representations when the surrounding words differ. The encoder can therefore supply evidence about both the identity of a token and its use in the passage.

Multilingual BERT, called M-BERT in the paper, was pretrained on over 100 languages. It gives the authors a broadly trained starting point. Ro-BERT concentrates its pretraining on Romanian and uses material from OPUS, OSCAR, and Wikipedia. It was already available in cased and uncased forms. The paper reports that the authors of Ro-BERT trained it with masked language prediction and next sentence prediction. In the first objective, the encoder learns to support recovery of hidden input tokens. In the second, it learns to predict a relation between a pair of sentences. Both objectives predate the dialect experiments and can be applied without Romanian-versus-Moldavian labels. The multilingual starting point is also discussed in [How Multilingual Is Multilingual BERT?](https://md.research.elamur.ai/free/en/papers/pires-2019-how-multilingual-is-multilingual-bert/).

The paper gives some background on why the Romanian encoder was an attractive candidate. Its original evaluation used the Romanian RRT corpus for independent predictions of parts of speech and for a joint analysis involving tags, grammatical features, lemmas, and dependency relations. The tag records a word’s grammatical category, a lemma is its dictionary form, and a dependency relation describes how it connects to another word in the sentence. The original evaluation also used RONEC to assess entity recognition. There the system predicts labels that distinguish the beginning and continuation of an entity from material outside it. The reported advantages over M-BERT range between 1% and 3% on those earlier Romanian tasks. These comparisons motivated the choice of encoder. The dialect experiments evaluate a different output.

In [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/), a pretrained encoder is adapted to a labeled task. Here the supervised target is the dialect label. Standard Ro-BERT fine-tuning provides a point of comparison for the custom approach. The custom approach adds a way of obtaining representations from successive parts of the same long input and combining that evidence for a single label. This is where the length of the news articles enters the design.

#### Turn the passage into input tokens

For its custom approach, the team uses byte-pair encoding, a form of [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/). The input vocabulary can represent a word as smaller pieces where needed. Token counts therefore depend on the tokenizer. A document of a given length in whitespace-separated words may take up more positions after segmentation, and the same document may occupy different numbers of positions under Ro-BERT and M-BERT. The length cap in the custom system applies to these tokenized positions.

The team adds a special token for the named-entity marker `$NE$`. The marker was already used by MOROCO to replace names in the articles. Keeping it as one input unit lets the encoder represent the fact that something was masked without treating the marker as an ordinary spelling. The surrounding words still enter the classifier, and the placeholder can be part of a larger contextual pattern. In the examples the authors discuss, some actual names remain in the text in spite of the masking procedure.

After tokenization, a short input can be represented in a single pass. For long inputs the authors supply consecutive windows with 512 tokens apiece. The first 128 tokens of a later window are shared with the preceding window. A token near the end of an earlier input can therefore reappear with material that lay beyond that window’s boundary. The encoder processes each window separately. The overlap gives tokens at the join a second context within an encoder call, while the document-level classifier receives evidence from the windows together.

How the custom Romanian BERT classifier labels a passage The steps in order.

#### Pool the contextual evidence for one decision

The custom design keeps the representations of the tokens that the encoder produces across its windows, then averages them and applies a projection to obtain a scalar, a single numerical score. Averaging makes it possible to summarize inputs of different token lengths with a vector of a fixed size. The projection converts that vector into the evidence used for the binary prediction. The paper calls this system Custom-Ro-BERT-FT.

The authors describe the averaging in words. Written as a mean of the vectors supplied to the pooling step, the operation is:

```
h̄ = (∑ᵢ hᵢ) ÷ T
```

Here h̄ is the pooled representation for the passage. The index i enumerates the contextual token vectors entering the mean, hᵢ is the vector at that index, and ∑ᵢ adds those vectors component by component. T is the number of vectors included in the sum, ÷ is division, and = gives the resulting value of the mean. The paper describes the subsequent projection to a scalar without specifying it as a separate equation.

The architecture drawing distinguishes a token’s first representation from the representation obtained when the token appears again in an overlapping window. That detail matters because the token’s spelling is only part of the input to its contextual representation. Changing which neighboring tokens the encoder can attend to may change the resulting vector. The custom method can use the contextual evidence from the windows that contain the token. The paper does not give an explicit recipe for weighting repeated positions differently from other positions.

The parameter N counts how many times the encoder is applied to successive windows. Raising N gives a longer document more room before it reaches the maximum permitted length. It also means doing more encoder work for long inputs. The authors compare settings of N while testing Ro-BERT against M-BERT. For the shared-task submission they use the setting that applies Ro-BERT 3 times. Since the shared-task inputs are short, the value of N chiefly shapes how the system is developed on news documents. A brief post does not supply several windows of additional text merely because the classifier can accommodate them.

The standard and custom Ro-BERT fine-tuning runs use Adam with weight decay, known as AdamW, with a learning rate of 2e-5 and a training run of 4 epochs. A learning rate regulates the size of parameter updates, and an epoch is a pass through the training data. Holding the reported optimizer, learning rate, and epoch count in common gives the comparison with standard fine-tuning a firmer starting point. The paper’s optimizer reference is [Decoupled Weight Decay Regularization](https://md.research.elamur.ai/free/en/papers/loshchilov-2017-decoupled-weight-decay-regularization/).

#### Add evidence from word forms

The embedding concatenation system, EC, approaches the dialect decision from another direction. The authors want to make the structure of words available more explicitly. A contextual vector already encodes information about the input word and its surroundings. A character-based representation can emphasize the sequence of letters that forms the word. If two words share a root or an ending, their character sequences give the classifier evidence of that similarity even when they are different vocabulary items. The authors motivate the added representation in terms of [morphology](https://md.research.elamur.ai/free/en/concepts/morphology/).

The character branch separates a word into characters, maps the characters to indices, and passes their sequence through a bidirectional long short-term memory network, abbreviated BiLSTM. The two directions allow the resulting representation to take account of the sequence read from either end. This branch supplies the character-based vector. A separate source of word vectors comes from pretrained fastText embeddings. The third source is the contextual output from the Transformer. The fastText background is described in [Enriching Word Vectors with Subword Information](https://md.research.elamur.ai/free/en/papers/bojanowski-2017-enriching-word-vectors-subword-information/).

Concatenation appends components of these vectors along the feature dimension. In the paper’s description, the representations have the same number of positions before this step. That alignment lets the classifier collect the different kinds of evidence at a common input position. The combined sequence then goes through another BiLSTM. This network works over the combined input representations, whereas the character network works inside the individual word. A linear layer produces the final score and a sigmoid maps it to the range used for the binary decision.

For EC, the authors use [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/) at a learning rate of 0.001. They report a BiLSTM hidden size of 500, a maximum input length of 280 tokens, and training for 8 epochs with early stopping. Hidden size specifies the width of the network’s internal representation. Early stopping uses a stopping policy during training so that parameter updates need not continue simply because a longer run is possible. The 280-token cap also means EC is tested with a different input budget from the custom windowed design. Its score evaluates the full system built around the combined embeddings.

#### Change the training inputs in representation space

The authors’ other approach is adversarial training with FreeLB. In this setting, an adversarial perturbation is a small change to the numerical input representation selected to make the classification harder. The classifier still trains against the original label. The change is made to word-level embeddings, so the method does not require the authors to write new posts or to find a spelling change with a known dialect label. This is a different way to use the same supervised examples during training. The method comes from [FreeLB](https://md.research.elamur.ai/free/en/papers/zhu-2019-freelb-enhanced-adversarial-training-natural/).

FreeLB starts with a batch of examples and makes steps that seek perturbations under which the current classifier incurs greater loss. Loss is the training penalty associated with its predictions. These perturbation steps produce gradients, which describe how changing the parameters would change the loss. The method averages gradients from the outputs across the steps so that the training update can reduce the penalty under the difficult input variations. In the authors’ account, this approximates training against high-loss perturbations along the sequence of ascent steps, where ascent refers to the search for changes that increase the loss.

The team reports Adam for adversarial training, an initial learning rate of 5e-5, weight decay of 0.0, and epsilon of 1e-8. Epsilon is an optimizer constant used in its numerical calculations. Training spans 12 epochs. FreeLB therefore differs from the standard and custom runs in the perturbation procedure and in the reported training schedule. It is an alternative system for the comparison, instead of a perturbation switch operated on an otherwise identical custom run.

### Experiments and results

#### Which texts go into each evaluation

MOROCO contains 33,564 news samples. The paper gives the corpus composition as 45.89% Moldavian and 54.11% Romanian, with more than 10 million tokens across the collection. Its news covers subjects ranging from culture and finance to politics, science, sports, and technology. The original processing strips HTML markup and uses the named-entity placeholder. The top-level domains `.md` and `.ro` supply the Moldavian and Romanian labels respectively. A label is attached to the source of each sample, so it remains available even where preprocessing has removed clues a reader might use.

The corpus supplies several tasks. The authors use its binary dialect classification task, MOROCO-RDI, with 21,719 samples for training, 5,921 for validation, and 5,924 for testing. The other tasks ask for topic labels either within one variety or after transferring from one variety to the other. The dialect results in the paper concern the binary task. Within that task, the held-out MOROCO-RDI test documents are comparable in format to the articles used for training and validation.

The RDI shared-task evaluation uses a separate set of 5,022 samples, mostly taken from social media. This distinction between test sets is essential when reading any of the scores. A MOROCO-RDI test score measures the prediction of source-associated labels for held-out news documents. A shared-task RDI test score measures performance under the change to short social media inputs. The authors can compare the same family of systems across those two evaluations, but the two corpora supply different opportunities to recognize the class.

On whitespace tokenization, the average lengths of the MOROCO training, validation, and test samples are 310.04, 309.92, and 313.65 tokens respectively. The RDI test average is 15.63 whitespace tokens. The maximum on the MOROCO training split is 15,988 whitespace tokens, while the RDI test maximum is 25. The averages help explain why the classifier has fewer chances to see a distinctive expression in the shared task. The maxima explain a different problem, namely why a design for news cannot assume that the input will fit in an ordinary encoder window.

Sub-word segmentation preserves the broad contrast. With the uncased Ro-BERT tokenizer, the MOROCO training, validation, and test averages are 356.08, 355.87, and 360.87 tokens. The RDI test average is 21.71. With the uncased M-BERT tokenizer, the corresponding news averages are 449.70, 450.02, and 455.50, and the RDI test average is 26.65 tokens. For the same evaluation splits, M-BERT takes more token positions on average. The RDI test maxima are 42 Ro-BERT tokens and 44 M-BERT tokens, both well within a single window of the custom design.

The long tail of news lengths matters even with Ro-BERT’s shorter segmentation. On the MOROCO training split, the reported maximum is 18,456 Ro-BERT tokens, compared with 24,169 M-BERT tokens. The maximum on the MOROCO test split is 15,313 Ro-BERT tokens and 20,151 M-BERT tokens. A window budget that accommodates the typical article can still exclude some long documents during the comparison or limit how much text can be encoded. The authors explicitly examine length filtering before comparing the final designs on the entire test sets.

#### Choose the encoder and the window budget

The initial comparison varies the number of encoder calls and evaluates on the MOROCO-RDI test split. The length table gives 512 allowed tokens at N = 1, 896 at N = 2, 1280 at N = 3, and 1536 at N = 4. These are the caps the paper reports. Since the two tokenizers segment texts differently, a shared numerical cap need not admit the same articles for each encoder.

At the 512-token cap, the reported proportions meeting the length condition are 83.60% for Ro-BERT tokenization and 72.38% for M-BERT tokenization. At 896 tokens, they are 95.50% and 92.28% respectively. At the reported cap of 1280 tokens, the corresponding proportions are 98.04% and 96.62%. At 1536 tokens, they are 98.64% and 97.78%. These percentages describe coverage under the length limits. They are separate from the ability to assign the correct dialect label once a document enters the evaluation.

The paper plots results from two evaluation arrangements. In one, the researchers remove overlength documents from the training and test splits. The resulting test asks how well each classifier does on items within its length limit. In the other, training still excludes documents over the limit but evaluation uses the whole MOROCO-RDI test split. The second arrangement tests whether the advantage persists across the entire evaluation population. The training data can still change when the cap or tokenizer changes, even when the test population is held fixed.

Ro-BERT leads M-BERT at every tested N in both arrangements, according to the authors’ reading of the figure. M-BERT’s performance improves faster across the settings they compare. The authors consider the possibility that it could catch up with a larger budget, but did not run that comparison. For the shared-task version they choose N = 3 over N = 4, citing the short test texts, a concern about committing too heavily to long news sequences, and a reported performance difference of 0.6% between those settings. The paper gives that difference in the window comparison without identifying the measure in the sentence that states it.

#### How the scores are counted

The final comparison reports micro-F1, weighted-F1, and macro-F1. F1 combines precision and recall. For an individual dialect, precision concerns how frequently passages predicted as that dialect really have its label. Recall concerns how much of the dialect’s labeled material the system retrieves. A classifier that assigns a label rarely may be precise when it does so but miss much of that class. A classifier that assigns it too freely can have the opposite problem.

The averages put different emphasis on the predictions. Micro-F1 pools the decisions before calculating the score. Macro-F1 averages class scores with equal weight, so strong performance on the class with more examples cannot make its contribution larger by virtue of size alone. Weighted-F1 also averages scores across classes, but weights each by the number of its labeled examples. The paper’s comparison table reports all of these measures. Reading them together helps when aggregate scores separate, as they do for some of the shared-task submissions.

#### The news benchmark

On the complete MOROCO-RDI test set, Custom-Ro-BERT-FT records 96.25% weighted-F1, 96.25% micro-F1, and 96.23% macro-F1. It has the strongest scores in the comparison on this test. FreeLB is close, with 96.15% weighted-F1, 96.15% micro-F1, and 96.12% macro-F1. The standard Romanian BERT run has 94.52% weighted-F1, 94.48% micro-F1, and 94.51% macro-F1. The windowed system and the adversarially trained system each improve on the standard run on the reported measures for held-out news.

The earlier MOROCO results reported by Butnaru and Ionescu serve as an external comparison on that benchmark. Their scores in the paper’s comparison are 94.11% weighted-F1, 94.60% micro-F1, and 94.50% macro-F1. The custom system exceeds those values throughout. EC, by comparison, obtains 86.43% weighted-F1, 86.17% micro-F1, and 86.31% macro-F1 on the MOROCO-RDI test. The added representations and recurrent layers of that particular implementation do not translate into a competitive news classifier.

Weighted-F1 of dialect classifiers on the MOROCO-RDI news test The windowed Romanian BERT classifier leads the comparison, with FreeLB close behind.

**The numbers**

| System or setting | weighted-F1 (%) |
| --- | --- |
| EC | 86.43 |
| Earlier MOROCO result | 94.11 |
| Standard Ro-BERT fine-tuning | 94.52 |
| FreeLB | 96.15 |
| Custom-Ro-BERT-FT (this paper) | 96.25 |

The news result puts the method in the context of an established benchmark. The most direct comparison for the authors’ design is with their own standard fine-tuning run, where the starting Romanian encoder and reported optimization schedule are shared. The comparison with Butnaru and Ionescu addresses a different question. It shows that the resulting score exceeds the earlier corpus benchmark, without isolating any particular change in architecture or training across the two papers.

#### The shared-task test

The paper reports 97.04% macro-F1 on the long-text validation set and 64.75% macro-F1 on the shared-task test. On the complete RDI test set, the results table gives Custom-Ro-BERT-FT 64.80% weighted-F1, 67.10% micro-F1, and 64.75% macro-F1. The weighted score appears consistently in the table and results prose. The prose swaps the two other metric labels for this system. The macro value in the table matches the value given in both the abstract and the introduction, so the table supplies the metric assignments used here.

FreeLB reaches 56.39% weighted-F1, 60.77% micro-F1, and 56.32% macro-F1 on the RDI test. Standard Ro-BERT fine-tuning scores 55.82% weighted-F1, 60.77% micro-F1, and 55.74% macro-F1. Thus FreeLB has a small advantage over the standard run by the weighted and macro measures in this test, while the two tie on micro-F1. The custom run retains a clearer lead over both. EC has the lowest RDI values among the team’s systems, at 46.59% weighted-F1, 55.07% micro-F1, and 46.48% macro-F1.

Weighted-F1 of the authors’ dialect classifiers on the RDI shared-task test The windowed system leads the team’s runs, while FreeLB finishes close to standard fine-tuning.

**The numbers**

| System or setting | weighted-F1 (%) |
| --- | --- |
| EC | 46.59 |
| Standard Ro-BERT fine-tuning | 55.82 |
| FreeLB | 56.39 |
| Custom-Ro-BERT-FT (this paper) | 64.80 |

The team reports experimenting with four architectures and submitting the three strongest of them. Its best submission ranked fifth among 8 participating teams. The leading system in the shared task, included as an external reference in the paper’s table, reaches 78.76% weighted-F1, 78.75% micro-F1, and 78.77% macro-F1. The standings answer how the team’s approach compared with other submissions on the new data. The MOROCO result answers how it compared with earlier work on a news benchmark. The same custom classifier can lead the team’s own comparison on both while placing differently relative to the wider set of competitors.

Across tests, the ordering among the authors’ approaches is fairly stable, but the size of the gap between neighboring approaches changes. On held-out news, FreeLB nearly matches the custom classifier. On the social media test, its weighted result lies much closer to standard fine-tuning. EC occupies the bottom position in both. The news results therefore help identify promising approaches, while offering little basis for estimating the score any of them will reach on a short post from the separate evaluation set.

### What the ablations show

#### Window length changes the input and the sample population

The paper has no component-by-component ablation of the custom system. Its closest controlled comparisons vary the encoder and the number of windows, consider different test-set filtering rules, and compare complete fine-tuning and embedding approaches. It also examines selected errors. These analyses address distinct questions. The window experiments show how the comparison responds to length limits. The complete systems show which design works better in the reported setup. The error examples suggest what evidence particular items might offer.

Within the window experiment, comparing the filtered and full test settings helps distinguish success on admissible lengths from success on the benchmark as a whole. If a system looks good only after long test items are excluded, its performance may partly reflect the selected test population. Ro-BERT’s advantage persists when the whole MOROCO-RDI test set is used. This makes the advantage harder to attribute solely to filtering the evaluation examples. It still leaves a difference in training coverage, because the reported length statistics show that at a common cap the Romanian tokenizer accommodates more of the material.

Increasing N has two effects that the experiments leave coupled. It allows longer documents to meet the training filter, and it lets the classifier process more of the long inputs it encounters. In the plot with filtered test sets, it can also bring more documents into evaluation. A gain across settings can therefore come from additional text within an example, from changes in which examples are seen, or from both. The finding that M-BERT improves faster with larger windows is compatible with its tokenizer needing more room on the same news corpus. The study does not partition the gain into effects of coverage, segmentation, and the encoder itself.

The selection of N = 3 for the submission is best read as a setting chosen in light of the expected evaluation material and the news comparison. The evidence that the higher setting offered only a modest additional benefit comes from MOROCO-RDI. The paper does not present a shared-task comparison of the two settings. An RDI post fits within one window under either tokenizer, so any effect of the training choice on such a post would have to come through the classifier learned from news, rather than extra windows for the post at evaluation time.

#### The complete systems test different ways to supply evidence

The comparison between standard and custom Romanian BERT fine-tuning is the closest test of the value of the custom handling of an input. Both start with Ro-BERT and use the same reported learning rate, optimizer, and epoch count. The custom design changes how long passages are segmented and how token evidence is pooled for the binary output. Its higher scores justify the combined design choice in the reported experiments. The comparison leaves open how much of the gain would persist if only the overlap, the pooling, or the amount of text available to the encoder changed.

This distinction is especially important when explaining the RDI result. The best shared-task system uses an architecture designed to handle long documents, yet its test items are short enough to fit in one window. The performance advantage therefore cannot be explained as a direct consequence of reading multiple windows of a typical test post. The news training examples and the way the classifier summarizes even a single window remain relevant differences. The full-system comparison provides the practical answer that the custom run did better, while the architecture and the length statistics constrain the explanations the evidence can support.

FreeLB asks whether difficult perturbations in embedding space improve the final classifier. On MOROCO-RDI it gives scores above standard fine-tuning and close to the custom run. It also exceeds the earlier MOROCO benchmark values shown in the comparison. On RDI, it improves slightly over standard fine-tuning on weighted and macro F1, ties it on micro-F1, and remains well behind the custom system. The observed benefit thus depends on which comparison is made. Perturbations proved compatible with a strong news result, but that result gives no direct estimate of the gain under a simultaneous change in source and text length.

EC tests a package of additions. It brings character and fastText vectors together with the contextual representations, feeds their concatenation through a recurrent network, and uses its own length cap and optimization schedule. Its lower scores show that this package was unsuccessful for the team’s task. The authors suggest that the added width, depth, and number of parameters could have made it harder to fine-tune. They do not compare character vectors alone, fastText alone, and the combined branches under a common training configuration. Accordingly, the experiment gives a comparative result for EC and a hypothesis about its performance, without identifying the effect of a single representation.

#### What can be seen in individual predictions

The paper’s examples put the short-text problem into concrete terms. One correctly labeled Moldavian item contains a form based on *raion*, a word that the authors identify as Moldavian and gloss as district. The form appears in a discussion of industrial development in district centers. Here even a short passage can contain a choice of vocabulary that bears directly on the language variety. The authors use it to illustrate what recognizable dialect evidence can look like.

The examples also contain surviving names. The authors discuss Dodon and Chicu, which occur in correctly classified Moldavian samples and are also present in the training material. A name can suggest where a piece of news originated without telling the reader much about its grammar or its ordinary vocabulary. The authors’ observation makes these examples ambiguous as evidence for dialect recognition. A reasonable label can come from a linguistic cue, a source cue, or a combination, and the paper does not remove the names and retest those items to find out which evidence determined the prediction.

A misclassified item asks how to protect oneself against the coronavirus. The authors regard the short question as having no clear indication of either variety. Another item offers the word *Primele*, meaning “The first,” followed by placeholders. In a passage of that form, the remaining lexical material could comfortably occur with either label. The named-entity mask can therefore have two consequences at once. It can remove an easy association with a location, and in a very short item it can leave the classifier with only a generic expression.

Other errors illustrate that an item can have more words and still provide little explicit dialect evidence. The discussion includes a Moldavian sample about Russian military personnel, interrupted by masked material, and a Romanian example about unusually warm weather and an ornamental shrub. Their content may be intelligible while the specific geographic origin remains hard to infer from the wording. The examples make it easier to see why forcing a binary prediction can be hard even when the true label is well defined for the corpus.

The authors observe that most of the erroneous entries they show are Moldavian. Their table is a selection of examples, and the paper does not give a class-by-class confusion matrix for the test set. The examples establish that weak evidence and residual names occur in the evaluation material. They cannot establish how frequent either issue is across the entire test or whether one dialect has substantially lower recall. Those would be population-level conclusions of a different kind from the qualitative readings of individual texts.

### Limitations

#### Limits the authors identify

The authors emphasize the change from the training and validation material to the test material for the shared task. The news passages are comparatively long. Many of the evaluation entries are short, and some contain little that marks one variety. The authors regard this as an important source of errors. Their suggestion for future versions of the benchmark is to curate examples manually so that they contain more relevant evidence. That proposal follows directly from their inspection of items where the source label is clear to the dataset creator but the remaining words offer few grounds for making the decision.

The authors also state a computational limit. The improvement of M-BERT across the tested window counts prompted them to consider an experiment with a larger amount of text. They report that computational resources prevented them from pursuing it. Their comparison establishes the Romanian encoder’s lead within the tested range. The possibility of a crossover outside that range remains a conjecture in the paper, with neither a tested window count nor a measured score attached to it.

In discussing next steps, the authors propose adding an auxiliary task through multitask learning and trying word vectors based on CoRoLa in the concatenation system. The first proposal would give the classifier additional supervision during training, in the hope that it learns features relevant to dialect. The second would change the source of the word-level embeddings. The EC results concern the implemented combination with fastText. The paper does not report an experiment with either of the proposed changes, so the results leave both possibilities open.

#### Limits of what the experiments can establish

Length and domain change together in the shared-task evaluation. The authors measure length directly and offer examples that make the scarcity of dialect cues plausible. The experiments do not compare short and long passages sampled under the same conditions, or news and social media passages held comparable in length. The lower test scores can therefore be associated with the shift as a whole. How much comes from having fewer tokens, how much comes from the kind of text, and how much comes from other differences between the collections cannot be estimated separately from this comparison.

MOROCO’s use of website domains to assign labels also places a boundary around the linguistic interpretation. Those labels make a consistent prediction target for news articles. They do not establish that every sample contains a feature unique to its assigned dialect. A classifier can learn an association with a publisher, a topic, a public figure, or a recurring expression in the training collection and use it to recover the source label. Automatic masking reduces some of those associations, while the examples with surviving names show that at least some remain.

The reverse problem appears when masking removes material from a fragment that has little else in it. A mistake can reflect a shortage of observable evidence even when the corpus label is correct. The paper does not provide a human agreement study or classifiability judgments for those fragments. Its observation that some items offer little evidence is based on reading selected examples. That is enough to expose a difficulty in the task, but it does not give a measured ceiling on performance for either human readers or automatic classifiers.

The encoder comparison changes both the pretrained system and its tokenizer. The measured advantage tells a reader which combination worked better under the authors’ length budgets. It leaves open whether the difference is chiefly due to Romanian pretraining, vocabulary coverage, or the change in which training examples meet the cap. Even when the comparison holds the test documents fixed, the tokenizers can admit different training sets. At the system design level that is part of the advantage a Romanian encoder can offer. At the level of identifying a cause, it prevents a clean estimate of the effect of pretraining language alone.

The paper also leaves room for implementation choices in the custom method. It explains the overlapping-window scheme and the averaging operation but does not specify every pooling detail for repeated positions or describe fully how overlength inputs are handled in the whole-test comparison. The largest listed token budget is 1536 at N = 4. The paper does not explain how it arrives at that cap from the general description of windows and overlap. The reported comparison can be read using the limits in the table, though the table and prose leave a question for an exact reproduction of the schedule.

The final score table gives point estimates. The paper does not report variation across repeated fine-tuning runs or uncertainty for the gaps between systems. This matters when reading the near tie on MOROCO-RDI between the custom approach and FreeLB. The table establishes their ordering in the reported experiments. It cannot say how frequently that ordering would recur under different training runs, and it offers no measure of the stability of the very small differences.

Finally, the two test sets cover a news collection and a separate social media evaluation. They provide evidence about classification in those settings. The paper does not test spoken Romanian, show improvement in opinion mining, or establish how the same methods behave for other dialect pairs. Work on Arabic and German motivates some of the design choices, while the measured gains concern the Romanian and Moldavian categories used here. The strongest claim is that the custom Romanian BERT classifier led the authors’ experiments under both tests and that its performance depended strongly on which set of texts it was asked to classify.

### What came after

The work on Naive Bayes for Romanian dialect identification takes up the same classification problem through a different family of methods. In broad terms, Naive Bayes uses evidence from features to estimate which class is more likely, where Zaharia and colleagues use contextual token vectors and a learned decision layer. Its connection is to the task of distinguishing the varieties. The citation alone leaves open whether the later experiments reproduced the original train and test conditions or used the windowed results as a direct baseline. The later study is [Naive Bayes–based experiments in Romanian dialect identification](https://md.research.elamur.ai/free/en/papers/jauhiainen-2021-naive-bayes-based-experiments-romanian/).

The 2023 paper on sub-word vocabulary size follows a different question raised by the comparison of Romanian and multilingual BERT. In Zaharia and colleagues’ experiment, tokenizer choice changes how many positions a document occupies and how many documents meet a length cap. The subsequent study makes the size of a sub-word vocabulary itself the subject of optimization for dialect classification. Vocabulary size is a distinct variable from the window budget. It concerns the inventory of pieces into which text may be segmented, whereas a window budget concerns how many resulting positions can be processed. This is the focus of [Optimizing the Size of Subword Vocabularies in Dialect Classification](https://md.research.elamur.ai/free/en/papers/kanjirangat-2023-optimizing-size-subword-vocabularies-dialect/).

These two lines of work connect to different parts of the original experiment. One returns to the Romanian dialect decision with a different classifier. The other gives a feature of the input representation its own research question. The distinction matters because the original encoder comparison changed the vocabulary and the encoder together, while its shared-task comparison changed the source and length of the texts together. Its results identify a strong system for the MOROCO news benchmark and a harder test on short posts. Those evaluations leave room to ask separately what can be gained from a different decision rule and what depends on the units the classifier receives.

## Cite

Cite as George-Eduard Zaharia, Andrei-Marius Avram, Dumitru-Clementin Cercel and Traian Rebedea. 2020. Exploring the Power of Romanian BERT for Dialect Identification. Proceedings of the 7th Workshop on NLP for Similar Languages, Varieties and Dialects.

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

```bibtex
@inproceedings{zaharia2020exploring,
  title = {{Exploring the Power of Romanian BERT for Dialect Identification}},
  author = {George-Eduard Zaharia, Andrei-Marius Avram, Dumitru-Clementin Cercel and Traian Rebedea},
  booktitle = {Proceedings of the 7th Workshop on NLP for Similar Languages, Varieties and Dialects},
  year = {2020},
  url = {https://aclanthology.org/2020.vardial-1.22/}
}
```

> 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)
