|
--- |
|
license: mit |
|
language: |
|
- it |
|
widget: |
|
- text: "Milano è una <mask> italiana" |
|
example_title: "Example 1" |
|
- text: "Leopardi è stato uno dei più grandi <mask> del classicismo italiano" |
|
example_title: "Example 2" |
|
- text: "L'Italia è uno <mask> dell'Unione Europea" |
|
example_title: "Example 3" |
|
--- |
|
-------------------------------------------------------------------------------------------------- |
|
|
|
<body> |
|
<span class="vertical-text" style="background-color:lightgreen;border-radius: 3px;padding: 3px;"> </span> |
|
<br> |
|
<span class="vertical-text" style="background-color:orange;border-radius: 3px;padding: 3px;"> </span> |
|
<br> |
|
<span class="vertical-text" style="background-color:lightblue;border-radius: 3px;padding: 3px;"> Model: RoBERTa Large</span> |
|
<br> |
|
<span class="vertical-text" style="background-color:tomato;border-radius: 3px;padding: 3px;"> Lang: IT</span> |
|
<br> |
|
<span class="vertical-text" style="background-color:lightgrey;border-radius: 3px;padding: 3px;"> </span> |
|
<br> |
|
<span class="vertical-text" style="background-color:#CF9FFF;border-radius: 3px;padding: 3px;"> </span> |
|
</body> |
|
|
|
-------------------------------------------------------------------------------------------------- |
|
|
|
<h3>Model description</h3> |
|
|
|
This is a <b>RoBERTa Large</b> <b>[1]</b> model for the <b>Italian</b> language, obtained using <b>XLM-RoBERTa-Large</b> <b>[2]</b> ([xlm-roberta-large](https://huggingface.co/xlm-roberta-large)) as a starting point and focusing it on the italian language by modifying the embedding layer |
|
(as in <b>[3]</b>, computing document-level frequencies over the <b>Wikipedia</b> dataset) |
|
|
|
The resulting model has 356M parameters, a vocabulary of 50.670 tokens, and a size of ~1.42 GB. |
|
|
|
<h3>Quick usage</h3> |
|
|
|
```python |
|
from transformers import RobertaTokenizerFast, RobertaForMaskedLM |
|
|
|
tokenizer = RobertaTokenizerFast.from_pretrained("osiria/roberta-large-italian") |
|
model = RobertaForMaskedLM.from_pretrained("osiria/roberta-large-italian") |
|
|
|
pipe = pipeline("fill-mask", model=model, tokenizer=tokenizer) |
|
|
|
pipe("Milano è una <mask> italiana") |
|
|
|
[{'score': 0.9284337759017944, |
|
'token': 7786, |
|
'token_str': 'città', |
|
'sequence': 'Milano è una città italiana'}, |
|
{'score': 0.03296631574630737, |
|
'token': 26960, |
|
'token_str': 'capitale', |
|
'sequence': 'Milano è una capitale italiana'}, |
|
{'score': 0.015821034088730812, |
|
'token': 8043, |
|
'token_str': 'provincia', |
|
'sequence': 'Milano è una provincia italiana'}, |
|
{'score': 0.007335659582167864, |
|
'token': 18841, |
|
'token_str': 'regione', |
|
'sequence': 'Milano è una regione italiana'}, |
|
{'score': 0.006183209829032421, |
|
'token': 50152, |
|
'token_str': 'cittadina', |
|
'sequence': 'Milano è una cittadina italiana'}] |
|
``` |
|
|
|
<h3>References</h3> |
|
|
|
[1] https://arxiv.org/abs/1907.11692 |
|
|
|
[2] https://arxiv.org/abs/1911.02116 |
|
|
|
[3] https://arxiv.org/abs/2010.05609 |
|
|
|
<h3>License</h3> |
|
|
|
The model is released under <b>MIT</b> license |
|
|