Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,82 @@
|
|
1 |
---
|
2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
+
language:
|
4 |
+
- it
|
5 |
+
widget:
|
6 |
+
- text: "Milano è una <mask> italiana"
|
7 |
+
example_title: "Example 1"
|
8 |
+
- text: "Leopardi è stato uno dei più grandi <mask> del classicismo italiano"
|
9 |
+
example_title: "Example 2"
|
10 |
+
- text: "L'Italia è uno <mask> dell'Unione Europea"
|
11 |
+
example_title: "Example 3"
|
12 |
---
|
13 |
+
--------------------------------------------------------------------------------------------------
|
14 |
+
|
15 |
+
<body>
|
16 |
+
<span class="vertical-text" style="background-color:lightgreen;border-radius: 3px;padding: 3px;"> </span>
|
17 |
+
<br>
|
18 |
+
<span class="vertical-text" style="background-color:orange;border-radius: 3px;padding: 3px;"> </span>
|
19 |
+
<br>
|
20 |
+
<span class="vertical-text" style="background-color:lightblue;border-radius: 3px;padding: 3px;"> Model: RoBERTa Large</span>
|
21 |
+
<br>
|
22 |
+
<span class="vertical-text" style="background-color:tomato;border-radius: 3px;padding: 3px;"> Lang: IT</span>
|
23 |
+
<br>
|
24 |
+
<span class="vertical-text" style="background-color:lightgrey;border-radius: 3px;padding: 3px;"> </span>
|
25 |
+
<br>
|
26 |
+
<span class="vertical-text" style="background-color:#CF9FFF;border-radius: 3px;padding: 3px;"> </span>
|
27 |
+
</body>
|
28 |
+
|
29 |
+
--------------------------------------------------------------------------------------------------
|
30 |
+
|
31 |
+
<h3>Model description</h3>
|
32 |
+
|
33 |
+
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
|
34 |
+
(as in <b>[3]</b>, computing document-level frequencies over the <b>Wikipedia</b> dataset)
|
35 |
+
|
36 |
+
The resulting model has 356M parameters, a vocabulary of 50.670 tokens, and a size of ~1.42 GB.
|
37 |
+
|
38 |
+
<h3>Quick usage</h3>
|
39 |
+
|
40 |
+
```python
|
41 |
+
from transformers import RobertaTokenizerFast, RobertaForMaskedLM
|
42 |
+
|
43 |
+
tokenizer = RobertaTokenizerFast.from_pretrained("osiria/roberta-large-italian")
|
44 |
+
model = RobertaForMaskedLM.from_pretrained("osiria/roberta-large-italian")
|
45 |
+
|
46 |
+
pipe = pipeline("fill-mask", model=model, tokenizer=tokenizer)
|
47 |
+
|
48 |
+
pipe("Milano è una <mask> italiana")
|
49 |
+
|
50 |
+
[{'score': 0.9284337759017944,
|
51 |
+
'token': 7786,
|
52 |
+
'token_str': 'città',
|
53 |
+
'sequence': 'Milano è una città italiana'},
|
54 |
+
{'score': 0.03296631574630737,
|
55 |
+
'token': 26960,
|
56 |
+
'token_str': 'capitale',
|
57 |
+
'sequence': 'Milano è una capitale italiana'},
|
58 |
+
{'score': 0.015821034088730812,
|
59 |
+
'token': 8043,
|
60 |
+
'token_str': 'provincia',
|
61 |
+
'sequence': 'Milano è una provincia italiana'},
|
62 |
+
{'score': 0.007335659582167864,
|
63 |
+
'token': 18841,
|
64 |
+
'token_str': 'regione',
|
65 |
+
'sequence': 'Milano è una regione italiana'},
|
66 |
+
{'score': 0.006183209829032421,
|
67 |
+
'token': 50152,
|
68 |
+
'token_str': 'cittadina',
|
69 |
+
'sequence': 'Milano è una cittadina italiana'}]
|
70 |
+
```
|
71 |
+
|
72 |
+
<h3>References</h3>
|
73 |
+
|
74 |
+
[1] https://arxiv.org/abs/1907.11692
|
75 |
+
|
76 |
+
[2] https://arxiv.org/abs/1911.02116
|
77 |
+
|
78 |
+
[3] https://arxiv.org/abs/2010.05609
|
79 |
+
|
80 |
+
<h3>License</h3>
|
81 |
+
|
82 |
+
The model is released under <b>MIT</b> license
|