Downloads · 30 days
156
5% of all-time downloads
cservan/multilingual-albert-base-cased-32k
multilingual-albert-base-cased-32k is a fill-mask model from cservan. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as apache-2.0.
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 Fre…
Downloads · 30 days
156
5% of all-time downloads
All-time downloads
3.5K
Public
Parameters
16.2M
97.7 MB on disk
Likes
2
Public
Click a slice to open those files.
.bin64.7 MB · 66%
From the Hugging Face model README
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.
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:
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:
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.
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)
The mALBERT model was pretrained on 13go of Multiligual Wikipedia (excluding lists, tables and headers).
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]
The mALBERT procedure follows the BERT setup.
The details of the masking procedure for each sentence are the following:
[MASK].The tools used to pre-train the model are available here
When fine-tuned on downstream tasks, the ALBERT models achieve the following results:
Slot-filling:
| Models ⧹ Tasks | MMNLU | MultiATIS++ | CoNLL2003 | MultiCoNER | SNIPS | MEDIA |
|---|---|---|---|---|---|---|
| EnALBERT | N/A | N/A | 89.67 (0.34) | 42.36 (0.22) | 95.95 (0.13) | N/A |
| FrALBERT | N/A | N/A | N/A | N/A | N/A | 81.76 (0.59) |
| mALBERT-128k | 65.81 (0.11) | 89.14 (0.15) | 88.27 (0.24) | 46.01 (0.18) | 91.60 (0.31) | 83.15 (0.38) |
| mALBERT-64k | 65.29 (0.14) | 88.88 (0.14) | 86.44 (0.37) | 44.70 (0.27) | 90.84 (0.47) | 82.30 (0.19) |
| mALBERT-32k | 64.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 ⧹ Tasks | MMNLU | MultiATIS++ | SNIPS | SST2 |
|---|---|---|---|---|
| mALBERT-128k | 72.35 (0.09) | 90.58 (0.98) | 96.84 (0.49) | 34.66 (1.46) |
| mALBERT-64k | 71.26 (0.11) | 90.97 (0.70) | 96.53 (0.44) | 34.64 (1.02) |
| mALBERT-32k | 70.76 (0.11) | 90.55 (0.98) | 96.49 (0.45) | 34.18 (1.64) |
@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