model documentation (#2)
Browse files- model documentation (923864124976874b83d79503644d11e863b2f2c5)
Co-authored-by: Nazneen Rajani <nazneen@users.noreply.huggingface.co>
README.md
CHANGED
@@ -1,19 +1,185 @@
|
|
|
|
1 |
---
|
2 |
-
language:
|
|
|
3 |
tags:
|
4 |
- Czech
|
5 |
- RoBERTa
|
6 |
- ÚFAL
|
7 |
-
license: "cc-by-nc-sa-4.0"
|
8 |
---
|
9 |
|
10 |
-
# RobeCzech
|
11 |
-
|
|
|
|
|
|
|
12 |
RobeCzech is a monolingual RoBERTa language representation model trained on Czech data.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
Preprint of the paper is available at https://arxiv.org/abs/2105.11314.
|
|
|
1 |
+
|
2 |
---
|
3 |
+
language: cs
|
4 |
+
license: cc-by-nc-sa-4.0
|
5 |
tags:
|
6 |
- Czech
|
7 |
- RoBERTa
|
8 |
- ÚFAL
|
|
|
9 |
---
|
10 |
|
11 |
+
# Model Card for RobeCzech
|
12 |
+
# Model Details
|
13 |
+
|
14 |
+
## Model Description
|
15 |
+
|
16 |
RobeCzech is a monolingual RoBERTa language representation model trained on Czech data.
|
17 |
+
|
18 |
+
- **Developed by:** Institute of Formal and Applied Linguistics, Charles University, Prague (UFAL)
|
19 |
+
- **Shared by [Optional]:** Hugging Face and [LINDAT](https://hdl.handle.net/11234/1-3691)
|
20 |
+
- **Model type:** Fill-Mask
|
21 |
+
- **Language(s) (NLP):** cs
|
22 |
+
- **License:** cc-by-nc-sa-4.0
|
23 |
+
- **Related Models:** More information needed
|
24 |
+
- **Parent Model:** RoBERTa
|
25 |
+
- **Resources for more information:**
|
26 |
+
- [Associated Paper](https://arxiv.org/abs/2105.11314)
|
27 |
+
|
28 |
+
# Uses
|
29 |
+
|
30 |
+
## Direct Use
|
31 |
+
|
32 |
+
Fill-Mask tasks.
|
33 |
+
|
34 |
+
## Downstream Use [Optional]
|
35 |
+
|
36 |
+
Morphological tagging and lemmatization, dependency parsing, named entity recognition and semantic parsing.
|
37 |
+
|
38 |
+
|
39 |
+
## Out-of-Scope Use
|
40 |
+
|
41 |
+
|
42 |
+
More information needed
|
43 |
+
|
44 |
+
|
45 |
+
# Bias, Risks, and Limitations
|
46 |
+
|
47 |
+
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups.
|
48 |
+
|
49 |
+
|
50 |
+
## Recommendations
|
51 |
+
|
52 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
53 |
+
|
54 |
+
|
55 |
+
# Training Details
|
56 |
+
|
57 |
+
## Training Data
|
58 |
+
|
59 |
+
The model creators note in the [associated paper](https://arxiv.org/pdf/2105.11314.pdf):
|
60 |
+
> We trained RobeCzech on a collection of the following publicly available texts:
|
61 |
+
- SYN v4, a large corpus of contemporary written Czech, 4,188M tokens;
|
62 |
+
- Czes, a collection of Czech newspaper and magazine articles, 432M tokens;
|
63 |
+
- documents with at least 400 tokens from the Czech part of the web corpus.W2C , tokenized with MorphoDiTa, 16M tokens;
|
64 |
+
- plain texts extracted from Czech Wikipedia dump 20201020 using WikiEx-tractor, tokenized with MorphoDiTa, 123M tokens
|
65 |
|
66 |
+
> All these corpora contain whole documents, even if the SYN v4 is block-shuffled (blocks with at most 100 words respecting sentence boundaries are permuted in a document) and in total contain 4,917M tokens.
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
## Training Procedure
|
71 |
+
|
72 |
+
### Preprocessing
|
73 |
+
|
74 |
+
The texts are tokenized into subwords with a byte-level BPE (BBPE) to- kenizer [33]. The tokenizer is trained on the entire corpus and we limit its vocabulary size to 52,000 items.
|
75 |
+
|
76 |
+
### Speeds, Sizes, Times
|
77 |
+
The model creators note in the [associated paper](https://arxiv.org/pdf/2105.11314.pdf):
|
78 |
+
> The training batch size is 8,192 and each training batch consists of sentences sampled contiguously, even across document boundaries, such that the total length of each sample is at most 512 tokens (FULL-SENTENCES setting). We use Adam optimizer with β1 = 0.9 and β2 = 0.98 to minimize the masked language-modeling objective.
|
79 |
+
|
80 |
+
|
81 |
+
|
82 |
+
# Evaluation
|
83 |
+
|
84 |
+
## Testing Data, Factors & Metrics
|
85 |
+
|
86 |
+
### Testing Data
|
87 |
+
The model creators note in the [associated paper](https://arxiv.org/pdf/2105.11314.pdf):
|
88 |
+
> We evaluate RobeCzech in five NLP tasks, three of them leveraging frozen contextualized word embeddings, two approached with fine-tuning:
|
89 |
+
morphological analysis and lemmatization: frozen contextualized word embeddings,
|
90 |
+
dependency parsing: frozen contextualized word embeddings,
|
91 |
+
named entity recognition: frozen contextualized word embeddings,
|
92 |
+
semantic parsing: fine-tuned,
|
93 |
+
sentiment analysis: fine-tuned.
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
### Factors
|
98 |
+
|
99 |
+
More information needed
|
100 |
+
|
101 |
+
### Metrics
|
102 |
+
|
103 |
+
Morphosynt PDT3.5 (POS) | Morphosynt PDT3. (LAS) | Morphosynt UD2.3 (XPOS) | Morphosynt UD2.3 ( LAS) |
|
104 |
+
NER CNEC1.1 (nested) | NER CNEC1.1 (flat) | Semant. PTG (Avg) | Sentim. CDF (F1) |
|
105 |
+
|
106 |
+
|
107 |
+
## Results
|
108 |
+
|
109 |
+
| Model | Morphosynt PDT3.5 (POS) (LAS) | Morphosynt UD2.3 (XPOS) (LAS) | NER CNEC1.1 (nested) (flat) | Semant. PTG (Avg) (F1) |
|
110 |
+
|-----------|---------------------------------|--------------------------------|------------------------------|-------------------------|
|
111 |
+
| RobeCzech | 98.50 91.42 | 98.31 93.77 | 87.82 87.47 | 92.36 80.13 |
|
112 |
+
|
113 |
+
|
114 |
+
# Model Examination
|
115 |
+
|
116 |
+
More information needed
|
117 |
+
|
118 |
+
# Environmental Impact
|
119 |
+
|
120 |
+
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
121 |
+
|
122 |
+
- **Hardware Type:** 8 QUADRO P5000 GPU
|
123 |
+
- **Hours used:** 2190 (~3 months)
|
124 |
+
- **Cloud Provider:** More information needed
|
125 |
+
- **Compute Region:** More information needed
|
126 |
+
- **Carbon Emitted:** More information needed
|
127 |
+
|
128 |
+
# Technical Specifications [optional]
|
129 |
+
|
130 |
+
## Model Architecture and Objective
|
131 |
+
The model creators note in the [associated paper](https://arxiv.org/pdf/2105.11314.pdf):
|
132 |
+
We employ the standard text classification architecture consisting of a BERT encoder, followed by a softmax-activated classification layer processing the computed embedding of the given document text obtained from the CLS token embedding from the last layer
|
133 |
+
|
134 |
+
|
135 |
+
## Compute Infrastructure
|
136 |
+
|
137 |
+
### Hardware
|
138 |
+
|
139 |
+
8 QUADRO P5000 GPU
|
140 |
+
|
141 |
+
### Software
|
142 |
+
|
143 |
+
More information needed
|
144 |
+
|
145 |
+
# Citation
|
146 |
+
|
147 |
+
**APA:**
|
148 |
+
|
149 |
+
```
|
150 |
+
Straka, M., Náplava, J., Straková, J., & Samuel, D. (2021). RobeCzech: Czech RoBERTa, a monolingual contextualized language representation model. arXiv. https://doi.org/10.1007/978-3-030-83527-9_17
|
151 |
+
```
|
152 |
+
|
153 |
+
|
154 |
+
# Glossary [optional]
|
155 |
+
|
156 |
+
More information needed
|
157 |
+
|
158 |
+
# More Information [optional]
|
159 |
+
|
160 |
+
More information needed
|
161 |
+
|
162 |
+
# Model Card Authors [optional]
|
163 |
+
|
164 |
+
Institute of Formal and Applied Linguistics, Charles University, Prague (UFAL), in collaboration with Ezi Ozoani and the Hugging Face Team.
|
165 |
+
|
166 |
+
# Model Card Contact
|
167 |
+
|
168 |
+
More information needed
|
169 |
+
|
170 |
+
# How to Get Started with the Model
|
171 |
+
|
172 |
+
Use the code below to get started with the model.
|
173 |
+
|
174 |
+
<details>
|
175 |
+
<summary> Click to expand </summary>
|
176 |
|
177 |
+
```python
|
178 |
+
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
179 |
+
|
180 |
+
tokenizer = AutoTokenizer.from_pretrained("ufal/robeczech-base")
|
181 |
+
|
182 |
+
model = AutoModelForMaskedLM.from_pretrained("ufal/robeczech-base")
|
183 |
+
```
|
184 |
+
</details>
|
185 |
|
|