Migrate model card from transformers-repo
Browse filesRead announcement at https://discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755
Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/Musixmatch/umberto-commoncrawl-cased-v1/README.md
README.md
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: it
|
3 |
+
---
|
4 |
+
|
5 |
+
# UmBERTo Commoncrawl Cased
|
6 |
+
|
7 |
+
[UmBERTo](https://github.com/musixmatchresearch/umberto) is a Roberta-based Language Model trained on large Italian Corpora and uses two innovative approaches: SentencePiece and Whole Word Masking. Now available at [github.com/huggingface/transformers](https://huggingface.co/Musixmatch/umberto-commoncrawl-cased-v1)
|
8 |
+
|
9 |
+
<p align="center">
|
10 |
+
<img src="https://user-images.githubusercontent.com/7140210/72913702-d55a8480-3d3d-11ea-99fc-f2ef29af4e72.jpg" width="700"> </br>
|
11 |
+
Marco Lodola, Monument to Umberto Eco, Alessandria 2019
|
12 |
+
</p>
|
13 |
+
|
14 |
+
## Dataset
|
15 |
+
UmBERTo-Commoncrawl-Cased utilizes the Italian subcorpus of [OSCAR](https://traces1.inria.fr/oscar/) as training set of the language model. We used deduplicated version of the Italian corpus that consists in 70 GB of plain text data, 210M sentences with 11B words where the sentences have been filtered and shuffled at line level in order to be used for NLP research.
|
16 |
+
|
17 |
+
## Pre-trained model
|
18 |
+
|
19 |
+
| Model | WWM | Cased | Tokenizer | Vocab Size | Train Steps | Download |
|
20 |
+
| ------ | ------ | ------ | ------ | ------ |------ | ------ |
|
21 |
+
| `umberto-commoncrawl-cased-v1` | YES | YES | SPM | 32K | 125k | [Link](http://bit.ly/35zO7GH) |
|
22 |
+
|
23 |
+
This model was trained with [SentencePiece](https://github.com/google/sentencepiece) and Whole Word Masking.
|
24 |
+
|
25 |
+
## Downstream Tasks
|
26 |
+
These results refers to umberto-commoncrawl-cased model. All details are at [Umberto](https://github.com/musixmatchresearch/umberto) Official Page.
|
27 |
+
|
28 |
+
#### Named Entity Recognition (NER)
|
29 |
+
|
30 |
+
| Dataset | F1 | Precision | Recall | Accuracy |
|
31 |
+
| ------ | ------ | ------ | ------ | ------ |
|
32 |
+
| **ICAB-EvalITA07** | **87.565** | 86.596 | 88.556 | 98.690 |
|
33 |
+
| **WikiNER-ITA** | **92.531** | 92.509 | 92.553 | 99.136 |
|
34 |
+
|
35 |
+
#### Part of Speech (POS)
|
36 |
+
|
37 |
+
| Dataset | F1 | Precision | Recall | Accuracy |
|
38 |
+
| ------ | ------ | ------ | ------ | ------ |
|
39 |
+
| **UD_Italian-ISDT** | 98.870 | 98.861 | 98.879 | **98.977** |
|
40 |
+
| **UD_Italian-ParTUT** | 98.786 | 98.812 | 98.760 | **98.903** |
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
## Usage
|
45 |
+
|
46 |
+
##### Load UmBERTo with AutoModel, Autotokenizer:
|
47 |
+
|
48 |
+
```python
|
49 |
+
|
50 |
+
import torch
|
51 |
+
from transformers import AutoTokenizer, AutoModel
|
52 |
+
|
53 |
+
tokenizer = AutoTokenizer.from_pretrained("Musixmatch/umberto-commoncrawl-cased-v1")
|
54 |
+
umberto = AutoModel.from_pretrained("Musixmatch/umberto-commoncrawl-cased-v1")
|
55 |
+
|
56 |
+
encoded_input = tokenizer.encode("Umberto Eco è stato un grande scrittore")
|
57 |
+
input_ids = torch.tensor(encoded_input).unsqueeze(0) # Batch size 1
|
58 |
+
outputs = umberto(input_ids)
|
59 |
+
last_hidden_states = outputs[0] # The last hidden-state is the first element of the output
|
60 |
+
```
|
61 |
+
|
62 |
+
##### Predict masked token:
|
63 |
+
|
64 |
+
```python
|
65 |
+
from transformers import pipeline
|
66 |
+
|
67 |
+
fill_mask = pipeline(
|
68 |
+
"fill-mask",
|
69 |
+
model="Musixmatch/umberto-commoncrawl-cased-v1",
|
70 |
+
tokenizer="Musixmatch/umberto-commoncrawl-cased-v1"
|
71 |
+
)
|
72 |
+
|
73 |
+
result = fill_mask("Umberto Eco è <mask> un grande scrittore")
|
74 |
+
# {'sequence': '<s> Umberto Eco è considerato un grande scrittore</s>', 'score': 0.18599839508533478, 'token': 5032}
|
75 |
+
# {'sequence': '<s> Umberto Eco è stato un grande scrittore</s>', 'score': 0.17816807329654694, 'token': 471}
|
76 |
+
# {'sequence': '<s> Umberto Eco è sicuramente un grande scrittore</s>', 'score': 0.16565583646297455, 'token': 2654}
|
77 |
+
# {'sequence': '<s> Umberto Eco è indubbiamente un grande scrittore</s>', 'score': 0.0932890921831131, 'token': 17908}
|
78 |
+
# {'sequence': '<s> Umberto Eco è certamente un grande scrittore</s>', 'score': 0.054701317101716995, 'token': 5269}
|
79 |
+
```
|
80 |
+
|
81 |
+
|
82 |
+
## Citation
|
83 |
+
All of the original datasets are publicly available or were released with the owners' grant. The datasets are all released under a CC0 or CCBY license.
|
84 |
+
|
85 |
+
* UD Italian-ISDT Dataset [Github](https://github.com/UniversalDependencies/UD_Italian-ISDT)
|
86 |
+
* UD Italian-ParTUT Dataset [Github](https://github.com/UniversalDependencies/UD_Italian-ParTUT)
|
87 |
+
* I-CAB (Italian Content Annotation Bank), EvalITA [Page](http://www.evalita.it/)
|
88 |
+
* WIKINER [Page](https://figshare.com/articles/Learning_multilingual_named_entity_recognition_from_Wikipedia/5462500) , [Paper](https://www.sciencedirect.com/science/article/pii/S0004370212000276?via%3Dihub)
|
89 |
+
|
90 |
+
```
|
91 |
+
@inproceedings {magnini2006annotazione,
|
92 |
+
title = {Annotazione di contenuti concettuali in un corpus italiano: I - CAB},
|
93 |
+
author = {Magnini,Bernardo and Cappelli,Amedeo and Pianta,Emanuele and Speranza,Manuela and Bartalesi Lenzi,V and Sprugnoli,Rachele and Romano,Lorenza and Girardi,Christian and Negri,Matteo},
|
94 |
+
booktitle = {Proc.of SILFI 2006},
|
95 |
+
year = {2006}
|
96 |
+
}
|
97 |
+
@inproceedings {magnini2006cab,
|
98 |
+
title = {I - CAB: the Italian Content Annotation Bank.},
|
99 |
+
author = {Magnini,Bernardo and Pianta,Emanuele and Girardi,Christian and Negri,Matteo and Romano,Lorenza and Speranza,Manuela and Lenzi,Valentina Bartalesi and Sprugnoli,Rachele},
|
100 |
+
booktitle = {LREC},
|
101 |
+
pages = {963--968},
|
102 |
+
year = {2006},
|
103 |
+
organization = {Citeseer}
|
104 |
+
}
|
105 |
+
```
|
106 |
+
|
107 |
+
## Authors
|
108 |
+
|
109 |
+
**Loreto Parisi**: `loreto at musixmatch dot com`, [loretoparisi](https://github.com/loretoparisi)
|
110 |
+
**Simone Francia**: `simone.francia at musixmatch dot com`, [simonefrancia](https://github.com/simonefrancia)
|
111 |
+
**Paolo Magnani**: `paul.magnani95 at gmail dot com`, [paulthemagno](https://github.com/paulthemagno)
|
112 |
+
|
113 |
+
## About Musixmatch AI
|
114 |
+
![Musxmatch Ai mac app icon-128](https://user-images.githubusercontent.com/163333/72244273-396aa380-35ee-11ea-894b-4ea48230c02b.png)
|
115 |
+
We do Machine Learning and Artificial Intelligence @[musixmatch](https://twitter.com/Musixmatch)
|
116 |
+
Follow us on [Twitter](https://twitter.com/musixmatchai) [Github](https://github.com/musixmatchresearch)
|
117 |
+
|
118 |
+
|