Elamur Research

Exploring the Power of Romanian BERT for Dialect Identification

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

Summary

Can a few lines of writing tell you whether a text came from a Romanian or a Moldavian source? The answer depends in part on what the writer happened to say. An article gives a reader many chances to encounter a distinctive expression. A brief question or headline may use words common to both varieties. In the VarDial 2020 shared task on Romanian Dialect Identification, Zaharia and colleagues examine that difference. They train classifiers on news and evaluate them both on held-out articles from the same corpus and on a separate collection drawn mostly from social media. One motivation is opinion mining, where knowing the geographic context of a text can help put an expressed attitude in context.

The team compares multilingual BERT with Ro-BERT, a version pretrained specifically on Romanian. Its strongest system, Custom-Ro-BERT-FT, adapts the Romanian encoder to handle long inputs by reading consecutive, overlapping windows of tokens. It averages the contextual vectors that the encoder produces and turns the average into a score for the dialect decision. Other runs test ordinary fine-tuning, training with small perturbations to input vectors, and a design that combines contextual vectors with separate word and character representations.

On the MOROCO-RDI news test, the custom system achieves 96.23% macro-F1 and 96.25% on each of micro-F1 and weighted-F1. Macro-F1 gives each dialect equal influence, while weighted-F1 takes account of how many examples carry each label. The custom system improves on the earlier MOROCO benchmark across all three measures. It also produces the team's strongest shared-task submission, with 64.80% weighted-F1 and a fifth-place finish among 8 teams. The shared-task results table assigns that run 64.75% macro-F1, in agreement with the abstract and introduction. The discussion accompanying the table interchanges its macro and micro labels.

Examples from the shared task show the difference between a label and the evidence available to predict it. A form related to raion, a term the authors associate with Moldavian usage, gives the classifier a linguistic clue. Names that survived automatic masking can also be informative about where a text came from. Other items consist of an ordinary expression or a few words surrounded by placeholders. The news results establish that the custom design improves performance on the corpus it was developed for. The shared-task results show how much harder the same prediction becomes when the classifier encounters another source of text and has much less of it to read.

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

Zaharia and colleagues test Romanian BERT for dialect identification and show how its performance changes from long news articles to short social posts. · about 34 minutes to read

The problem and its context

What the dialect label represents

The paper treats dialect identification as a form of text classification. A system receives a passage and chooses between the Romanian and Moldavian categories. These are closely related varieties, so a passage can express its meaning clearly while giving very little away about the category that the benchmark assigns to it. The useful clue could be a regional word, a recognizable part of a word, or a combination of expressions. Reading enough text to understand the subject and reading enough to place the variety are different demands.

The data make this distinction concrete. The creators of MOROCO collected material from news sites and assigned labels from the sites' top-level domains. A text from a .ro site entered the Romanian category and a text from a .md site entered the Moldavian category. The procedure makes it possible to gather labeled material at scale with a readily applied rule. It attaches the label to the publication source. Inferring that source-associated label from the text is the empirical task, even when a passage could have been written in either place. The corpus and this labeling scheme come from MOROCO.

Location is also part of the authors' practical motivation. They point to opinion mining, where the place associated with an utterance can matter when interpreting a view about a subject. Dialect identification might contribute information to such an analysis. The benchmark gives that broad motivation a specific form by asking for a prediction from the wording available in an individual sample. Its reference labels concern the source of the material. A reader can understand the relevance to location without treating a prediction as a biographical fact about the writer.

The distinction between source and variety also explains a preprocessing choice. A person or place name can be a strong clue to a publication's geographic context. The corpus creators wanted to suppress this kind of shortcut, so they replaced recognized named entities with a common marker. Named entity recognition concerns identifying spans that refer to entities such as people and places. The masking step leaves some indication of where a name occurred while withholding the identity in that span. A system can still use the neighboring language, and the benchmark label stays the same after the substitution.

Why use a separate test from social media?

The paper uses MOROCO-RDI for the dialect classification task within MOROCO and RDI for the VarDial shared task. Both require the same kind of decision. They differ in the relationship between the material a system learns from and the material used to evaluate it. MOROCO-RDI supplies news texts for development and a held-out set of similar articles for testing. The competition also uses news for development, but evaluates submissions on brief entries, largely collected from social media. The paper describes these test entries as being based on tweets.

That change is important even for a classifier whose output has the same meaning on both sets. In an article, an informative term might occur well into the passage. A classifier that reads far enough has a chance to see it. In a short post, the words may be sufficient to communicate a question or an announcement and still supply no distinctive expression. A system can carry over what it learned about a regional word, yet have nothing to apply that knowledge to when the word and its alternatives are absent.

The source changes at the same time as the amount of text. News and social material can express a similar subject in different forms. A complete article can develop a story, while a post may consist of a fragment describing it. To the extent that a classifier has learned associations from the format or use of words in articles, those associations can be less relevant to the shorter items. The shared task therefore examines transfer across this particular combination of changes. Its setup ties the practical difficulty of classifying the new items to the question of how the classifier acquires and uses evidence during training.

