readme: ---
  thumbnail: https://huggingface.co/front/thumbnails/google.png
  license: apache-2.0
  ---
  MuRIL: Multilingual Representations for Indian Languages
  ===
  MuRIL is a BERT model pre-trained on 17 Indian languages and their transliterated counterparts. We have released the pre-trained model (with the MLM layer intact, enabling masked word predictions) in this repository. We have also released the encoder on [TFHub](https://tfhub.dev/google/MuRIL/1) with an additional pre-processing module, that processes raw text into the expected input format for the encoder. You can find more details on MuRIL in this [paper](http://arxiv.org/abs/2103.10730).
  
  ## Overview
  
  This model uses a BERT base architecture [1] pretrained from scratch using the
  Wikipedia [2], Common Crawl [3], PMINDIA [4] and Dakshina [5] corpora for 17 [6]
  Indian languages.
  
  We use a training paradigm similar to multilingual bert, with a few
  modifications as listed:
  
  *   We include translation and transliteration segment pairs in training as
      well.
  *   We keep an exponent value of 0.3 and not 0.7 for upsampling, shown to
      enhance low-resource performance. [7]
  
  See the Training section for more details.
  
  ## Training
  
  The MuRIL model is pre-trained on monolingual segments as well as parallel
  segments as detailed below :
  
  *   Monolingual Data : We make use of publicly available corpora from Wikipedia
      and Common Crawl for 17 Indian languages.
  *   Parallel Data : We have two types of parallel data :
      *   Translated Data : We obtain translations of the above monolingual
          corpora using the Google NMT pipeline. We feed translated segment pairs
          as input. We also make use of the publicly available PMINDIA corpus.
      *   Transliterated Data : We obtain transliterations of Wikipedia using the
          IndicTrans [8] library. We feed transliterated segment pairs as input.
          We also make use of the publicly available Dakshina dataset.
  
  We keep an exponent value of 0.3 to calculate duplication multiplier values for
  upsampling of lower resourced languages and set dupe factors accordingly. Note,
  we limit transliterated pairs to Wikipedia only.
  
  The model was trained using a self-supervised masked language modeling task. We
  do whole word masking with a maximum of 80 predictions. The model was trained
  for 1000K steps, with a batch size of 4096, and a max sequence length of 512.
  
  ### Trainable parameters
  
  All parameters in the module are trainable, and fine-tuning all parameters is
  the recommended practice.
  
  ## Uses & Limitations
  
  This model is intended to be used for a variety of downstream NLP tasks for
  Indian languages. This model is trained on transliterated data as well, a
  phenomomenon commonly observed in the Indian context. This model is not expected
  to perform well on languages other than the ones used in pretraining, i.e. 17
  Indian languages.
  
  ## Evaluation
  
  We provide the results of fine-tuning this model on a set of downstream tasks.<br/>
  We choose these tasks from the XTREME benchmark, with evaluation done on Indian language test-sets.<br/>
  We also transliterate the test-sets and evaluate on the same.<br/>
  We use the same fine-tuning setting as is used by [9], except for TyDiQA, where we use additional SQuAD v1.1 English training data, similar to [10].<br/>
  For Tatoeba, we do not fine-tune the model, and use the pooled_output of the last layer as the sentence embedding.<br/>
  All results are computed in a zero-shot setting, with English being the high resource training set language.
  
  *   Shown below are results on datasets from the XTREME benchmark (in %)
      <br/>
  
      PANX (F1) | ml    | ta    | te    | en    | bn    | hi    | mr    | ur    | Average
      :-------- | ----: | ----: | ----: | ----: | ----: | ----: | ----: | ----: | ------:
      mBERT     | 54.77 | 51.24 | 50.16 | 84.40 | 68.59 | 65.13 | 58.44 | 31.36 | 58.01
      MuRIL     | 75.74 | 71.86 | 64.99 | 84.43 | 85.97 | 78.09 | 74.63 | 85.07 | 77.60
  
      <br/>
  
      UDPOS (F1) | en    | hi    | mr    | ta    | te    | ur    | Average
      :--------- | ----: | ----: | ----: | ----: | ----: | ----: | ------:
      mBERT      | 95.35 | 66.09 | 71.27 | 59.58 | 76.98 | 57.85 | 71.19
      MuRIL      | 95.55 | 64.47 | 82.95 | 62.57 | 85.63 | 58.93 | 75.02
  
      <br/>
  
      XNLI (Accuracy) | en    | hi    | ur    | Average
      :-------------- | ----: | ----: | ----: | ------:
      mBERT           | 81.72 | 60.52 | 58.20 | 66.81
      MuRIL           | 83.85 | 70.66 | 67.70 | 74.07
  
      <br/>
  
      Tatoeba (Accuracy) | ml    | ta    | te    | bn    | hi    | mr    | ur    | Average
      :----------------- | ----: | ----: | ----: | ----: | ----: | ----: | ----: | ------:
      mBERT              | 20.23 | 12.38 | 14.96 | 12.80 | 27.80 | 18.00 | 22.70 | 18.41
      MuRIL              | 26.35 | 36.81 | 17.52 | 20.20 | 31.50 | 26.60 | 17.10 | 25.15
  
      <br/>
  
      XQUAD (F1/EM) | en          | hi          | Average
      :------------ | ----------: | ----------: | ----------:
      mBERT         | 83.85/7