After downloading these corpora, we preprocessed it as a Bert format. which is one sentence per line and an extra newline for new documents.
sentence 1
sentence 2
sentence 1
sentence 2
Building Vocab
We used BNLP package for training bengali sentencepiece model with vocab size 102025. We preprocess the output vocab file as Bert format.
Our final vocab file availabe at https://github.com/sagorbrur/bangla-bert and also at huggingface model hub.
Currently released model follows bert-base-uncased model architecture (12-layer, 768-hidden, 12-heads, 110M parameters)
Total Training Steps: 1 Million
The model was trained on a single Google Cloud GPU
Evaluation Results
LM Evaluation Results
After training 1 million steps here are the evaluation results.
global_step = 1000000
loss = 2.2406516
masked_lm_accuracy = 0.60641736
masked_lm_loss = 2.201459
next_sentence_accuracy = 0.98625
next_sentence_loss = 0.040997364
perplexity = numpy.exp(2.2406516) = 9.393331287442784
Loss for final step: 2.426227
Downstream Task Evaluation Results
Evaluation on Bengali Classification Benchmark Datasets
Huge Thanks to Nick Doiron for providing evaluation results of the classification task.
He used Bengali Classification Benchmark datasets for the classification task.
Comparing to Nick's Bengali electra and multi-lingual BERT, Bangla BERT Base achieves a state of the art result.
Here is the evaluation script.
We evaluated Bangla-BERT-Base with Wikiann Bengali NER datasets along with another benchmark three models(mBERT, XLM-R, Indic-BERT). Bangla-BERT-Base got a third-place where mBERT got first and XML-R got second place after training these models 5 epochs.
@misc{Sagor_2020,
title = {BanglaBERT: Bengali Mask Language Model for Bengali Language Understanding},
author = {Sagor Sarker},
year = {2020},
url = {https://github.com/sagorbrur/bangla-bert}
}