Downloads · 30 days
42
2% of all-time downloads
racai/distilbert-multi-base-romanian-cased
distilbert-multi-base-romanian-cased is a machine learning model from racai. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
This repository contains the a Romanian cased version of DistilBERT (named DistilMulti-BERT-base-ro in the paper) that was obtained by distilling an ensemble of two teacher models: dumitrescustefan/bert-base-romanian-…
Downloads · 30 days
42
2% of all-time downloads
All-time downloads
2.3K
Public
Repo size
1.3 GB
Likes
0
Public
Click a slice to open those files.
.bin328 MB · 34%
From the Hugging Face model README
This repository contains the a Romanian cased version of DistilBERT (named DistilMulti-BERT-base-ro in the paper) that was obtained by distilling an ensemble of two teacher models: dumitrescustefan/bert-base-romanian-cased-v1 and readerbench/RoBERT-base.
The model was introduced in this paper. The adjacent code can be found here.
from transformers import AutoTokenizer, AutoModel
# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained("racai/distilbert-multi-base-romanian-cased")
model = AutoModel.from_pretrained("racai/distilbert-multi-base-romanian-cased")
# tokenize a test sentence
input_ids = tokenizer.encode("Aceasta este o propoziție de test.", add_special_tokens=True, return_tensors="pt")
# run the tokens trough the model
outputs = model(input_ids)
print(outputs)
The model is 35% smaller than bert-base-romanian-cased-v1 and 30% smaller than RoBERT-base.
| Model | Size (MB) | Params (Millions) |
|---|---|---|
| RoBERT-base | 441 | 114 |
| bert-base-romanian-cased-v1 | 477 | 124 |
| distilbert-multi-base-romanian-cased | 312 | 81 |
We evaluated the model in comparison with its two teachers on 5 Romanian tasks:
| Model | UPOS | XPOS | NER | SAPN | SAR | DI | STS |
|---|---|---|---|---|---|---|---|
| RoBERT-base | 98.02 | 97.15 | 85.14 | 98.30 | 79.40 | 96.07 | 81.18 |
| bert-base-romanian-cased-v1 | 98.00 | 96.46 | 85.88 | 98.07 | 79.61 | 95.58 | 80.30 |
| distilbert-multi-base-romanian-cased | 98.07 | 96.83 | 83.22 | 98.11 | 79.77 | 96.18 | 80.66 |
@article{avram2021distilling,
title={Distilling the Knowledge of Romanian BERTs Using Multiple Teachers},
author={Andrei-Marius Avram and Darius Catrina and Dumitru-Clementin Cercel and Mihai Dascălu and Traian Rebedea and Vasile Păiş and Dan Tufiş},
journal={ArXiv},
year={2021},
volume={abs/2112.12650}
}