---
title: "Computationally efficient discrimination between language"
description: "Barbaresi tests how well character n-grams and regularized classifiers distinguish closely related languages and dialects in VarDial tasks."
canonical: "https://research.elamur.ai/free/en/papers/barbaresi-2018-computationally-efficient-discrimination-between-language/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/barbaresi-2018-computationally-efficient-discrimination-between-language/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2018](https://md.research.elamur.ai/free/en/papers/2018/) / Computationally efficient discrimination between language varieties with large feature vectors and regularized classifiers

# Computationally efficient discrimination between language varieties with large feature vectors and regularized classifiers

Paper · 2018 · Adrien Barbaresi

**Authors:** [Barbaresi](https://md.research.elamur.ai/free/en/authors/barbaresi/), [Adrien](https://md.research.elamur.ai/free/en/authors/adrien/) · **Year:** 2018 · **Venue:** Proceedings of the Fifth Workshop on NLP for Similar Languages, Varieties and Dialects (VarDial 2018) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

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

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

## Summary

A subtitle may give its audience everything it needs to follow a conversation and still give a classifier little basis for deciding whether its wording is Dutch or Flemish. Adrien Barbaresi studies this problem across subtitles, Swiss German dialect samples, and Indo-Aryan texts. Each evaluation requires a system to assign a short sample to one of the varieties specified for that task. The challenge is to recognize distinctions that may be carried by a few spellings, word forms, or lexical choices in a stretch of text whose other material is shared.

The system entered as XAC gathers overlapping runs of characters at several lengths. Each run supplies a potential feature, from a small piece of spelling to a sequence long enough to capture much of a written form. The system adjusts the counts so that sequences found throughout the training collection carry less relative weight. It then compares three ways of using the resulting evidence. Multinomial Naive Bayes estimates how compatible the observed features are with each variety. Ridge learns linear scores with a penalty on large coefficients, and a classifier trained by stochastic gradient descent supplies a second regularized linear comparison. The basic unit of the representation is the character [n-gram](https://md.research.elamur.ai/free/en/concepts/n-gram/).

Ridge was the strongest XAC entry on the Dutch and Flemish subtitle test, scoring 0.6318 macro F1, and on the Indo-Aryan test, scoring 0.8983. Macro F1 combines precision and recall separately for each variety before averaging across varieties. The winning XAC configuration on Swiss German used Naive Bayes and scored 0.6336 on the same metric. In the campaign standings, the best XAC entries finished 3rd out of 7 for Dutch and Flemish, 2nd out of 6 for Indo-Aryan, and 3rd out of 4 for Swiss German.

The subtitle result was a modest gain over the adapted Bayesian baseline, and the other linear classifier fell below that baseline. Both linear approaches improved on Naive Bayes for Indo-Aryan, while Swiss German favored Naive Bayes by a small margin. The paper examines those outcomes through observations made during tuning and through errors on individual varieties. It connects the patterns to the limited evidence available in short samples, to differences in spelling and word structure, and to the risk of fitting too many weak cues too strongly. The scores establish which classifier made better predictions on each test set. The proposed linguistic and statistical explanations have different levels of support from those comparisons.

## Deep dive: Computationally efficient discrimination between language varieties with large feature vectors and regularized classifiers

Barbaresi tests how weighted character sequences, Naive Bayes, and Ridge distinguish closely related languages and dialects in short texts. · about 33 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

#### When the label depends on a few characters

Language identification starts with a document and asks which language or languages it contains. In Barbaresi’s experiments, the possible answers are defined by the evaluation, and the system makes a choice for each item. This turns language identification into a particular kind of [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/).

The choice of labels determines what has to be learned. When the categories are closely related, much of the evidence that identifies their broader language family may be shared. A sample may contain recognizable words and constructions while offering very little that settles the choice between the labels in the task. How closely the varieties resemble one another also depends on which aspect of language is under consideration. They may share much of their vocabulary while differing in parts of their grammar, or a lexical choice may give away a distinction that the rest of the sentence leaves open. The paper notes that even people annotating short samples can find some of the cases hard to distinguish.

A short item changes what counts as a practical cue. A feature can be highly characteristic of a variety across a collection and still be absent from a particular item. The classifier then has to make do with whatever information the text contains. A method that draws on many modest tendencies has a reason to keep looking beyond the most conspicuous markers. That same breadth makes training harder, since the examples must support estimates for a collection of features much larger than the set of features in any individual sentence.

Barbaresi describes the training and test collections as being on the scale of thousands or tens of thousands of items, with the test sets relatively small and each item no longer than a sentence. The concern is the amount of information those items provide for estimating effects. If a pattern appears in only a narrow part of the collection, the examples may give a weak or unstable indication of how strongly to associate it with a category. If several patterns almost always appear together, the data offer few cases in which to distinguish their contributions. Small changes in the training examples can then produce sizeable changes in the fitted decision rule. The paper treats generalization to unseen text as the practical test of whether the rule has learned distinctions worth keeping.

#### How the shared tasks framed the question

The paper traces a renewed interest in language identification to the statistical approaches of the 1990s. It also places the problem beside authorship attribution, text-based geolocation, native language identification, and studies of dialect. In each case the text supplies observations from which a system infers a property of the sample or its production. A national variety can be the property of interest even when all the texts would ordinarily be described as belonging to the same language. Barbaresi cites work on [classifying English documents by national dialect](https://md.research.elamur.ai/free/en/papers/lui-2013-classifying-english-documents-national-dialect/).

The Discriminating between Similar Languages shared task brought a common set of short news texts into this line of research in 2014. Researchers could compare their approaches on a collection designed around neighboring varieties, with the labels and evaluation in common. This matters for a task where a change in the length or source of the text can change the evidence available to every entrant. The original evaluation is described in the [DSL shared-task report](https://md.research.elamur.ai/free/en/papers/zampieri-2014-report-dsl-shared-task/).

The series continued with related benchmarks, including work on Arabic dialects, and later VarDial campaigns also covered German dialects. These evaluations placed two kinds of distinction within the same research program. A system could be asked to separate named languages that resemble one another or to assign labels to regional varieties of a language. Statistical classifiers can express both requests as a choice among categories, even when the similarities and the sources of evidence differ. The paper points to the [third DSL shared-task report](https://md.research.elamur.ai/free/en/papers/malmasi-2016-discriminating-between-similar-languages/) and the [VarDial 2017 findings](https://md.research.elamur.ai/free/en/papers/zampieri-2017-findings-vardial-evaluation-campaign/).

The surrounding work also took the question beyond news. Barbaresi mentions TweetLID, which included similar languages in a tweet benchmark, and the PAN author-profiling task, which included language varieties and dialects. The speech challenge cited in the introduction places related distinctions in another setting, where the material comes from speech recognition research. These examples establish the wider interest in distinguishing varieties across sources. The Arabic example is the [MGB-3 speech recognition challenge](https://md.research.elamur.ai/free/en/papers/ali-2017-speech-recognition-challenge-wild-arabic/).

The campaign studied in this paper put Dutch and Flemish subtitles and Indo-Aryan language identification into their first shared-task iterations, alongside the returning Swiss German dialect task. Those settings give the paper a way to consider the portability of a statistical pipeline. The feature extraction can have the same basic organization in each setting, while the labels, recurring strings, and amount of usable evidence are learned from the particular material. The wider history of approaches that the paper draws on is covered by the [survey of automatic language identification in texts](https://md.research.elamur.ai/free/en/papers/jauhiainen-2019-automatic-language-identification-texts/).

#### Why character counts were a credible starting point

Previous work had represented short texts using frequency profiles from characters or tokens. Barbaresi points in particular to character profiles covering lengths 1 to 5. Character fragments can recur across related forms, so part of the evidence from an infrequent word can be pooled with evidence from other forms that share its spelling. The paper compares this effect to an indirect form of [stemming](https://md.research.elamur.ai/free/en/concepts/stemming/).

Other work had used information from linguistic tools, such as the distribution of grammatical categories. Such a representation can express regularities across words with different spellings. It also depends on reliable analysis for the varieties under study. Barbaresi treats the limited availability of those tools as a reason to work from the text and its category labels. The earlier Spanish-variety work cited in the paper exemplifies the alternative route through [part-of-speech tagging](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/).

A simple classifier using n-gram features already had a record of competitive performance in the shared tasks. The direct predecessor for this paper is Bayesline, which paired a comparable feature extraction method with Bayesian classification. That history makes Bayesline a substantive test of whether a more elaborate way of fitting a decision rule earns its place. The paper carries forward work on frequency and sub-word evidence from Barbaresi’s [weighted subword features study](https://md.research.elamur.ai/free/en/papers/barbaresi-2017-discriminating-between-similar-languages-weighted/).

With this starting point, the central question is how to exploit many candidate signals when the evidence for each can be thin. Counting fragments makes those signals available. Deciding how much weight to assign a fragment involves two separate problems. Its distribution in the collection determines how much emphasis it receives in the input representation. Its association with the labels determines how it affects the final decision. Barbaresi uses a common approach to the first problem so that the shared-task experiments can compare different answers to the second.

### The method, step by step

#### Preparing text and collecting fragments

XAC learns from samples whose varieties are already known. It first transforms the text into a common numerical representation. The classifiers use the resulting values and the labels to fit their decision rules. A test sample then passes through the text and feature preparation stages before the fitted rule assigns its label.

From training examples to a variety decision The steps in order.

The paper reports a small benefit in preliminary tests from adding linguistic preprocessing. It uses SoMaJo, a rule-based system whose reported strengths include German web and computer-mediated material. Its role in XAC is to separate the units of the input according to the tokenizer’s rules. This gives the later character analysis a prepared text to work from. Barbaresi treats the rule-based approach as a practical choice for the campaign, where the input varieties differ and comparable tools for richer analysis are scarce. The preparation step is [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/).

The pipeline lowercases text where case applies. Training trials favored that choice, and the paper points to sentence-initial capitals as a possible source of noise. A character counter can treat upper-case and lower-case versions of a form as separate evidence when they are kept as distinct strings. If capitalization is largely telling the system where a sentence began, that separation divides observations for a reason of little value to the intended decision. Lowercasing pools those observations. The role of case is therefore a choice about which distinctions survive into the feature inventory.

The author also forgoes a stop-word list. Removing a high-frequency word in advance would remove every contribution its characters make in that context. For closely related varieties, even a common form can be part of a useful contrast. The paper instead lets frequency weighting moderate features that occur throughout the collection, and lets the supervised fit determine what predictive use to make of the available cues.

The feature extractor collects contiguous character sequences at the selected lengths. Sliding a window along the text makes adjacent features overlap. A relatively long window records a more specific piece of spelling, while a shorter one makes it possible to recognize a shared fragment across more forms. Length also affects what a classifier can observe in a very short item. A sequence requires enough characters to fill its window, whereas an individual character can supply evidence whenever it occurs. The paper’s DFS setting covers lengths 2 to 6. For the Swiss German task it uses lengths 1 to 6. The paper describes the latter as the wider setting compared with the other tasks.

Within a sequence, the order of characters matters. Once the system has extracted the sequences, the bag representation gathers their counts without indexing each occurrence by its position in the document. This is useful for the kind of evidence Barbaresi wants. A recurring string can contribute wherever it appears. The cost is that a classifier receives local order inside the windows and aggregate evidence across the sample. It does not receive a separate description of how distant portions of the sentence are arranged.

#### Giving each feature a stable place

To use the counts in a classifier, the system needs a consistent answer to what each numerical position means. It builds a dictionary so that an observed sequence refers to the same feature column across the training collection. The operation of turning an item into a row of numbers is vectorization. Every row puts the evidence about a particular sequence into its designated column, and the class label remains available as the target for fitting.

A fixed dictionary also determines what the system can do with unfamiliar strings at test time. A sequence outside the learned inventory has no column through which to affect the classifier directly. A test item may still contain fragments that are familiar at other window lengths or positions. A longer sequence can therefore be new as a whole, while some of its shorter constituents still connect it to observations from training. This is one reason to collect several lengths in parallel.

The rows make up a sparse matrix. The full training collection can contribute a large variety of sequences, and any given sentence realizes only a small portion of that vocabulary. Its row is consequently dominated by zero entries. Sparse data structures exploit that pattern by operating on populated entries without treating every document as if it supplied a value for every feature. The distinction between a wide matrix and a densely populated matrix is central to the paper’s computational argument. The representation can offer many candidate predictors while each sample brings relatively few of them into play.

At this stage, the potential predictors can overlap in what they describe. A short fragment may occur inside several longer fragments, and the same written form can activate several columns at once. This is useful when some fragments generalize across contexts and others carry more specific evidence. It also means that a strongly predictive part of a word can appear in several columns. The classifiers differ in how they combine contributions from that kind of input.

#### Scaling counts within and across samples

The raw count of a sequence answers a question about one sample. The number of documents containing it answers a question about the collection. The two quantities can behave differently. Several repetitions in one item affect the first quantity for that item. Finding the sequence once in each of many items affects the second. Barbaresi uses both because evidence that is concentrated in a smaller part of the collection deserves a different input scale from evidence encountered almost everywhere. This weighting method comes from information retrieval and is called [TF-IDF](https://md.research.elamur.ai/free/en/concepts/tf-idf/).

The paper describes the steps and reports implementation settings. The basic weighting relation can be written schematically as follows.

```
a(d, g) = tf(d, g) × idf(g)
```

Here `d` denotes a document, which is a short item in these tasks, and `g` denotes a character sequence in the feature dictionary. The quantity `a(d, g)` is its weight before the row is scaled. The function `tf(d, g)` gives the term-frequency contribution for `g` in `d`, under the chosen count transformation. The function `idf(g)` gives the inverse document-frequency factor for `g`, using the training collection. The multiplication sign `×` combines the factors, and `=` gives the resulting weight.

Inverse document frequency distinguishes a pattern’s local prominence from its spread across the collection. A common pattern can have a sizeable count within a short sample, yet add limited information if almost every training item contains it. Lowering its relative weight allows the representation to retain it alongside less pervasive patterns. This operation uses how often the pattern is found across documents, before the classifier asks whether those documents disproportionately belong to a particular label. A high inverse document-frequency factor thus expresses rarity across documents. The fit still has to determine whether that rarity is associated with a category.

For the smoothed version, the paper describes a count adjustment that can be represented as follows.

```
Dₛ(g) = D(g) + δ
```

The symbol `g` again identifies a feature. The function `D(g)` counts the documents that contain it, and `Dₛ(g)` is the adjusted document frequency, with `ₛ` marking smoothing. The added count is `δ`, described in the paper as one. The operation `+` adds that count, and `=` relates the adjusted frequency to the original. Barbaresi explains the procedure by imagining an extra document containing the entire feature vocabulary. This describes the count adjustment in the paper’s general explanation, as opposed to specifying every term of the toolkit’s weighting equation.

The implementation footnote gives a specific Bayesline setup in scikit-learn. It specifies a character analyzer, lengths 2 to 6, lowercasing, no accent stripping, sublinear term frequency, inverse document frequency, and L2 normalization. It gives `min_df` as 0 and the smooth inverse document-frequency switch as `False`. Sublinear term frequency reduces the extra influence gained from repeated occurrences in the same item compared with a raw count. The footnote’s setting for document-frequency smoothing differs from the smoothed procedure discussed in the main text. The documented switch is the clearest guide to the particular configuration printed there, and the general description explains a weighting option considered in the paper.

Once the weights have been assigned, the system scales each nonempty feature vector by its L2 norm. In schematic notation:

```
v(d) = a(d) / ‖a(d)‖₂
```

Here `a(d)` is the vector of pre-normalization weights for document `d`, and `v(d)` is its scaled vector. The notation `‖a(d)‖₂` denotes the L2 norm, obtained by squaring the entries, summing those squares, and taking the square root. The subscript `₂` indicates the type of norm. The slash `/` divides all the entries by that common quantity, and `=` identifies the result. This expression applies when the norm is non-zero.

The row scaling preserves the proportions among populated entries in a sample while making its overall magnitude comparable with that of other samples. Otherwise a sample with more recognized fragments could have a larger magnitude simply because there is more material to count. Inverse document frequency makes a different change. It can alter the proportions within a sample by multiplying different columns by different factors. Both operations affect the evidence available during fitting, and the paper reports a marginal gain from L2 normalization.

#### Turning evidence into a Bayesian decision

Multinomial Naive Bayes learns feature distributions for the target categories. A sequence can favor one label when the training observations make it more expected under that label than under its competitors. For an unseen item, the classifier combines the feature contributions under each possible class and compares the resulting assessments. The paper uses those assessments to make a categorical decision.

The simplifying assumption is independence conditional on the class. In other words, once a candidate variety is specified, the method treats the occurrence evidence from the features as separable. The assumption is easy to question in this representation because neighboring windows can come from the same written form. Seeing one piece can make another piece more likely even within a single variety. The method can still rank the labels usefully. Correct decisions require the favored class to come out ahead, while accurate probabilities require the reported confidence itself to correspond to the frequencies of correct outcomes.

Naive Bayes is attractive here because the fitted quantities can be obtained by collecting feature evidence by label. Barbaresi describes the underlying computation as close to linear, with the training collection read to form the estimates and the test items processed using them. Sparse text makes that approach especially natural. The method can gather evidence about present sequences without fitting each coefficient by a sequence of adjustments based on prediction errors. The paper also argues that the estimates can be useful when labeled data are relatively limited.

The adapted Bayesline underwent cross-validation on the training data. The paper highlights a change to its additive smoothing parameter from 0.005 in the earlier procedure it describes to 0.04 for the configuration used here. This parameter concerns the classifier’s class-conditioned estimates. A known feature can have no observed occurrence under a particular class during training. Additive smoothing gives that event a non-zero estimate so that its appearance in a test item need not rule the class out. The vocabulary still determines what counts as a known feature.

The similar language about smoothing in feature weighting refers to a different calculation. Document-frequency smoothing changes a collection-wide feature factor before a label is involved. The Bayesline’s additive smoothing changes how the fitted classifier treats evidence for a particular class. The footnote explicitly documents the latter through `MultinomialNB(alpha=0.04)`. The paper also identifies the implementation as available in the `vardial-experiments` repository.

#### Fitting linear decisions with many predictors

A linear classifier learns how to add feature contributions to a decision score. Each contribution depends on a sample’s value for the feature and on a fitted coefficient. A feature can raise a candidate score, lower it, or have very little influence, depending on what the fit learns. The basic additive relation in the paper’s description can be represented as:

```
s(c, d) = b(c) + ∑g w(c, g) × v(d, g)
```

The symbol `c` denotes a candidate class and `d` an item. The quantity `s(c, d)` is a schematic class score. The term `b(c)` represents a possible class offset in this general expression. The notation `∑g` means to sum across the feature indices `g`. The coefficient attached to feature `g` for class `c` is `w(c, g)`, and the document’s normalized entry is `v(d, g)`. The sign `×` multiplies a feature value by its coefficient, `+` adds the offset, and `=` identifies the score. The paper explains the linear fit without specifying the full encoding of the targets for its submissions.

A squared-error fit seeks coefficients that let the numerical scores follow the targets assigned to the training items. With many more possible predictors than some observations can distinguish, quite different sets of coefficients can explain much the same training data. The author also emphasizes multicollinearity, the presence of strongly related predictors. For example, overlapping strings can supply almost interchangeable information in the particular examples available for training. A fit with unrestricted coefficients may respond strongly to the few cases in which their appearances diverge.

Ridge adds a cost for coefficient size. The following expression gives the general form of the fitting criterion discussed in the paper.

```
J(w) = E(w) + λ × ‖w‖₂²
```

Here `w` is the vector of fitted coefficients subject to the penalty. The function `J(w)` is the objective to minimize, and `E(w)` is the squared-error contribution from the training fit. The parameter `λ` controls the penalty’s strength. The term `‖w‖₂²` is the squared L2 norm of the coefficients, or the sum of their squares. The symbol `×` scales the penalty, `+` joins it with the error term, and `=` gives the complete objective in this schematic form. The expression captures the tradeoff Barbaresi describes without assigning a numerical value to the regularization strength.

The penalty makes a change in a coefficient worthwhile only when the improvement in training fit justifies its cost. This biases the estimates towards smaller magnitudes, which can lower the variability of the decision rule when the data are limited or highly correlated. It is a way to allow for many modest effects while limiting dependence on estimated effects that look unusually large. Ridge leaves a role for low-frequency predictors and does not explicitly produce a selected list of features. Because of this, it can use a distributed pattern of evidence and still leave the linguistic explanation spread across many coefficients.

L2 appears here because the penalty is defined from coefficient magnitudes. The earlier L2 operation was defined from the magnitudes of the input entries for an individual document. They occur at different stages and control different things. Feature normalization gives each item’s row a common scale. Ridge regularization affects which scoring rule is preferred for a set of already prepared rows.

The paper relates its Ridge formulation to linear least-squares support vector classification and describes it as faster in practice. It also points to a stochastic average gradient solver in scikit-learn as suitable for large sparse problems. The fitting problem matters to this argument because a classifier can be statistically appropriate for many correlated features and still need a practical way to optimize its criterion over the sparse representation.

#### Providing a second linear comparison

The other linear approach is a regularized classifier fitted by stochastic gradient descent, abbreviated SGD. The name refers to an iterative fitting procedure. The updates use training evidence to move the coefficients towards a better fit according to the classifier’s criterion. Barbaresi’s implementation produces a classifier equivalent to a linear support vector machine with a soft margin. A soft margin permits violations of the desired separation in training, so the fit can still establish a useful dividing rule when the samples do not separate cleanly.

This comparison gives the study a second way to learn linear scores from the same kind of weighted features. Ridge emphasizes squared error and the coefficient penalty described above. The SGD implementation brings a support vector criterion and its own training settings. Their inclusion allows the evaluation to distinguish the behavior of these particular classifiers instead of treating all linear decisions as a single alternative to Bayesline.

The SGD settings were chosen by grid search on the training collection with k-fold cross-validation. The training items are divided into folds. A candidate setting is assessed by fitting on some of those items and evaluating on a fold omitted from that fit, with the held-out role rotating through the divisions. Grid search uses these assessments to compare candidate settings. Barbaresi also describes cross-validation when refining Bayesline and reports training comparisons for Ridge. The final shared-task results concern predictions on the test material, following the choices made on training data.

### Experiments and results

#### The baselines and the scoring rule

The evaluation reports a random baseline and compares the submitted approaches using the same preparation within each task. Naive Bayes supplies the adapted Bayesline, a learned point of comparison based on earlier shared-task work. Ridge and SGD test the contribution of the separately fitted linear decision rules on that representation. The random result answers how much the systems improve over the chance reference reported for each dataset. Bayesline poses a more demanding question about what the alternatives gain over an already effective method.

The common metric in the results tables is macro F1. Precision for a variety asks what share of items predicted as that variety really have its label. Recall asks what share of the items with that label the classifier finds. F1 combines the two through their harmonic mean, so maintaining only one of them at a high level has limited value. Macro F1 takes an average of the per-variety F1 scores with the varieties weighted equally. A hard-to-classify category can therefore depress the overall result even if its items make up a modest portion of the test collection.

The tables and the competition standings provide two views of the same submissions. The tables compare the classifiers selected for XAC and the reported random result. The standings place the best XAC submission among the other teams in that particular task. Both are specific to the task. A macro F1 in one evaluation reflects its label inventory and examples, while a rank reflects the set of competitors as well.

#### Dutch and Flemish in subtitles

The DFS task supplies subtitle text for a choice between Dutch and Flemish. The feature extractor uses character lengths 2 to 6. The test is whether the observed strings supply consistent distinctions between the two labels and whether the classifier can put those distinctions to use when each item is short. With preparation shared across the submitted classifiers, the experiment compares how much they gain from the same kinds of inputs.

Macro F1 for classifiers on the DFS subtitle test set Ridge has the highest score, followed by the adapted Bayesian classifier.

**The numbers**

| System or setting | Macro F1 |
| --- | --- |
| Random baseline | 0.5000 |
| SGD | 0.6134 |
| Naive Bayes | 0.6207 |
| Ridge (this paper) | 0.6318 |

The Ridge submission reached 0.6318 on test macro F1 and placed 3rd out of 7 in DFS. Training cross-validation had also favored Ridge, according to the paper. The progression from those training observations to the test result is worth following because the settings were chosen before the final scores were compared. The cross-validation result gave a reason to favor Ridge during development, and the held-out test retained the same ordering against Bayesline.

The Bayesian run scored 0.6207 and the tuned SGD run 0.6134 on test macro F1. Both exceeded the random reference of 0.5000. The Bayesian score makes the successful Ridge comparison more demanding than the random baseline alone would suggest. It also gives the SGD result a substantive interpretation. Tuning the support vector approach on the training collection produced a competitive classifier, yet the Bayesline’s way of using the character evidence was more effective on this test.

The paper’s confusion matrix for Ridge provides a view of the mistakes behind its leading score. A confusion matrix cross-references the known label with the label the system assigned, bringing mistakes in particular directions into view. Barbaresi describes the DFS errors as fairly balanced. The difficulty was visible on both sides of the distinction. This observation is compatible with a better aggregate result for Ridge, since an advantage over other classifiers can coexist with substantial residual confusion between the classes.

#### Swiss German dialects

GDI uses Swiss German dialect samples and was a repeat task in the campaign. The paper works from the training data for the current edition. The general preparation carries over, with the window widened to lengths 1 to 6 after tests suggested that the larger range yielded a little more information. The examples had already undergone tokenization. Barbaresi describes the material as shorter and less regular than the samples in the other tasks, with features closer to what one might encounter in a speech corpus.

Macro F1 for classifiers on the GDI Swiss German test set Naive Bayes finishes ahead of the two closely matched linear classifiers.

**The numbers**

| System or setting | Macro F1 |
| --- | --- |
| Random baseline | 0.2521 |
| SGD | 0.6291 |
| Ridge | 0.6296 |
| Naive Bayes (this paper) | 0.6336 |

Naive Bayes had the highest GDI test macro F1 at 0.6336. Ridge scored 0.6296, SGD reached 0.6291, and the random baseline was 0.2521. The leading fitted systems were close to one another. The best of them placed 3rd out of 4, which was the weakest XAC standing among the tasks entered. This result shows the value of carrying a well-established baseline through the entire campaign. A system choice made from the subtitle result alone would have favored a classifier that finished behind it here.

The Naive Bayes confusion matrix highlights the difficulty of the Lucerne variety. Barbaresi reports that this was also a problem in the preceding edition and describes the gap for Lucerne as narrower with Ridge. That observation addresses a different question from the aggregate rank. A decision rule can help with one difficult category while losing some of that benefit elsewhere. Macro F1 combines the resulting per-class outcomes and can favor Bayesline even when a particular class appears to benefit from a change.

The paper also gives a historical GDI comparison of 0.634 F1 in the current competition and 0.606 in the previous one. In discussing these figures, Barbaresi suggests that the current data may be cleaner, that selecting by F1 instead of accuracy may matter, and that tuning may have helped. The figures are reported separately from the test table’s more precise macro F1 entries. They describe performance across editions, while the campaign rank describes how XAC fared against its contemporaries in the current evaluation.

#### Indo-Aryan language identification

The ILI dataset supplies the paper’s test on closely related Indo-Aryan varieties. It also places the character pipeline in a setting with a different alphabet. The dictionary can be learned afresh from the samples. A character sequence that is useful for separating the ILI labels need have no counterpart among the learned predictors for European subtitle material or Swiss German dialects. The transfer under study is in the method of obtaining and weighting the sequences.

Macro F1 for classifiers on the ILI Indo-Aryan test set Both regularized linear classifiers improve on Naive Bayes, with Ridge in the lead.

**The numbers**

| System or setting | Macro F1 |
| --- | --- |
| Random baseline | 0.2024 |
| Naive Bayes | 0.8540 |
| SGD | 0.8833 |
| Ridge (this paper) | 0.8983 |

Ridge reached a test macro F1 of 0.8983 on ILI. SGD scored 0.8833, and the adapted Bayesline scored 0.8540. The reported random result was 0.2024. Ridge’s run placed 2nd out of 6 in the competition. This was XAC’s strongest standing and the task on which both linear classifiers achieved higher test scores than Naive Bayes. The pattern is broader than on subtitles, where only the Ridge comparison favored the linear approach.

The confusion matrix for Ridge singles out AWA as the label with the lowest recall. Actual AWA items were therefore the hardest for that submission to recover as their correct label. The paper describes BRA as easier to distinguish from the other varieties. These observations qualify the picture from the high overall score in a concrete way. Predicting the right variety remained harder for some parts of the label inventory, even in the experiment where XAC made its strongest showing.

The paper suggests that morphological characteristics of the Indo-Aryan varieties may help explain why the regularized approaches improved on Bayesline. If differences recur within written forms, several lengths of character window can capture pieces of them, and a fitted linear score can weigh multiple pieces in one decision. The observed result is a better use of the shared weighted representation by the classifiers in this comparison. The linguistic explanation concerns one possible source of the evidence within it.

### What the ablations show

The paper contains no systematic component ablation, but it offers comparisons on common inputs, qualitative observations from tuning, and class-level analyses of errors.

#### What changes when the classifier changes

Within each task, keeping the preparation common makes the classifier comparison more informative than a comparison among systems that also use separate feature inventories and preprocessing. For instance, an apparent gain on a short-text task could come from a newly included sequence length if each classifier were given a different window. Barbaresi’s design instead asks which of the submitted rules can produce better decisions from the prepared evidence. The answer differs by dataset, and the reversal is more informative than a single average across tasks would be.

DFS illustrates the distinction between a broad family of techniques and a particular fitting criterion. Both alternatives use regularized linear classification, yet Ridge improves on Bayesline and SGD trails it. That order supports an advantage for the Ridge submission under the reported choices. It provides a thinner basis for attributing the gain to linearity or to the presence of regularization in general. The classifiers also bring different loss criteria, tuning choices, and ways of treating sparse evidence, all of which travel together in the comparison.

ILI gives stronger evidence that the choice of classifier mattered in that setting. Both linear entries improve on the Bayesian entry, so the result does not rest on the performance of one fitting procedure alone. The shared feature pipeline helps locate the measured advantage in how the prepared evidence was used. It does not identify the useful portion of that evidence. Establishing that recurring pieces of word structure account for the advantage would require separating them from other sequences and repeating the comparison with those sources of information controlled.

GDI provides a check against taking the result in ILI as a general preference for regularized linear fitting. The strongest overall GDI run uses Naive Bayes. Ridge’s reported behavior on Lucerne also suggests that a change of classifier may alter the allocation of errors even when the total effect on macro F1 is small. An aggregate score determines the task ordering, while class-level evidence indicates whether the competing systems have similar strengths within that ordering.

#### What the representation trials establish

The preprocessing observations give reasons for specific design choices. Preliminary comparisons favored the extra linguistic preparation slightly, and lowercasing helped in tests on training material. The author proposes sentence-initial case variation as a reason for the latter. That interpretation is consistent with the operation consolidating counts for forms that would otherwise differ in a capital letter. The discussion gives no case-specific error breakdown that would identify how often this mechanism accounts for a corrected decision.

The paper also reports a marginal improvement from scaling document vectors by the L2 norm. This supports the use of normalization in the pipeline. It leaves open how much of the improvement came from items with more recognized patterns, or whether the different classifiers benefited to the same extent. The final comparisons share that preparation, so they tell us how the classifiers performed with normalization in place.

For GDI, the move to a range beginning at length 1 followed a preliminary indication of added information. A character alone can capture something that longer fragments express less consistently across short or variable spellings. Adding a set of shorter features also changes the weights in a normalized document vector, since all the entries contribute to its scale. The paper gives the wider span and the author’s reason for choosing it. It reports no class-by-class test of where that choice helped.

The conclusion draws a further observation from supervised optimization. Barbaresi found a substantial role for small and medium effects and reports that the highest-frequency part of the spectrum could be ignored without materially harming performance. That matters because the most prevalent strings can easily dominate raw counts. Useful category evidence can lie elsewhere in the feature distribution, including among patterns that occur relatively seldom. Term weighting and shrinkage address different parts of this situation. Weighting moderates the contribution of pervasiveness to the input, and the Ridge fit limits how much authority an estimated association can acquire.

The frequency observation supports keeping a broad inventory when a hard cutoff might discard a useful fragment. It supplies no general boundary between helpful rarity and accidental rarity. A sequence with few observations may distinguish a genuine form or simply reflect the contents of a few training items. Regularization is useful precisely because the representation leaves those possibilities available and the data give uneven support for estimating their effects.

#### What the confusion matrices add

The confusion matrices turn the question from how frequently a classifier succeeds to where it has difficulty. In DFS, the leading classifier’s errors occur on both sides of the distinction in a fairly balanced pattern. In GDI, the matrix makes the recurring difficulty of Lucerne visible. In ILI, AWA’s low recall identifies a specific shortfall that the aggregate score can obscure, while the behavior of BRA shows that the system can make a clearer distinction for another label under the same preparation.

These analyses help tell apart an aggregate gain and a gain shared evenly across categories. They do not trace a given mistaken decision to a word, a spelling convention, or a coefficient associated with a particular sequence. A concentration of errors provides a place to investigate. The paper’s explanations about item length, orthography, or morphology address plausible sources of the pattern, while the matrices identify the label-level outcomes those explanations would need to account for.

### Limitations

#### Limits discussed by the author

Barbaresi emphasizes that performance in a shared task can depend on regularities of the test collection. Some of those regularities may be artificial. A character sequence can correlate with a category because of how examples were assembled, written down, or processed. An association of that kind can remain predictive on a held-out set produced in the same way and become less reliable in material collected independently. The conclusion suggests including web texts in the reference evaluation as a way to bring the task closer to ordinary language identification.

The paper also emphasizes short documents and limited labeled collections. Wide feature vectors give the classifier many ways to fit patterns whose future relevance may be uncertain. This is the argument for keeping the fitting procedure constrained, especially when each decision may depend on several small signals. In explaining why Naive Bayes stays competitive, Barbaresi invokes earlier comparisons of generative and discriminative learning. The generative approach can get close to its limiting error with less training evidence even when its eventual error is higher. That argument gives a statistical reason to consider Bayesline seriously in a low-data regime. The experiments here do not compare a sequence of training sizes to establish such a learning curve for these particular tasks.

For Swiss German, the paper points to the short, irregular, speech-like items and to possible issues of orthographic normalization. A method that counts surface strings is sensitive to how speech is represented in text. Where familiar material is written in variable ways, the observations supporting what could be one useful cue can be spread across several distinct strings. Short items give the system less opportunity to recover from such variation with other evidence. The paper also notes that the incoming examples had already been tokenized, a condition of the particular collection. These ingredients make the author’s suggested explanations plausible, while their individual effects remain unresolved.

The author recognizes a limit on interpreting Ridge through its coefficients. Shrinking the coefficients can improve predictive behavior without yielding a selected inventory of features. When several overlapping strings are all associated with a class, the fit may distribute the contribution among them. An improved score therefore gives limited grounds for naming the decisive linguistic pattern. The paper’s morphology explanation for ILI is one instance of that gap between observing a predictive improvement and establishing the source of the information.

Barbaresi discusses reducing dimensionality and combining fitted linear classifiers as future directions. A more compact representation could make other classification methods easier to apply. Bagging would combine classifiers fitted on varied samples in the hope that their aggregate decisions are more stable. The conclusion expresses uncertainty about further gains from dimensionality reduction and treats bagging as a possibility suggested by prior shared-task experience. The measured scores in this paper belong to the classifiers evaluated individually.

#### Limits apparent from the evaluation

The efficiency claim has support in the structure of the computation. The chosen methods handle sparse inputs, and the paper explains why estimating Bayesline or fitting a regularized linear decision is practical for a large feature inventory. The results tables report classification quality. They give no elapsed times, memory measurements, or throughput comparisons. A reader can recover the computational rationale from the method, while the relative speed and resource use of the submissions remain unmeasured in the reported evaluation.

The numerical scores also describe particular test sets. Individual entries are reported precisely, but there are no uncertainty intervals or repeated test measurements for the classifier contrasts. The paper describes stronger training cross-validation for Ridge on DFS, without giving the spread of the scores across folds. Those observations support the ranking observed in the experiment. They leave open how frequently the closest orderings, particularly on GDI, would recur with a new sample drawn for the same distinction. Language about a substantially better result in the discussion should be read alongside the measured scores and the absence of a reported statistical test of those differences.

Cross-task comparisons add several sources of variation at once. The three datasets differ in what the labels refer to, the input that carries those labels, and the sequence span selected where the paper reports a change. ILI shows that the processing chain can succeed with the other alphabet tested. The study does not change the alphabet independently of the language varieties and text collection. Similarly, the GDI result combines the effects of the dialect distinction and the source material with a different field of competitors. Its standing is a useful description of the shared-task outcome and a weak basis for estimating the effects of individual data properties.

The historical GDI comparison has its own uncertainty. An edition can change the training and test materials, and the discussion identifies changes in selection and parameter tuning as well. The higher reported F1 establishes the direction of the comparison the paper makes. It cannot determine which change produced the improvement or whether different choices would help by similar amounts on an unchanged collection.

Some information needed for exact reconstruction is unevenly documented. The Bayesline footnote is specific about the vectorizer and its additive smoothing setting. The discussion of inverse document frequency elsewhere describes smoothing, whereas the concrete switch in the footnote is `False`. The complete SGD search grid and every selected classifier setting are also absent from the methodological account. These details matter when trying to reproduce a small numerical difference or attribute it to one choice. The tables are more informative about the behavior of the submitted configurations as a whole.

Finally, the experiments give each item a choice among the task’s known labels. That setting tests recognition of categories represented in the training and test protocol. It leaves open what score should trigger abstention, how the evidence would be interpreted for a sample containing more than one variety, and what would happen to material whose variety falls outside the supplied inventory. Those cases would require observations and decision criteria beyond the shared-task scores.

### What came after

The campaign report is a contemporaneous connection. Barbaresi cites it as the account of the evaluation in which the XAC experiments took place, and the report in turn cites his contribution. Its scope includes language identification and morphosyntactic tagging across the campaign. The connection on the identification side is primarily evaluative. The XAC paper describes what happens when its classifiers change while data preparation stays common, and the campaign report places work of that kind within the shared tasks and their standings. [The Second VarDial Evaluation Campaign](https://md.research.elamur.ai/free/en/papers/zampieri-2018-language-identification-morphosyntactic-tagging-second/).

The study on classifier ensembles addresses a next question in the same application area. Barbaresi evaluates several rules individually and finds that their relative strengths vary across tasks. He also raises the possibility of combining fitted linear classifiers to obtain more stable predictions. An ensemble study makes the combination itself the subject of investigation. That is the documented point of contact here. The citing relationship and the study’s title leave its feature preparation, constituent classifiers, and use of the particular XAC bagging proposal unspecified. [Classifier Ensembles for Dialect and Variety Identification](https://md.research.elamur.ai/free/en/papers/dinu-2018-classifier-ensembles-dialect-language-variety/).

The work on syntactic variation places detectable differences among varieties in a broader account of grammar. Barbaresi’s experiments start from labeled short items and ask how reliably their character patterns can recover the categories. The citing study’s stated subject is variation across the grammar, treated as part of a complex adaptive system. The two questions meet at the distinction between predicting a variety and describing the linguistic variation behind it. A predictive character pattern can be evidence for a label while leaving its grammatical role to be established by other means. The citation connects the studies without specifying a transfer of XAC’s representation or its classification procedure. [Syntactic Variation Across the Grammar](https://md.research.elamur.ai/free/en/papers/dunn-2023-syntactic-variation-across-grammar-modelling/).

## Cite

Cite as Adrien Barbaresi. 2018. Computationally efficient discrimination between language varieties with large feature vectors and regularized classifiers. Proceedings of the Fifth Workshop on NLP for Similar Languages, Varieties and Dialects (VarDial 2018).

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

```bibtex
@inproceedings{adrien2018computationally,
  title = {{Computationally efficient discrimination between language varieties with large feature vectors and regularized classifiers}},
  author = {Adrien Barbaresi},
  booktitle = {Proceedings of the Fifth Workshop on NLP for Similar Languages, Varieties and Dialects (VarDial 2018)},
  year = {2018},
  url = {https://aclanthology.org/W18-3918/}
}
```

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