The resources behind a Romanian encoder

The authors place the study in the context of Romanian as an under-resourced language. They also describe several resources that were already available. CoRoLa is a reference corpus for contemporary Romanian. The paper mentions a biomedical corpus, a speech corpus, and a Romanian WordNet as other examples. It also points to RONEC, a collection annotated for entities. These resources serve distinct purposes. Their existence matters to the paper's account of Romanian language technology, while the news corpus addresses the specific need for material with regional labels.

Romanian BERT changes what a team can bring to such a labeled corpus. Its encoder has already been trained to build representations from Romanian text. A task-specific experiment can begin with those representations and train the system to use them for a new output. Multilingual BERT offers another pretrained starting point. As the paper describes it, multilingual BERT is intended to work across languages, while Romanian BERT concentrates its pretraining on Romanian. The availability of both makes the choice of starting encoder an experimental question. BERT and The Birth of Romanian BERT describe the underlying approach and its Romanian counterpart.

How earlier work represented dialect evidence

Earlier approaches reviewed by the authors give a sense of the kinds of evidence a classifier might use. Their discussion of Romanian includes recurrent networks trained with word representations. A recurrent network passes a state along a sequence, so its treatment of a word can depend on what the network has already read. The variants mentioned include long short-term memory networks and gated recurrent units. Gates control how information in the state is updated or retained. The paper draws on the work introducing the gated recurrent unit when describing these techniques.

The Romanian work the paper discusses also includes an ensemble with convolutional networks and a triplet loss. In triplet training, an example is considered alongside a positive and a negative example. The training objective draws the first example nearer to the positive one in the learned representation and pushes it away from the negative one. Another line paired a support vector machine, which learns a boundary between classes from their features, with sequences of adjacent characters. A character n-gram is such a sequence. A classifier built from these sequences can register a recurring spelling pattern within several words.

Some of this earlier work concerns topic classification across the Romanian and Moldavian portions of a corpus. For that task, the classifier learns a subject category from material in one variety and is evaluated on material in the other. A recurring word can be useful there because it indicates what the passage discusses. In dialect identification, the same word is useful to the extent that it helps predict a variety. The authors draw on the earlier designs as ways of representing text while defining their own prediction target in terms of dialect.

Work on Arabic supplies further examples in the paper's review. Researchers associated with the MADAR shared task tried recurrent methods as well as BERT. Other studies built features from adjacent characters and words and used multinomial Naive Bayes to score classes from those features. The authors also describe comparisons involving logistic regression, support vector machines, and recurrent networks. In these examples, the main distinction is how the text becomes evidence. A feature-based classifier can start from the occurrence of particular strings. An encoder supplies a representation from which the classifier learns what to use. Fine-Grained Arabic Dialect Identification illustrates the feature-based approach.

The related work includes string kernels, which express similarity between texts through patterns such as shared character sequences, and convolutional systems that operate directly on characters. The discussion of German dialects adds ensembles and work on Swiss German tweets, where researchers combined character-level convolution with methods based on string kernels. Those examples make the authors' interest in character representations understandable. Character patterns provide one way to approach fine distinctions in written form. A contextual encoder offers another way to extract evidence, and the paper asks whether the two can help when used together. UnibucKernel Reloaded and the work on character-level convolution for Arabic dialect identification provide examples from the paper's review.

The method, step by step

Begin with pretraining, then learn the dialect decision

The authors build their systems around a Transformer. Its attention mechanism lets the representation at a token position use information from other positions in the input. A token is a unit produced when text is segmented for the encoder. It can be an entire word or part of one. Representing a token in context means that its vector can change according to the words the encoder sees around it. The classifier can use this numerical representation to make a decision about the passage.

The starting encoders differ in their pretraining. M-BERT, the multilingual version, was exposed to over 100 languages. Ro-BERT was pretrained on Romanian material from OPUS, OSCAR, and Wikipedia. The authors attribute two objectives to that earlier Ro-BERT training. Masked prediction requires the system to use nearby text to recover an omitted token. Next-sentence prediction supplies a training signal about how sentences are paired. The dialect labels enter later, when the team adapts the encoder to its own task. The multilingual system is the subject of How Multilingual Is Multilingual BERT?.

The paper gives some detail about the earlier evaluation that motivated the Romanian starting point. The Ro-BERT authors used material from the Romanian RRT corpus for grammatical prediction tasks. In one setup, the predictions for broad and extended part-of-speech categories were made independently. In the joint setup, the targets included grammatical categories and features, dictionary forms, and the relations that connect words in a sentence. The entity recognition experiment used RONEC and asked for labels that locate the beginnings and continuations of entities and mark positions outside them. On these prior Romanian tasks, the paper reports Ro-BERT's advantages over M-BERT as ranging from 1% to 3%. Those comparisons concern Romanian grammatical and entity annotations. Dialect labels supply a separate target in the present study.

