/ Модель

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

Контекст
512 токенов
Параметры
138 млн
Лицензия
Apache 2.0
Архитектура
albert · dense
Опубликована
20 дек 2023

multilingual-albert-base-cased-32k

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

Многоязычная модель ALBERT с учётом регистра для предсказания скрытых токенов и получения признаков текста.

156скачиваний за 30 дней2лайкавеса обновлены5 мар 2025

Бенчмарки

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

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

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

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

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

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

mALBERT Base Cased 32k — предварительно обученная многоязычная модель на архитектуре ALBERT от автора репозитория cservan. Она обучена на задаче masked language modeling и предназначена для предсказания скрытых токенов, извлечения признаков текста и дообучения для задач классификации последовательностей, разметки токенов и ответов на вопросы. Модель учитывает регистр символов и использует общие веса для повторяющихся слоёв Transformer.

В карточке указаны 12 повторяющихся слоёв, размер скрытого представления 768, 12 голов внимания, словарь SentencePiece размером 32 тыс. токенов и 11 млн параметров; метаданные каталога указывают 137,8 млн параметров и контекст до 512 токенов. Модель обучалась на многоязычной Википедии; метаданные перечисляют поддержку широкого набора языков, включая русский, английский, французский, немецкий, испанский и китайский. Доступна в форматах PyTorch и Safetensors.

Модель подходит для заполнения масок и как основа для дообучения на прикладных задачах понимания текста. Это не авторегрессионная модель для свободной генерации текста. Лицензия — Apache-2.0.

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

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

Ограничения

Модель предназначена прежде всего для задач понимания текста и дообучения, а не для свободной авторегрессионной генерации. README и метаданные расходятся в оценке размера: README сообщает 11 млн параметров, а метаданные — 137,8 млн.

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

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

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

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

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

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

Открыть на Hugging Face

mALBERT Base Cased 32k

Pretrained multilingual language model using a masked language modeling (MLM) objective. Details about the model here. This model, unlike other ALBERT models, is cased: it does make a difference between french and French.

Model description

mALBERT is a transformers model pretrained on 16Go of French Wikipedia in a self-supervised fashion. 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 two objectives:

  • Masked language modeling (MLM): 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.
  • Sentence Ordering Prediction (SOP): mALBERT uses a pretraining loss based on predicting the ordering of two consecutive segments of text.

This way, the model learns an inner representation of the languages 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 mALBERT model as inputs.

mALBERT is particular in that it shares its layers across its Transformer. Therefore, all layers have the same weights. Using repeating layers results in a small memory footprint, however, the computational cost remains similar to a BERT-like architecture with the same number of hidden layers as it has to iterate through the same number of (repeating) layers.

This is the second version of the base model.

This model has the following configuration:

  • 12 repeating layers
  • 128 embedding dimension
  • 768 hidden dimension
  • 12 attention heads
  • 11M parameters
  • 32k of vocabulary size

Intended uses & limitations

You can use the raw model for either masked language modeling or next sentence prediction, 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

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

from transformers import AlbertTokenizer, AlbertModel
tokenizer = AlbertTokenizer.from_pretrained('cservan/multilingual-albert-base-cased-32k')
model = AlbertModel.from_pretrained("cservan/multilingual-albert-base-cased-32k")
text = "Remplacez-moi par le texte en français que vous souhaitez."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)

and in TensorFlow:

from transformers import AlbertTokenizer, TFAlbertModel
tokenizer = AlbertTokenizer.from_pretrained('cservan/multilingual-albert-base-cased-32k')
model = TFAlbertModel.from_pretrained("cservan/multilingual-albert-base-cased-32k")
text = "Remplacez-moi par le texte en français que vous souhaitez."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)

Training data

The mALBERT model was pretrained on 13go of Multiligual Wikipedia (excluding lists, tables and headers).

Training procedure

Preprocessing

The texts are lowercased and tokenized using SentencePiece and a vocabulary size of 128,000. The inputs of the model are then of the form:

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

Training

The mALBERT procedure follows the BERT setup.

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.

Tools

The tools used to pre-train the model are available here

Evaluation results

When fine-tuned on downstream tasks, the ALBERT models achieve the following results:

Slot-filling:

Models ⧹ TasksMMNLUMultiATIS++CoNLL2003MultiCoNERSNIPSMEDIA
EnALBERTN/AN/A89.67 (0.34)42.36 (0.22)95.95 (0.13)N/A
FrALBERTN/AN/AN/AN/AN/A81.76 (0.59)
mALBERT-128k65.81 (0.11)89.14 (0.15)88.27 (0.24)46.01 (0.18)91.60 (0.31)83.15 (0.38)
mALBERT-64k65.29 (0.14)88.88 (0.14)86.44 (0.37)44.70 (0.27)90.84 (0.47)82.30 (0.19)
mALBERT-32k64.83 (0.22)88.60 (0.27)84.96 (0.41)44.13 (0.39)89.89 (0.68)82.04 (0.28)

Classification task:

Models ⧹ TasksMMNLUMultiATIS++SNIPSSST2
mALBERT-128k72.35 (0.09)90.58 (0.98)96.84 (0.49)34.66 (1.46)
mALBERT-64k71.26 (0.11)90.97 (0.70)96.53 (0.44)34.64 (1.02)
mALBERT-32k70.76 (0.11)90.55 (0.98)96.49 (0.45)34.18 (1.64)

BibTeX entry and citation info

@inproceedings{servan2024mALBERT,
  author    = {Christophe Servan and
               Sahar Ghannay and
               Sophie Rosset},
  booktitle = {the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)},
  title     = {{mALBERT: Is a Compact Multilingual BERT Model Still Worth It?}},
  year      = {2024},
  address   = {Torino, Italy},
  month     = may,
}

Link to the paper: PDF

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей