Spoken dialect identification in Twitter using a multi-filter architecture

Mohammadreza Banaei, Rémi Lebret, Karl AbererarXiv 2020

TL;DR

Researchers from EPFL developed a high-performance, multi-stage neural architecture to identify Swiss German (GSW) tweets. By chaining a recall-heavy BERT model with a precision-focused fastText filter, they achieved a stellar F1-score of 0.982, significantly outperforming standard language identification baselines.

What Problem Does This Paper Address?

Language Identification (LID) is the first step in almost every Natural Language Processing (NLP) pipeline, but it fails miserably on low-resource dialects. Swiss German (GSW) is a prime example: it is primarily a spoken dialect with no standard spelling, a complex dialect continuum, and significant grammatical differences from Standard German.

Existing tools like Twitter’s built-in LID or Facebook’s fastText often misclassify GSW as Standard German. In fact, the authors note that the standard fastText LID model has a dismal recall of only 0.362 for Swiss German. The challenge lies in creating a model that can distinguish GSW from closely related languages (like German or Dutch) even when the text is short, informal, and lacks consistent orthography.

Methods

The authors propose a multi-filter architecture designed to balance the trade-off between finding all GSW samples (recall) and ensuring those samples are actually GSW (precision).

  1. Filter 1: The Recall Specialist (Fine-tuned BERT): The first stage uses a bert-base-german-cased model. Instead of freezing the BERT weights, the authors fine-tuned the entire body to account for the syntactic and vocabulary shifts between Standard German and GSW. To favor recall, they cleverly used a domain mismatch: training the non-GSW classes on formal text (Wikipedia/News) while training the GSW class on informal social media text. This biases the model to "catch" informal GSW tweets more easily.

  2. Filter 2: The Precision Specialist (fastText): Samples that pass the first filter enter a second, simpler fastText classifier. This model is trained on domain-specific data (Twitter and SMS) and uses a high probability threshold (64%) to label a tweet as GSW, acting as a final "sanity check" to remove false positives.

Crucially, both filters are multi-class classifiers rather than binary ones. By including "GSW-like" languages (Bavarian, Palatine German, etc.) as separate labels during training, the model learns the subtle boundaries that distinguish Swiss German from its neighbors.

Datasets

The study utilized several distinct datasets to train the two-stage pipeline:

  • For Filter 1: A large-scale dataset (250k samples per class) combining the Leipzig corpora for formal languages and SwissCrawl for informal Swiss German.
  • For Filter 2: A smaller, domain-specific dataset featuring tweets from SEPLN 2014, the Carter et al. (2013) dataset, and the Swiss SMS corpus.
  • Evaluation: The model was tested on the SwissText & KONVENS 2020 shared task 2 dataset, which consists of manually labeled GSW and non-GSW tweets.

The distribution of samples for these filters can be seen in the tables below:

Distribution of samples in the first filter dataset Distribution of samples in the second filter dataset

Key Insights and Ideas

  • Recall-then-Precision Pipeline: Chaining filters with different objectives is more effective than trying to optimize a single model for both. The first filter acts as a wide net, while the second acts as a fine sieve.
  • Domain Bias as a Feature: Using formal data for negative samples and informal data for positive samples is a clever way to bake a "recall bias" into a transformer model without manually tweaking loss functions.
  • Full Fine-tuning is Mandatory: The authors found that freezing the BERT body was sub-optimal. Because GSW introduces so many "unseen" words and different syntax compared to Standard German, the underlying embeddings and attention mechanisms needed to be updated.
  • Multi-class > Binary: Training the model to recognize what GSW isn't (by providing examples of similar dialects) is more effective than simply telling it what GSW is.

Key Results

The multi-filter approach achieved an F1-score of 0.982 on the shared task test set. As shown in Table 4, this is a massive leap over the fastText baseline, which struggled with a very low recall.

Table 4: Filters performance on the shared task test-set compared to fastText (Joulin et al., 2016) LID baseline

Interestingly, the BERT filter did the heavy lifting, removing the vast majority of non-GSW samples (2741), while the fastText filter provided a final polish by removing an additional 35 false positives.

Table 5: Number of Non-GSW removals by each filter

Limitations and Future Work

While highly effective, the model currently relies solely on text content. The authors acknowledge that incorporating metadata—such as geo-location or user profiles—could further improve accuracy for difficult-to-distinguish dialects.

Additionally, they suggest that explicitly modeling orthographic conventions (specific spelling patterns unique to GSW) might capture nuances that even a deep model like BERT might miss. Future work could also explore extending this $N$-filter architecture to even more complex language identification scenarios.

Summary updated

BibTeX
@misc{banaei2020spoken,
  author = {Mohammadreza Banaei and Rémi Lebret and Karl Aberer},
  title = {{Spoken dialect identification in Twitter using a multi-filter architecture}},
  year = {2020},
  eprint = {2006.03564},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.03564},
}
Figure