/ Модель

Характеристики

Контекст
512 токенов
Параметры
138 млн
Архитектура
electra · dense
Опубликована
2 мар 2022

banglabert

Языковая модель5 профессий

Предобученный бенгалоязычный дискриминатор ELECTRA для дообучения на задачах классификации, распознавания сущностей и понимания текста.

39 606скачиваний за 30 дней44лайкавеса обновлены23 дек 2022

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

BanglaBERT — предварительно обученный дискриминатор ELECTRA, разработанный командой CSE BUET для обработки текста на бенгальском языке. Модель содержит 137,8 млн параметров, использует цель обучения Replaced Token Detection (RTD) и принимает последовательности длиной до 512 токенов. Репозиторий содержит веса PyTorch.

Чекпойнт предназначен прежде всего для дообучения под задачи классификации тональности, распознавания именованных сущностей, вывода на естественном языке и ответов на вопросы. Прикладные модели на его основе показывали высокие результаты на ряде бенгальских NLP-задач. Для лучших результатов текст нужно нормализовать тем же конвейером, который использовался при предобучении; после этого модельные представления можно применять в задачах классификации и разметки. Лицензия в предоставленных данных не указана.

Сценарии применения

  • дообучение классификатора тональности бенгальских текстов
  • распознавание именованных сущностей в бенгальском тексте
  • вывод на естественном языке для бенгальских предложений
  • дообучение модели ответов на вопросы по бенгальским текстам
  • получение представлений бенгальского текста для downstream NLP-задач

Ограничения

Для качественной работы требуется нормализация текста конвейером, использованным при предобучении. Это дискриминаторный чекпойнт для дальнейшего дообучения, а не готовый универсальный чат-генератор.

Для каких профессий подходит5

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

BanglaBERT

This repository contains the pretrained discriminator checkpoint of the model BanglaBERT. This is an ELECTRA discriminator model pretrained with the Replaced Token Detection (RTD) objective. Finetuned models using this checkpoint achieve state-of-the-art results on many of the NLP tasks in bengali.

For finetuning on different downstream tasks such as Sentiment classification, Named Entity Recognition, Natural Language Inference etc., refer to the scripts in the official GitHub repository.

Note: This model was pretrained using a specific normalization pipeline available here. All finetuning scripts in the official GitHub repository uses this normalization by default. If you need to adapt the pretrained model for a different task make sure the text units are normalized using this pipeline before tokenizing to get best results. A basic example is given below:

Using this model as a discriminator in transformers (tested on 4.11.0.dev0)

from transformers import AutoModelForPreTraining, AutoTokenizer
from normalizer import normalize # pip install git+https://github.com/csebuetnlp/normalizer
import torch

model = AutoModelForPreTraining.from_pretrained("csebuetnlp/banglabert")
tokenizer = AutoTokenizer.from_pretrained("csebuetnlp/banglabert")

original_sentence = "আমি কৃতজ্ঞ কারণ আপনি আমার জন্য অনেক কিছু করেছেন।"
fake_sentence = "আমি হতাশ কারণ আপনি আমার জন্য অনেক কিছু করেছেন।"
fake_sentence = normalize(fake_sentence) # this normalization step is required before tokenizing the text

fake_tokens = tokenizer.tokenize(fake_sentence)
fake_inputs = tokenizer.encode(fake_sentence, return_tensors="pt")
discriminator_outputs = model(fake_inputs).logits
predictions = torch.round((torch.sign(discriminator_outputs) + 1) / 2)

[print("%7s" % token, end="") for token in fake_tokens]
print("\n" + "-" * 50)
[print("%7s" % int(prediction), end="") for prediction in predictions.squeeze().tolist()[1:-1]]
print("\n" + "-" * 50)

Benchmarks

  • Zero-shot cross-lingual transfer-learning
ModelParamsSC (macro-F1)NLI (accuracy)NER (micro-F1)QA (EM/F1)BangLUE score
mBERT180M27.0562.2239.2759.01/64.1850.35
XLM-R (base)270M42.0372.1845.3755.03/61.8355.29
XLM-R (large)550M49.4978.1356.4871.13/77.7066.59
BanglishBERT110M48.3975.2655.5672.87/78.6366.14
  • Supervised fine-tuning
