Views
No views yet
1from transformers import AutoTokenizer, AutoModel
2
3# load the tokenizer and the model
4tokenizer = AutoTokenizer.from_pretrained("racai/distilbert-base-romanian-uncased")
5model = AutoModel.from_pretrained("racai/distilbert-base-romanian-uncased")
6
7# tokenize a test sentence
8input_ids = tokenizer.encode("aceasta este o propoziție de test.", add_special_tokens=True, return_tensors="pt")
9
10# run the tokens trough the model
11outputs = model(input_ids)
12
13print(outputs)RoBERT-base.| Model | Size (MB) | Params (Millions) |
|---|---|---|
| RoBERT-base | 441 | 114 |
| distilbert-base-romanian-cased | 282 | 72 |
| Model | UPOS | XPOS | NER | SAPN | SAR | DI | STS |
|---|---|---|---|---|---|---|---|
| RoBERT-base | 98.02 | 97.15 | 85.14 | 98.30 | 79.40 | 96.07 | 81.18 |
| distilbert-base-romanian-uncased | 97.12 | 95.79 | 83.11 | 98.01 | 79.58 | 96.11 | 79.80 |
1@article{avram2021distilling,
2 title={Distilling the Knowledge of Romanian BERTs Using Multiple Teachers},
3 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ş},
4 journal={ArXiv},
5 year={2021},
6 volume={abs/2112.12650}
7}