Fine-tuning is the stage in which the pretrained system is adapted using examples with the desired output. Here, a training prediction is judged against the Romanian or Moldavian label. The standard Ro-BERT run gives the authors a conventional way to apply a pretrained encoder to that binary decision. Their custom run changes the route from a passage to its score. In particular, it makes a long article available in multiple pieces and defines a way to pool information from those pieces.

Preserve the masking marker while splitting the text

The paper describes byte-pair encoding for the custom method. This is a kind of subword tokenization in which the vocabulary can include pieces smaller than a word. That ability matters for the input-length budget. An article occupies a number of encoder positions determined by its segmentation, rather than simply by the number of whitespace-separated strings in the original. Different tokenizers can consequently assign different lengths to the same article.

The authors add $NE$ as a token. MOROCO already uses the string as the placeholder for masked entities, and giving it its own token preserves it as one unit during segmentation. Its presence can tell the system that some content was masked at that position. The marker supplies no name to match against another occurrence of the same person or place. A passage can contain both the placeholder and actual names if some names went unmasked, as in examples the authors later discuss.

The distinction between masking in pretraining and masking entities in the task data is useful here. The former creates a training exercise in recovering missing input. The latter removes information that the corpus creators wanted to keep out of the dialect decision and leaves a common marker in its place. During the dialect experiment the output of interest is a label for the passage. The system receives the processed text, including any entity markers, as its evidence for that label.

Read overlapping windows and combine their vectors

The custom system sends consecutive sequences of 512 tokens to the encoder. A later sequence begins with 128 tokens that also appeared in the preceding sequence. The last portion of one window is therefore available in the next call, together with text from farther along in the article. Each call still works on its own input sequence. The overlap can give some positions access to context from both sides of a join through their occurrences in different calls.

From a passage to a dialect prediction with Custom-Ro-BERT-FT

The steps in order.

From a passage to a dialect prediction with Custom-Ro-BERT-FTStep 1: Segment the text while preserving the entity marker1. Segment the text while preserving the entity markerStep 2: Arrange tokens into successive overlapping windows2. Arrange tokens into successive overlapping windowsStep 3: Encode each window separately with Ro-BERT3. Encode each window separately with Ro-BERTStep 4: Pool the resulting contextual vectors by averaging4. Pool the resulting contextual vectors by averagingStep 5: Project the pooled representation to a scalar5. Project the pooled representation to a scalarStep 6: Assign the passage a dialect label6. Assign the passage a dialect label

The overlap matters at the level of the vectors as well as the text. In the architecture figure, the authors distinguish the representations produced when a token is encoded in different windows. The same token can acquire another vector because the tokens surrounding it have changed. A term at the end of one window may have access to more of what follows it when it reappears at the beginning of the next. Conversely, some of the preceding context from the first call will be outside the second. The two calls can therefore provide different information about that position.

After encoding, the authors average the token vectors and project the pooled result to a scalar, a single number for the binary decision. Averaging is a way to turn a variable collection of vectors into one vector of a fixed width. A component of the resulting vector summarizes the corresponding component across the vectors included in the mean. The classifier can then learn a projection from this common representation size to its output score.

The paper describes the mean in words. Its operation can be expressed as follows.

v̄ = (∑ⱼ vⱼ) ÷ K

The symbol v̄ denotes the pooled vector. The index j ranges over the contextual vectors included in pooling, and vⱼ is the vector at that index. The sum sign ∑ⱼ adds those vectors component by component. K is the count of vectors being averaged. Parentheses group the sum, ÷ denotes division, and = relates the pooled vector to the calculation that gives its value. This notation describes the averaging step regardless of how repeated positions at window joins are counted. The paper's prose and figure explain that repeated tokens can yield different vectors, while leaving the exact weighting of those positions unspecified.

The parameter N denotes the number of times the encoder is applied to consecutive windows. It sets a budget for the amount of an article that the custom system can read. With a higher setting, the classifier can take evidence from farther into long articles. The added span matters when the document actually reaches it. A single short sequence can already contain the available text for a shared-task item. In that setting, a larger budget chiefly concerns the kind of training passages the system can learn from and how it encounters them.

The custom and standard Ro-BERT runs use the same reported optimization settings. Both are trained for 4 epochs, with a learning rate of 2e-5 and Adam with weight decay, abbreviated AdamW. An epoch is a pass through the training examples. The learning rate governs the size of the updates during optimization, and weight decay is a way to regularize the fitted parameters. The common settings make the standard run a useful comparison for the custom design. The paper cites Decoupled Weight Decay Regularization for AdamW.

Provide word structure through separate representations

The embedding concatenation system, EC, starts from the idea that the internal structure of words might help distinguish the varieties. A character sequence can expose pieces shared by different words, including roots and endings. Such regularities are part of the paper's motivation from morphology, the study of word structure. EC supplies the classifier with an explicit character-based representation alongside information from word vectors and contextual encoding.