ModelParamsSC (macro-F1)NLI (accuracy)NER (micro-F1)QA (EM/F1)BangLUE score
mBERT180M67.5975.1368.9767.12/72.6470.29
XLM-R (base)270M69.5478.4673.3268.09/74.2772.82
XLM-R (large)550M70.9782.4078.3973.15/79.0676.79
sahajBERT18M71.1276.9270.9465.48/70.6971.03
BanglishBERT110M70.6180.9576.2872.43/78.4075.73
BanglaBERT110M72.8982.8077.7872.63/79.3477.09

The benchmarking datasets are as follows:

Citation

If you use this model, please cite the following paper:

@inproceedings{bhattacharjee-etal-2022-banglabert,
    title = "{B}angla{BERT}: Language Model Pretraining and Benchmarks for Low-Resource Language Understanding Evaluation in {B}angla",
    author = "Bhattacharjee, Abhik  and
      Hasan, Tahmid  and
      Ahmad, Wasi  and
      Mubasshir, Kazi Samin  and
      Islam, Md Saiful  and
      Iqbal, Anindya  and
      Rahman, M. Sohel  and
      Shahriyar, Rifat",
    booktitle = "Findings of the Association for Computational Linguistics: NAACL 2022",
    month = jul,
    year = "2022",
    address = "Seattle, United States",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2022.findings-naacl.98",
    pages = "1318--1327",
    abstract = "In this work, we introduce BanglaBERT, a BERT-based Natural Language Understanding (NLU) model pretrained in Bangla, a widely spoken yet low-resource language in the NLP literature. To pretrain BanglaBERT, we collect 27.5 GB of Bangla pretraining data (dubbed {`}Bangla2B+{'}) by crawling 110 popular Bangla sites. We introduce two downstream task datasets on natural language inference and question answering and benchmark on four diverse NLU tasks covering text classification, sequence labeling, and span prediction. In the process, we bring them under the first-ever Bangla Language Understanding Benchmark (BLUB). BanglaBERT achieves state-of-the-art results outperforming multilingual and monolingual models. We are making the models, datasets, and a leaderboard publicly available at \url{https://github.com/csebuetnlp/banglabert} to advance Bangla NLP.",
}

If you use the normalization module, please cite the following paper:

@inproceedings{hasan-etal-2020-low,
    title = "Not Low-Resource Anymore: Aligner Ensembling, Batch Filtering, and New Datasets for {B}engali-{E}nglish Machine Translation",
    author = "Hasan, Tahmid  and
      Bhattacharjee, Abhik  and
      Samin, Kazi  and
      Hasan, Masum  and
      Basak, Madhusudan  and
      Rahman, M. Sohel  and
      Shahriyar, Rifat",
    booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
    month = nov,
    year = "2020",
    address = "Online",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/2020.emnlp-main.207",
    doi = "10.18653/v1/2020.emnlp-main.207",
    pages = "2612--2623",
    abstract = "Despite being the seventh most widely spoken language in the world, Bengali has received much less attention in machine translation literature due to being low in resources. Most publicly available parallel corpora for Bengali are not large enough; and have rather poor quality, mostly because of incorrect sentence alignments resulting from erroneous sentence segmentation, and also because of a high volume of noise present in them. In this work, we build a customized sentence segmenter for Bengali and propose two novel methods for parallel corpus creation on low-resource setups: aligner ensembling and batch filtering. With the segmenter and the two methods combined, we compile a high-quality Bengali-English parallel corpus comprising of 2.75 million sentence pairs, more than 2 million of which were not available before. Training on neural models, we achieve an improvement of more than 9 BLEU score over previous approaches to Bengali-English machine translation. We also evaluate on a new test set of 1000 pairs made with extensive quality control. We release the segmenter, parallel corpus, and the evaluation set, thus elevating Bengali from its low-resource status. To the best of our knowledge, this is the first ever large scale study on Bengali-English machine translation. We believe our study will pave the way for future research on Bengali-English machine translation as well as other low-resource languages. Our data and code are available at https://github.com/csebuetnlp/banglanmt.",
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

У модели не указана задача.

Класс архитектуры
ElectraForPreTraining
Ревизия весов
9ce791f

0 моделей