Language Informed Modeling of Code-Switched Text

Khyathi Raghavi Chandu, Thomas Manzini, Sumeet Singh, Alan W. BlackCodeSwitch @ ACL 2018 · DOI

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:

  1. Base AWD-LSTM: A standard word-level sequence model.
  2. Language Aware Encoder: Incorporates a 16-dimensional language ID vector alongside word embeddings as input.
  3. Language Aware Decoder: Modifies the output layer to predict both the next word and its language.
  4. Language Aware Encoder & Decoder: Combines both strategies using a dual-objective loss function.
The proposed architecture showing the integration of language embeddings and a dual-objective decoder for word and language prediction.

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.

Perplexity results for the four model variations across Train, Dev, and Test sets.

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

BibTeX
@inproceedings{chandu2018language,
  author = {Khyathi Raghavi Chandu and Thomas Manzini and Sumeet Singh and Alan W. Black},
  title = {{Language Informed Modeling of Code-Switched Text}},
  booktitle = {CodeSwitch @ ACL},
  year = {2018},
  doi = {10.18653/v1/w18-3211},
}
Figure