For the character representation, the system splits a word into characters, converts the characters to indices, and processes their sequence with a bidirectional long short-term memory network, or BiLSTM. One direction processes the characters in their written order and the other runs in reverse. The network produces a representation that can use information from both directions through the word. At this stage the sequence being encoded is inside a word. The aim is to give the classifier information about how the word is formed.

A separate source comes from pretrained fastText word embeddings. The Transformer supplies the contextual vectors. In the paper's description, these representations and the character vectors are arranged with a common first dimension corresponding to input positions. Concatenation then places the different features side by side at each position. The resulting vector can carry information from several representations without averaging them into the same set of components. The paper cites the work on subword information in fastText word vectors for its pretrained embeddings.

EC sends the combined sequence through a further BiLSTM, followed by a linear layer. This recurrent stage can operate across successive positions in the passage, while the earlier one processes a word's characters. A sigmoid activation maps the linear output to the range used for the binary prediction. The pipeline thus changes both the representation entering the classifier and the operations that turn the sequence into a decision.

The reported learning rate for EC is 0.001, using Adam. The authors specify a BiLSTM hidden size of 500, which describes the size of its internal state, and cap the input at 280 tokens. They report training for 8 epochs with early stopping. Early stopping allows the training procedure to end according to a stopping criterion. The EC configuration differs from the custom Ro-BERT run in the length of text available to it as well as in its representations, recurrent layers, and training settings.

Train on harder versions of the input vectors

The FreeLB run changes the training procedure. It perturbs the numerical vectors supplied to the encoder so that the classifier encounters slightly altered inputs that can make its current predictions worse. The perturbations are at the level of word embeddings. The original input's dialect label still provides the supervision. The intended effect is to make training account for difficult variations around the examples it receives. The procedure comes from FreeLB.

The paper describes the process in batches. The algorithm takes steps in the direction of perturbations that increase the loss, the penalty used to judge a prediction during training. The ascent steps are part of the search for harder versions of the input. Gradients from the successive outputs are averaged for the training update. A gradient describes which changes would raise or lower the loss locally. The overall training goal is to choose parameters that reduce the penalty even when the input vectors have been moved in a direction that makes classification harder.

For the adversarial run, the authors report Adam with an initial learning rate of 5e-5. They keep the weight decay at 0.0 and epsilon, a constant used in the optimizer's numerical calculations, at 1e-8. They train for 12 epochs. The evaluation compares this implementation as a complete training approach. Its optimization settings and training duration differ from those reported for both versions of Ro-BERT fine-tuning.

Experiments and results

The news corpus and the competition test

MOROCO contains 33,564 samples from news websites. The reported class composition is 45.89% Moldavian and 54.11% Romanian across the corpus, which contains more than 10 million tokens. The selection spans culture, finance, politics, science, sports, and technology. The corpus authors removed HTML and masked named entities during preprocessing. With the labels already assigned from the source domains, the processed articles could be used as supervised examples even when the masking removed a potential clue to their origin.

The binary task uses 21,719 training samples, 5,921 validation samples, and 5,924 test samples. MOROCO also supports experiments that classify topics within each variety and transfer topic classification from one variety to the other. Those tasks help explain the corpus's design. The results at issue here come from the binary dialect task. In that task the validation and held-out MOROCO-RDI test sets are made up of the same broad type of material as the training set.

The RDI shared-task test contains 5,022 items. Most were taken from social media, and the lengths reported for these items make clear how different the inputs are. Measured by whitespace segmentation, the MOROCO training set averages 310.04 tokens per sample, its validation set averages 309.92, and its test set averages 313.65. The RDI test set averages 15.63 whitespace tokens. The longest MOROCO training item reaches 15,988 whitespace tokens, while the reported RDI test maximum is 25. The averages characterize the typical difference, and the maxima show the kinds of input that put the greatest demand on the encoder's reading budget.

With the uncased Ro-BERT tokenizer, the MOROCO training, validation, and test averages are 356.08, 355.87, and 360.87 tokens per item, respectively. The RDI test average is 21.71 tokens. With the uncased M-BERT tokenizer, the news averages are 449.70, 450.02, and 455.50 tokens in the same split order, and the shared-task test average is 26.65. Thus the choice of tokenizer changes the number of encoder positions needed for the articles. The news and social media sets remain far apart in length under either tokenizer.

The upper end of the length distribution is especially relevant to the custom design. The MOROCO training maximum is 18,456 tokens under the Ro-BERT tokenizer and 24,169 under M-BERT's. On the MOROCO test split, the respective maxima are 15,313 and 20,151. A system with a budget that serves most articles can still face documents far beyond it. In the RDI test set, by contrast, the longest item takes 42 positions under Ro-BERT tokenization or 44 under M-BERT tokenization. The overlap between windows is a mechanism for dealing with news lengths. The short competition items can fit within one window.

