Manuscript Offprint

arXiv:2609.11851

IndicTriMix: Developing Language Identification Datasets and Models for Tri-Language Code-Mixing

Pruthwik Mishra, Rudra Trivedi, Avi Patel, Ashok Urlana, Shrikant Malviya

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Language identification in code-mixed text, largely observed in social media, is highly essential when users frequently switch between multiple languages within a single utterance. Accurately identifying the languages of code-mixed tokens becomes an urgent necessity. Traditional language identification models, designed for monolingual text, are not well suited for token-level language identification in code-mixed settings. We formulate the task as a sequence labeling problem and fine-tune contextual transformer-based models MuRIL and XLM-RoBERTa best suited for Indian languages. We evaluate these systems on three different data configurations (Hindi, Gujarati, and Bengali) to predict language labels for individual tokens. We release a benchmark for language identification in code-mixed tokens with manually annotated test sets. We propose two approaches of code-mixed generation using parallel sentences of three languages. The trained models demonstrate the effectiveness of contextual embeddings for token-level language identification in multilingual social media text. For reproducibility and to facilitate future research, we publicly release our fine-tuned models 1^{1}, datasets 2^{2}, and source code 3^{3}.

1 Introduction

Social media platforms have seen a massive surge in multilingual user engagement, where code-mixing is the alternating use of two or more languages within a single conversation or utterance. For multilingual societies like India, around 7% of the population speaks three languages (Wikipedia, 2011). Individuals frequently intermix English with regional languages such as Hindi, Bengali, and Gujarati.

While conventional language identification (LID) tools perform reliably at the document or sentence level for monolingual texts, they fail significantly when applied to code-mixed user-generated content. Code-mixed text demands a token-level fine-grained classification framework, transforming the task into a structured sequence labeling problem.

Code-mixing, in principle, is a phenomenon that can blend two or more languages or dialects in a single utterance. But the token-level language identification task has been limited to two languages (Amin et al., 2023; Patra et al., 2018; Barman et al., 2014; Bali et al., 2014; Sheth et al., 2026; Kodali et al., 2022) with a single matrix language and one embedded language. Very few works (Goswami et al., 2023; Raihan et al., 2023, 2024) have explored three-language code-mixed data, focusing on downstream tasks such as offensive language identification, sentiment analysis, and emotion detection, respectively, and are limited to English, Hindi, and Bengali. We attempt to develop language-agnostic techniques that can be applied and generalized to any three languages given 3-way parallel corpora.

In this paper, we present our models for language tag detection in multi-lingual code-mixed settings. Building upon the Transformer architecture (Vaswani et al., 2017), we fine-tune multilingual transformer models, specifically MuRIL (Khanuja et al., 2021) and XLM-RoBERTa (Conneau et al., 2020), under three training configurations and evaluate each model on the corresponding in-domain development and test sets, framing the task as a token classification problem. Our models are trained to process code-mixed social media sentences and assign accurate linguistic tags to every constituent token.

1^{1}https://huggingface.co/avi-patel/indictrimix-models

2^{2}https://huggingface.co/datasets/avi-patel/indictrimix-dataset

3^{3}https://github.com/Avi4306/IndicTriMix