模型:
flax-community/roberta-hindi
Pretrained model on Hindi language using a masked language modeling (MLM) objective. A more interactive & comparison demo is available here .
This is part of the Flax/Jax Community Week , organized by Hugging Face and TPU usage sponsored by Google.
RoBERTa Hindi is a transformers model pretrained on a large corpus of Hindi data(a combination of mc4, oscar and indic-nlp datasets)
You can use this model directly with a pipeline for masked language modeling:
>>> from transformers import pipeline >>> unmasker = pipeline('fill-mask', model='flax-community/roberta-hindi') >>> unmasker("हम आपके सुखद <mask> की कामना करते हैं") [{'score': 0.3310680091381073, 'sequence': 'हम आपके सुखद सफर की कामना करते हैं', 'token': 1349, 'token_str': ' सफर'}, {'score': 0.15317578613758087, 'sequence': 'हम आपके सुखद पल की कामना करते हैं', 'token': 848, 'token_str': ' पल'}, {'score': 0.07826550304889679, 'sequence': 'हम आपके सुखद समय की कामना करते हैं', 'token': 453, 'token_str': ' समय'}, {'score': 0.06304813921451569, 'sequence': 'हम आपके सुखद पहल की कामना करते हैं', 'token': 404, 'token_str': ' पहल'}, {'score': 0.058322224766016006, 'sequence': 'हम आपके सुखद अवसर की कामना करते हैं', 'token': 857, 'token_str': ' अवसर'}]
The RoBERTa Hindi model was pretrained on the reunion of the following datasets:
The texts are tokenized using a byte version of Byte-Pair Encoding (BPE) and a vocabulary size of 50265. The inputs of the model take pieces of 512 contiguous token that may span over documents. The beginning of a new document is marked with <s> and the end of one by </s> .
The details of the masking procedure for each sentence are the following:
The model was trained on Google Cloud Engine TPUv3-8 machine (with 335 GB of RAM, 1000 GB of hard drive, 96 CPU cores).A randomized shuffle of combined dataset of mC4, oscar and other datasets listed above was used to train the model. Training logs are present in wandb .
RoBERTa Hindi is evaluated on various downstream tasks. The results are summarized below.
Task | Task Type | IndicBERT | HindiBERTa | Indic Transformers Hindi BERT | RoBERTa Hindi Guj San | RoBERTa Hindi |
---|---|---|---|---|---|---|
BBC News Classification | Genre Classification | 76.44 | 66.86 | 77.6 | 64.9 | 73.67 |
WikiNER | Token Classification | - | 90.68 | 95.09 | 89.61 | 92.76 |
IITP Product Reviews | Sentiment Analysis | 78.01 | 73.23 | 78.39 | 66.16 | 75.53 |
IITP Movie Reviews | Sentiment Analysis | 60.97 | 52.26 | 70.65 | 49.35 | 61.29 |
Huge thanks to Hugging Face ? & Google Jax/Flax team for such a wonderful community week, especially for providing such massive computing resources. Big thanks to Suraj Patil & Patrick von Platen for mentoring during the whole week.