Selecting a starting encoder and a length budget

Before comparing final runs, the team evaluates M-BERT and Ro-BERT on MOROCO-RDI while varying N. The paper lists allowed lengths of 512 tokens for N = 1, 896 for N = 2, 1280 for N = 3, and 1536 for N = 4. These are the published caps used to describe the comparison. The fraction of examples meeting a given length limit differs with the tokenizer, because a common number of positions need not accommodate the same documents.

For the 512-token limit, the paper reports coverage of 83.60% with Ro-BERT and 72.38% with M-BERT. At 896 tokens, the coverage figures are 95.50% and 92.28%, respectively. At 1280 tokens, Ro-BERT covers 98.04% and M-BERT covers 96.62%. At the listed 1536-token cap, the figures are 98.64% and 97.78%. These percentages refer to samples meeting the stated length condition for each tokenizer. They describe how much of the data fits the budget independently of the quality of the predictions.

The paper plots the performance comparison in two forms. In both, training excludes examples above the current length limit. The first also filters the test set to examples that fit. The second uses the complete MOROCO-RDI test set. These arrangements address a practical question about the length restriction. A classifier evaluated on a test subset may do well on the items that fit its encoder, while the full test set also contains longer cases. By retaining the full set in one comparison, the authors can see whether the ranking survives the change in what is evaluated.

Ro-BERT leads at every tested value of N in both comparisons. The authors observe that M-BERT improves faster across the settings, leaving open the possibility that the ordering could change if it received a larger budget. The reported experiments stay within the tested range. The team chooses the setting labeled N = 3 for the competition, citing the shortness of the new material, a desire to avoid fitting too closely to long texts, and a performance difference of 0.6% between the N = 3 and N = 4 settings in the news comparison. The sentence reporting that difference leaves the particular measure unspecified.

How to read the F1 scores

The paper reports F1 in three forms. For a given label, precision concerns the share of the classifier's predictions of that label that are correct. Recall concerns the share of the items carrying that label that the classifier correctly recovers. Taking the harmonic mean of recall and precision gives the F1 score. It rewards a system for doing both jobs well. A classifier that rarely predicts Moldavian may be right on many of the occasions when it does so and still miss much of the Moldavian material.

Micro-F1 pools the counts used to calculate precision and recall before forming F1. Macro-F1 calculates the F1 scores for individual labels and gives those labels equal weight in the average. Weighted-F1 also averages label-level F1 scores, with each label weighted according to its frequency in the evaluation set. The weighting matters when the labels occur at different rates or the classifier performs unevenly across them. The aggregate measures describe different aspects of the same predictions. Even together, they leave the individual error counts for each dialect unspecified.

The main comparison uses complete test sets and includes four systems from the team. For MOROCO-RDI the external baseline is the earlier result of Butnaru and Ionescu. For RDI the paper includes the leading participant's scores as a point of comparison. Those external results answer different questions. The news baseline places the work alongside the published benchmark for the corpus. The competition leader shows the performance the strongest submission reached on the short-text test.

Results on held-out news

Custom-Ro-BERT-FT reaches 96.25% weighted-F1, 96.25% micro-F1, and 96.23% macro-F1 on the MOROCO-RDI test. FreeLB is the nearest alternative on this set. It obtains 96.15% weighted-F1 and micro-F1, with 96.12% macro-F1. The standard Ro-BERT run yields 94.52% weighted-F1, 94.48% micro-F1, and 94.51% macro-F1. All three measures therefore place the custom run first among the team's approaches on news, while also putting the adversarial run ahead of ordinary fine-tuning.

The earlier MOROCO result is 94.11% weighted-F1, 94.60% micro-F1, and 94.50% macro-F1. Both the custom and FreeLB runs exceed those benchmarks across the reported measures. With the standard run, the ordering against the earlier work depends on the measure. The EC run yields 86.43% weighted-F1, 86.17% micro-F1, and 86.31% macro-F1. The system with separate character and word representations finishes below the other entries in this comparison.

Weighted-F1 for dialect classification on the MOROCO-RDI news test

Custom fine-tuning leads on held-out news, followed closely by FreeLB.

Weighted-F1 for dialect classification on the MOROCO-RDI news testEarlier MOROCO benchmark: 94.11Earlier MOROCO benchmark94.11Standard Ro-BERT fine-tuning: 94.52Standard Ro-BERT fine-tuning94.52Custom-Ro-BERT-FT (this paper): 96.25Custom-Ro-BERT-FT (this paper)96.25FreeLB: 96.15FreeLB96.15EC: 86.43EC86.43
The numbers
System or settingweighted-F1 (%)
Earlier MOROCO benchmark94.11
Standard Ro-BERT fine-tuning94.52
Custom-Ro-BERT-FT (this paper)96.25
FreeLB96.15
EC86.43

