/ Модель

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

Контекст
512 токенов
Параметры
137 млн
Лицензия
Apache 2.0
Архитектура
bert · dense
Опубликована
2 мар 2022

batteryscibert-uncased

Заполнение пропусковТекст → текст3 профессии

Англоязычная BERT-модель, предварительно обученная на научных статьях о батареях для восстановления пропущенных слов и извлечения признаков из профильных текстов.

354скачиваний за 30 дней0лайковвеса обновлены5 мар 2022

Бенчмарки

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

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

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

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

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

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

BatterySciBERT-uncased — англоязычная модель семейства BERT, разработанная Шу Хуаном и Жаклин Коул для анализа текстов о батареях. Она дообучена на весах SciBERT-uncased и предварительно обучена методом masked language modeling на корпусе из 400 366 научных статей о батареях, опубликованных с 2000 года по июнь 2021 года. Модель использует архитектуру BertForMaskedLM, регистр символов не учитывается, размер словаря WordPiece — 31 090 токенов, максимальная длина входа — 512 токенов.

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

Модель доступна в формате PyTorch по лицензии Apache-2.0. Её обучение охватывало публикации издательств RSC, Elsevier и Springer, выпущенные не позднее июня 2021 года, поэтому терминология и знания могут не охватывать более поздние исследования или другие области науки.

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

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

Ограничения

Модель преимущественно предназначена для профильных англоязычных научных текстов и требует дообучения для большинства прикладных задач. Она не подходит для генерации текста; обучающий корпус ограничен публикациями до июня 2021 года.

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

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

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

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

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

Открыть на Hugging Face

BatterySciBERT-uncased model

Pretrained model on a large corpus of battery research papers using a masked language modeling (MLM) objective, starting with the SciBERT-uncased weights. It was introduced in this paper and first released in this repository. This model is uncased: it does not make a difference between english and English.

Model description

BatterySciBERT is a transformers model pretrained on a large corpus of battery research papers in a self-supervised fashion, starting with the SciBERT-uncased weights. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.

More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.

This way, the model learns an inner representation of the English language that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the BERT model as inputs.

Training data

The BatterySciBERT model was pretrained on the full text of battery papers only, after initialized from the SciBERT-uncased weights. The paper corpus contains a total of 400,366 battery research papers that are published from 2000 to June 2021, from the publishers Royal Society of Chemistry (RSC), Elsevier, and Springer. The list of DOIs can be found at Github.

Training procedure

Preprocessing

The texts are lowercased and tokenized using WordPiece and a vocabulary size of 31,090. The inputs of the model are then of the form:

[CLS] Sentence A [SEP] Sentence B [SEP]

The details of the masking procedure for each sentence are the following:

  • 15% of the tokens are masked.
  • In 80% of the cases, the masked tokens are replaced by [MASK].
  • In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
  • In the 10% remaining cases, the masked tokens are left as is.

Pretraining

The model was trained on 8 NVIDIA DGX A100 GPUs for 1,000,000 steps with a batch size of 256. The sequence length was limited to 512 tokens. The optimizer used is Adam with a learning rate of 2e-5, \(\beta_{1} = 0.9\) and \(\beta_{2} = 0.999\), a weight decay of 0.01, learning rate warmup for 10,000 steps and linear decay of the learning rate after.

Intended uses & limitations

You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task. See the model hub to look for fine-tuned versions on a task that interests you.

Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification or question answering. For tasks such as text generation you should look at model like GPT2.

How to use

You can use this model directly with a pipeline for masked language modeling:

>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='batterydata/batteryscibert-uncased')
>>> unmasker("Hello I'm a <mask> model.")

Here is how to use this model to get the features of a given text in PyTorch:

from transformers import BertTokenizer, BertModel
tokenizer = BertTokenizer.from_pretrained('batterydata/batteryscibert-uncased')
model = BertModel.from_pretrained('batterydata/batteryscibert-uncased')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)

and in TensorFlow:

from transformers import BertTokenizer, TFBertModel
tokenizer = BertTokenizer.from_pretrained('batterydata/batteryscibert-uncased')
model = TFBertModel.from_pretrained('batterydata/batteryscibert-uncased')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)

Evaluation results

Final loss: 1.095.

Authors

Shu Huang: sh2009 [at] cam.ac.uk

Jacqueline Cole: jmc61 [at] cam.ac.uk

Citation

BatteryBERT: A Pre-trained Language Model for Battery Database Enhancement

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

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

GPU в ailist

Универсальный рантайм · fill-mask

Можно запустить

Подбираем GPU…

Класс архитектуры
BertForMaskedLM
Ревизия весов
e8cdd9d

0 моделей