Abstract
Traditional language identification (LID) systems often fail when speakers mix multiple languages within a single word—a common occurrence in morphologically rich languages. This paper introduces a subword-level LID task that simultaneously segments and tags these "mixed" words using Segmental Recurrent Neural Networks (SegRNNs), significantly outperforming standard word-level baselines on Spanish–Wixarika and German–Turkish datasets.
Introduction
Code-switching (CS)—the practice of alternating between languages in a single conversation—is a major hurdle for Natural Language Processing (NLP). Most existing LID systems operate under the "one language per token" assumption. If a word is composed of parts from two languages (e.g., a Spanish verb root with a Wixarika suffix), standard systems simply label the whole word as "mixed."
This approach is problematic for two reasons. First, there is significant information loss. In polysynthetic languages like Wixarika, a single word can contain as much information as an entire English sentence. Labeling it merely as "mixed" throws away vital grammatical and semantic data. Second, intra-word mixing is not a rare edge case; in certain language pairs, it is a core feature of how bilingual communities speak.
The authors propose moving the LID task to the subword level, where the goal is to both find the boundaries between language shifts within a word and correctly identify the language of each resulting segment.
Methodology
The researchers propose using a Segmental Recurrent Neural Network (SegRNN). Unlike standard RNNs that process data character-by-character or word-by-word, a SegRNN models the joint probability of segment lengths and their corresponding labels.
The SegRNN offers two primary advantages:
- Joint Modeling: It decides where a segment ends and what its language is at the same time, rather than tagging a pre-defined segment.
- Flexibility: It can handle segments of varying lengths, which is essential since morphemes vary greatly in size.
The authors compared this to several baselines, including pipeline systems (which first tag a word as "mixed" and then segment it) and a CharBiLSTM (which tags every character and splits the word whenever the ID changes).
Datasets
The study evaluates models on two distinct language pairs:
- Spanish–Wixarika (ES–WIX): A new dataset introduced in this paper. Wixarika is a polysynthetic indigenous Mexican language. This pair is particularly challenging because intra-word mixing is very frequent (over 16% of sentences contain mixed words).
- German–Turkish (DE–TR): Adapted from an existing Twitter corpus. Turkish is agglutinative, making it a prime candidate for intra-word CS when used alongside German.
Results and Discussion
The SegRNN proved to be the superior architecture, especially for the most difficult tokens. On the Spanish–Wixarika dataset, the SegRNN achieved a segmentation F1-score of 68.5, compared to 58.5 for the best pipeline baseline. For tagging segments within mixed words, the SegRNN outperformed baselines by over 10% in some metrics.
A key insight is that traditional LID systems hit a performance ceiling because they treat "mixed" as a terminal category. By breaking the word open, the SegRNN accesses the underlying linguistic structure. Furthermore, pipeline approaches suffer from "error propagation"—if the first model fails to identify a word as mixed, the second model never gets a chance to segment it. The SegRNN avoids this by considering segmentation and tagging as a single unified problem.
Conclusion
While SegRNNs are more computationally expensive than simple BiLSTMs, they demonstrate a remarkable ability to generalize the patterns of how languages are combined, even with relatively small datasets. Future work may involve better distinguishing between foreign language segments and Named Entities, which confusion matrices show remain a source of model error.
Summary updated