The combination of a news baseline and a standard fine-tuning run makes it possible to read the result at different levels. The earlier benchmark establishes what the previous corpus study achieved. The standard run gives a reference that starts from the same Romanian encoder as the custom system. The first comparison shows progress on the benchmark, and the second provides more direct evidence about changing the way the encoder is used for this task.

Results on the RDI competition test

The introduction reports 97.04% macro-F1 on long-text validation material. The best shared-task result in the table is 64.75% macro-F1 for Custom-Ro-BERT-FT. In that table, its weighted-F1 is 64.80% and its micro-F1 is 67.10%. The results narrative assigns the micro and macro values in the opposite order for this entry. The table's assignment agrees with the abstract and introduction on macro-F1, and the weighted-F1 is consistent across the table and results discussion.

FreeLB achieves 56.39% weighted-F1, 60.77% micro-F1, and 56.32% macro-F1 on the RDI test. The standard Ro-BERT result is 55.82% weighted-F1, 60.77% micro-F1, and 55.74% macro-F1. In this comparison the two methods tie by micro-F1, while FreeLB leads the standard run on the other reported measures. EC records 46.59% weighted-F1, 55.07% micro-F1, and 46.48% macro-F1. The custom design leads the team's systems by each measure.

Weighted-F1 for the team's systems on the RDI shared-task test

Custom fine-tuning leads the team’s runs, and FreeLB stays close to standard fine-tuning.

Weighted-F1 for the team's systems on the RDI shared-task testStandard Ro-BERT fine-tuning: 55.82Standard Ro-BERT fine-tuning55.82Custom-Ro-BERT-FT (this paper): 64.80Custom-Ro-BERT-FT (this paper)64.80FreeLB: 56.39FreeLB56.39EC: 46.59EC46.59
The numbers
System or settingweighted-F1 (%)
Standard Ro-BERT fine-tuning55.82
Custom-Ro-BERT-FT (this paper)64.80
FreeLB56.39
EC46.59

The team reports submitting its three strongest designs from the four it tried. Its best run placed fifth among 8 teams. The competition leader, identified as the top system in the results table, has 78.76% weighted-F1, 78.75% micro-F1, and 78.77% macro-F1. That comparison matters because a system can be the strongest approach in the team's study and still leave room for substantially better performance on the shared test. On the news test, the reference point is the earlier MOROCO benchmark. On RDI, the reference is other teams tackling the same transfer to short material.

The ordering of the team's runs carries over more readily than their scores. FreeLB is near the custom run on held-out news and nearer the standard run on the competition test. EC finishes at the bottom in both evaluations. Choosing a promising architecture from the news experiments therefore gives only part of the answer. The competition changes the evidence on which each prediction has to be made, and the values measured on articles offer a poor estimate of the resulting scores.

What the ablations show

How filtering affects the encoder comparison

The paper offers no component-by-component ablation of the custom design. Its analyses instead compare encoders and window budgets under different filtering rules, evaluate complete systems, and examine examples of correct and incorrect predictions. These comparisons make it possible to locate where some effects appear, even when an experiment changes several factors at once.

The window comparison is particularly informative because the length limit affects more than the contents of an input. With the stricter limits, overlength articles are removed from training. Raising the limit changes the range of articles the encoder can process and the set it can learn from. Where the test set is filtered too, the score is also computed over a changing selection of articles. The effect of varying N therefore includes changes in document coverage as well as changes in the amount of text available to an individual call sequence.

The complete-test version removes one of these sources of variation. Across runs the same articles contribute to the evaluation, including those on the long end of the distribution. Ro-BERT still leads M-BERT. This supports the conclusion that the advantage is visible across the benchmark and survives putting the long test articles back into the evaluation. The training filter continues to interact with each tokenizer. At a common cap, the reported coverage for Ro-BERT is higher, so the comparison can still differ in the examples used to fit the systems.

The direction of M-BERT's improvement as the budget grows also fits the token statistics. Under its tokenizer the same splits occupy more positions on average, and a smaller proportion of examples meets the tighter caps. A larger allowance can plausibly address part of that disadvantage. The experiment, however, varies the budget of each complete encoder and tokenizer combination. It supplies no separate estimate of how much of the improvement came from longer inputs within documents, from which articles entered training, or from some interaction between the two.

The competition setting illustrates how to interpret the window choice. N = 3 can matter to the training articles, some of which extend far beyond a single encoder call. The length statistics put even the longest competition item within the first window. The chosen budget can thus influence what the system learned before seeing a test item, while the test item's text itself is short enough to be encoded together. The paper reports its reason for choosing that setting without presenting a competition test comparison across the window counts.

What changes when a whole approach changes

The comparison between the standard and custom runs is the closest one to a test of the proposed way of processing the passage. The Romanian starting encoder and reported AdamW settings are shared. The custom pipeline changes how evidence is obtained from a long input and how the resulting token representations are used for the final decision. Its superior scores support using that pipeline as a package in the reported experiments. Separate tests of overlap, available length, and pooling would be needed to estimate their individual contributions.

