Skip to main content
QUICK REVIEW

[Paper Review] L3Cube-HingCorpus and HingBERT: A Code Mixed Hindi-English Dataset and BERT Language Models

Ravindra Nayak, Raviraj Joshi|arXiv (Cornell University)|Apr 18, 2022
Natural Language Processing TechniquesComputer Science21 citations
TL;DR

The paper introduces L3Cube-HingCorpus, a large real Hindi-English code-mixed corpus, and HingBERT family models pre-trained on it, showing improvements on GLUECoS tasks; also releases HingLID and HingGPT resources.

ABSTRACT

Code-switching occurs when more than one language is mixed in a given sentence or a conversation. This phenomenon is more prominent on social media platforms and its adoption is increasing over time. Therefore code-mixed NLP has been extensively studied in the literature. As pre-trained transformer-based architectures are gaining popularity, we observe that real code-mixing data are scarce to pre-train large language models. We present L3Cube-HingCorpus, the first large-scale real Hindi-English code mixed data in a Roman script. It consists of 52.93M sentences and 1.04B tokens, scraped from Twitter. We further present HingBERT, HingMBERT, HingRoBERTa, and HingGPT. The BERT models have been pre-trained on codemixed HingCorpus using masked language modelling objectives. We show the effectiveness of these BERT models on the subsequent downstream tasks like code-mixed sentiment analysis, POS tagging, NER, and LID from the GLUECoS benchmark. The HingGPT is a GPT2 based generative transformer model capable of generating full tweets. We also release L3Cube-HingLID Corpus, the largest code-mixed Hindi-English language identification(LID) dataset and HingBERT-LID, a production-quality LID model to facilitate capturing of more code-mixed data using the process outlined in this work. The dataset and models are available at https://github.com/l3cube-pune/code-mixed-nlp .

Motivation & Objective

  • Motivate and build a large-scale real Hindi-English code-mixed corpus in Roman script to address scarcity of real code-mixed data.
  • Pre-train BERT-based models on HingCorpus to create HingBERT, HingMBERT, and HingRoBERTa for code-mixed NLP.
  • Evaluate the models on downstream code-mixed tasks (LID, POS tagging, NER, Sentiment) from GLUECoS benchmark.
  • Release accompanying resources (HingLID, HingGPT, HingFT) to support code-mixed Hindi-English NLP research.

Proposed method

  • Scrape Twitter data using a targeted Hindi-English word vocabulary to build HingCorpus in Roman script.
  • Filter and classify words with a word-level LID model; retain sentences with at least 2 Hindi and 2 English words.
  • Pre-train BERT variants (BERT-base, m-BERT, XLM-RoBERTa) on HingCorpus using MLM (15% masking) for 2 epochs; produce HingBERT, HingMBERT, HingRoBERTa.
  • Fine-tune the pre-trained models on downstream tasks from GLUECoS; use [CLS] embeddings with a feed-forward head for classification tasks.
  • Create Roman-script and mixed-script (Roman+Devanagari) versions of models; evaluate on mixed-script Devanagari tasks.

Experimental results

Research questions

  • RQ1Can a large-scale real Hinglish corpus improve code-mixed language understanding compared to models trained on monolingual or synthetic data?
  • RQ2Do HingBERT-family models outperform baseline BERT variants on code-mixed LID, POS, NER, and sentiment tasks?
  • RQ3What is the impact of mixed-script training (Roman+Devanagari) on downstream code-mixed tasks?
  • RQ4How effective are the released resources (LID corpus, HingBERT-LID, HingGPT) for expanding Hinglish NLP research?

Key findings

  • HingBERT-family models achieve higher F1 and accuracy on code-mixed tasks than baseline BERT variants in Roman script.
  • XLM-RoBERTa-based HingRoBERTa generally performs best among the HingBERT variants on most roman-script tasks, achieving SOTA-like results on several metrics.
  • Mixed-script HingBERT-mixed and HingRoBERTa-mixed improve performance on mixed-script Devanagari+Roman tasks, though not universally across all tasks.
  • The roman-script models outperform their mixed-script counterparts on pure roman-script tasks, while mixed-script models excel on mixed-script evaluation.
  • HingBERT-LID achieves 98.77 on HingLID test set (public release) and HingLID-based models enable expansive Hinglish data augmentation.
  • HingGPT provides a GPT-2 based generator trained on HingCorpus capable of producing full tweets, supporting synthetic code-mixed data generation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.