Abstract
Researchers from Carnegie Mellon University address the challenges of modeling code-switched text, specifically Hinglish (Hindi-English). By incorporating language identifiers into a state-of-the-art AWD-LSTM architecture through multi-task learning, they demonstrate that explicit language awareness significantly improves language modeling performance, reducing perplexity across various test sets.
Introduction
Code-switching (CS)—the practice of alternating between two or more languages in a single conversation—is a global linguistic reality. However, it remains a significant challenge for Natural Language Processing (NLP) systems, which are predominantly designed for monolingual input. In CS text, the complex interaction between a "matrix" language (the grammatical foundation) and an "embedded" language (inserted elements) often leads to poor performance in standard models.
The authors focus on Language Modeling (LM) for Hinglish, a mix of Hindi and English. LM is critical for downstream tasks like speech recognition and machine translation. Hinglish is particularly difficult due to its informal nature, lack of large-scale annotated datasets, and high orthographic variation, especially when Hindi is transliterated into the Roman script.
Methodology
The proposed approach builds upon the ASGD Weight-Dropped LSTM (AWD-LSTM), a former state-of-the-art for monolingual English. To investigate the impact of language awareness, the researchers evaluated four architectural configurations:
- Base AWD-LSTM: A standard word-level sequence model.
- Language Aware Encoder: Incorporates a 16-dimensional language ID vector alongside word embeddings as input.
- Language Aware Decoder: Modifies the output layer to predict both the next word and its language.
- Language Aware Encoder & Decoder: Combines both strategies using a dual-objective loss function.
By treating language identification as a parallel task, the model learns to identify "switch points"—contexts where a transition between languages is likely to occur.
Dataset Characteristics
The study utilized a newly curated Hinglish corpus crawled from health and technology blogs. The dataset consists of 59,189 unique sentences, filtered to ensure each contains at least one word from both languages. To characterize the complexity of the switching, the authors employed metrics such as the Multilingual Index (M-Index) and the Integration Index (I-index) to quantify the extent and frequency of language switching within the data.
Experimental Results
Model performance was evaluated using perplexity (PPL), where lower values indicate better predictive accuracy. The results demonstrate that explicit language information is highly beneficial.
The "Language Aware Encoder & Decoder" model achieved the lowest test perplexity (19.52), outperforming the base model (20.92). This suggests that providing language context at the input and requiring its prediction at the output creates a more robust representation for code-switched sequences.
Conclusion and Future Directions
While effective, the model faces limitations. The current dataset is domain-specific (health and e-commerce), and performance may vary in more informal social media contexts. Additionally, the prevalence of non-standard transliterated spellings suggests that character-level encodings might further improve robustness. Future research could also explore incorporating additional linguistic features, such as Part-of-Speech (POS) tags, to better capture the underlying syntactic structure of code-switched speech.
Summary updated