Consider what a gain from overlap would look like in news. A token at a window boundary can occur again with additional context on the other side. Pooling can incorporate representations influenced by that context. With the present comparison, the custom classifier can also reach portions of the article that a more limited procedure could miss entirely. Any gain from seeing a distinctive expression later in the article would appear in the same overall score as a gain from reading a boundary token in a different context. The reported design does not distinguish these routes to a better prediction.

On RDI the custom run also leads, despite the short test inputs. The gain therefore needs an explanation consistent with the fact that a second test window is unnecessary for these items. The system was trained on long news documents, and its method for turning token vectors into a prediction also operates on one short sequence. A performance advantage could come from what the training setup learned from the articles, from the way the pooled representation serves the decision, or from both. The experiments establish the ordering of the tested systems while leaving these explanations open.

FreeLB provides evidence about another package of choices. The adversarial run is close to the custom result on news and only a little ahead of the standard run on the shared-task weighted and macro measures. This shows that the run's strength on MOROCO-RDI does not carry over to an equivalent advantage over the team's alternatives on RDI. The perturbations are designed in the space of input vectors. The evaluation shift involves short items from another source. The paper's results indicate how the method fares under that shift, while holding no dedicated test of resilience to one specific change in the text.

There is a similar distinction for EC. The argument for adding word structure is plausible in a dialect task because a root or ending may carry relevant information. The measured run combines character features with fastText and contextual vectors, adds a recurrent stage over the combined sequence, and uses a different training configuration and sequence cap. Its results show that this implementation did poorly relative to the team's alternatives. The authors suggest that the additional layers and features made the network wider and deeper, with more parameters to adapt. The comparison leaves that explanation untested. It also leaves open whether a character representation would help in a design with fewer simultaneous changes.

What individual examples reveal

The examples in the paper help explain the kind of prediction problem that aggregate F1 cannot describe. One correctly classified Moldavian item concerns the creation of industrial facilities in district centers. The wording includes a form related to raion, which the authors identify as a Moldavian indicator and gloss as district. The item illustrates a case where the subject can be described using a term that helps place the variety. That clue can occur even in a passage short enough to fit easily into the shared-task input format.

The same example also contains the name Chicu. Another correct Moldavian prediction comes from an item that includes Dodon. The authors say that both names appear in the training material and survived masking in those test examples. There are consequently several possible reasons for a correct prediction. The wording may contain a regional expression, a familiar name may be associated with a source, or the two kinds of information may support the same decision. The examples establish that these cues are available. The paper does not compare the predictions before and after removing an individual cue.

Among the errors is an item asking about protection against coronavirus. Its wording expresses a recognizable question with little indication of the origin assigned by the label. Another example begins with Primele, meaning “the first,” and what follows consists of entity placeholders. The resulting passage offers a fragment of ordinary language and an indication that material has been masked, with little remaining lexical content. The authors use cases like these to show why reducing the number of words can be especially consequential when the varieties are close.

The other error examples expose a related difficulty. One Moldavian item deals with Russian military personnel and contains several masked portions. The Romanian item describes unusual warmth and an ornamental shrub coming into bloom. A reader can understand the broad topic in each case and still have limited evidence about the label. A topic may suggest a geographic possibility, but the example itself can contain little recognizable dialect evidence. The results therefore need to be understood in a task where every input requires a decision, including inputs whose remaining words give a weak basis for making one.

The collection of examples includes more Moldavian errors than Romanian errors. That is an observation about the displayed cases. The paper provides no full breakdown of missed items by dialect, so the illustrative counts do not establish the relative recalls of the two classes. The examples document the presence of generic language, extensive masking, and surviving geographic clues. Their role is diagnostic. They help explain what can go right or wrong on a particular input, while the aggregate test scores measure performance over the evaluation as a whole.

Limitations

What the authors identify

The authors emphasize the gap between the long articles used for training and validation and the short entries used in the shared-task test. They associate this gap with the reduced availability of features that might distinguish Romanian from Moldavian. Their error discussion gives that concern a concrete form. A recognizable regional expression can help even in a brief input, but the benchmark also contains fragments in which such a clue is absent or difficult to find. The authors propose manually curating future versions of the data to include more informative samples.

That proposal follows from a tension within the evaluation. A short item can have a source-based label regardless of how much evidence for that label survives in the text. A dataset curated for informative samples could give more weight to cases in which there is dialect evidence to identify. The current competition set also measures the team on the harder fragments it contains. The authors' proposal indicates that they regarded the evidence available in some of those items as a limitation of the setup.

The paper also identifies a computational limit. The M-BERT curves led the authors to consider whether its performance might meet or exceed Ro-BERT's with more input positions. They report that resources prevented them from pursuing this comparison. The evidence supports Ro-BERT's lead for the tested settings. The behavior of the systems with a larger budget remains unanswered by the study.

For future research, the authors propose multitask training and CoRoLa-based word embeddings. In multitask training, an auxiliary prediction could provide an additional signal intended to help the system learn relevant features. The embedding proposal would replace the existing word vectors in EC with ones based on the Romanian reference corpus. These are changes the authors suggest trying. Their results describe how the reported systems behaved without testing either proposal.

What the design leaves unresolved

The shared-task evaluation changes source and length together. The paper quantifies the length contrast and shows why short items with little distinctive language can cause errors. It does not compare news and social posts of matched lengths or examine length while keeping the source of the texts fixed. The experiments therefore support a conclusion about transfer from the particular development material to the particular test set. They leave the separate effects of shorter text, different language use, and other differences between the collections unmeasured.

The source-based labels also limit what a correct prediction says about linguistic knowledge. An association between a certain name and its usual publication context can help recover the label. The same can be true of a feature tied to a topic or the customary wording of a source. Entity masking reduces access to some of this information, and the examples establish that it misses some actual names. A high news score establishes reliable recovery of benchmark labels under the reported conditions. Quantifying how much of that performance rests on dialect-specific vocabulary or grammar would require a separate analysis of the prediction cues.

Masking can matter in the opposite direction too. The error containing Primele provides an example in which very little text remains available beyond placeholders. Its label is part of the setup, but a human reader's ability to recover it from the masked string is unmeasured. The paper reports neither a human comparison nor a systematic assessment of how often readers can place the variety from the available text. The error analysis supports identifying some items as plausibly ambiguous. It provides no measured upper bound on performance and no estimate of the share of test items for which the evidence is insufficient.

The comparison of pretrained encoders switches tokenizers at the same time. Ro-BERT consumes fewer positions on average in the reported statistics and admits more examples at any common listed cap. The full-test comparison keeps the evaluation items fixed, while the training filter can still retain different selections. The ranking is evidence for the Romanian encoder and its tokenizer as a combination. It leaves the effect of pretraining on Romanian alone unresolved, along with the separate contributions of vocabulary and length coverage.

A reproduction would also need some details that the paper leaves open. The custom architecture describes the nominal window and overlap sizes, and the length comparison supplies a cap for each tested N. The reported 1536-token cap at N = 4 is left unexplained in relation to the general window rule. The paper also leaves room for choices in how to count repeated positions in pooling and how exactly to process overlength items when retaining the entire test set. The performance claims can be read from the published setup and scores. Those implementation questions matter if the aim is to recreate the precise inputs and computations of each run.

The score table gives point results without reporting how they vary across repeated training runs. This is especially relevant when two approaches are close, as Custom-Ro-BERT-FT and FreeLB are on news. Their order is clear in the reported comparison. The paper leaves the stability of that order across new runs unknown. Similarly, the weaker EC result establishes a difference between complete tested designs, while leaving the authors' explanation about network size and the role of individual feature branches unresolved.

Finally, the observed results concern written material from the news corpus and the competition collection. The study frames dialect identification as potentially relevant to opinion mining, but measures dialect prediction itself. The papers on Arabic and German provide precedents for the techniques reviewed, rather than transfer tests conducted as part of this study. Applying the result to speech, another dialect pair, or a downstream task would call for evidence from those settings. Within the settings actually measured, the main finding is that the custom Romanian encoder performs best among the team's runs and that the scores change substantially with the evaluation material.

What came after

Naive Bayes experiments in Romanian dialect identification cites the paper and returns to Romanian dialect identification with a different classification approach. The connection is to the prediction problem: how to use evidence in a sample to decide its variety. In Zaharia and colleagues' work, a learned contextual representation feeds a dialect score. A Naive Bayes approach uses features as evidence for class likelihoods. The later citation and title establish that methodological connection. They leave open whether the work repeated the news-to-social-media setup, compared directly with Custom-Ro-BERT-FT, or attempted to reproduce its results.

Subword Vocabulary Size in Dialect Classification pursues a question about the text units supplied to the classifier. The 2023 study makes the size of the sub-word vocabulary an object of optimization for dialect classification. In Zaharia and colleagues' comparison, a change of tokenizer goes along with a change of pretrained encoder. The two tokenizers produce visibly different length distributions, which affect the number of samples that fit the limits. The later study's focus brings attention to a specific choice within segmentation: the size of the inventory of pieces available to represent the text.

Vocabulary size and the reading budget address different parts of that problem. The vocabulary is the inventory of pieces that segmentation can use. The budget determines how many resulting positions a system can process. The original paper shows how the distributions of those positions differ for its two encoders and how performance behaves over its tested budgets. The later vocabulary study identifies the inventory size as a question worth studying in its own right. The two citing works thus connect to distinct decisions exposed by the original experiment: how to convert text into features for a dialect prediction, and how to choose the units in which the text is represented.

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.

@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/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/zaharia-2020-exploring-power-romanian-bert-dialect/