Instructions to use ufal/robeczech-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ufal/robeczech-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="ufal/robeczech-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("ufal/robeczech-base") model = AutoModelForMaskedLM.from_pretrained("ufal/robeczech-base", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Milan Straka commited on
Commit ·
935d8d1
1
Parent(s): e1eaff9
Update the model card.
Browse files
README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
| 3 |
language: cs
|
| 4 |
license: cc-by-nc-sa-4.0
|
| 5 |
tags:
|
|
|
|
| 6 |
- Czech
|
| 7 |
- RoBERTa
|
| 8 |
- ÚFAL
|
|
@@ -10,176 +11,141 @@ tags:
|
|
| 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
|
| 20 |
- **Model type:** Fill-Mask
|
| 21 |
- **Language(s) (NLP):** cs
|
| 22 |
- **License:** cc-by-nc-sa-4.0
|
| 23 |
-
- **
|
| 24 |
-
|
| 25 |
-
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
# Uses
|
| 29 |
-
|
| 30 |
## Direct Use
|
| 31 |
-
|
| 32 |
Fill-Mask tasks.
|
| 33 |
-
|
| 34 |
-
## Downstream Use
|
| 35 |
-
|
| 36 |
-
Morphological tagging and lemmatization, dependency parsing, named entity
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 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
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
## Recommendations
|
| 51 |
-
|
| 52 |
-
Users (both direct and downstream) should be made aware of the risks, biases and
|
| 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 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
> All these corpora contain whole documents, even if the SYN v4 is
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
## Training Procedure
|
| 71 |
-
|
| 72 |
### Preprocessing
|
| 73 |
-
|
| 74 |
-
The texts are tokenized into subwords with a byte-level BPE (BBPE)
|
| 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
|
| 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
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 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 |
-
|
| 121 |
-
|
| 122 |
-
- **Hardware Type:** 8 QUADRO P5000 GPU
|
| 123 |
- **Hours used:** 2190 (~3 months)
|
| 124 |
-
|
| 125 |
-
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
|
|
|
|
| 3 |
language: cs
|
| 4 |
license: cc-by-nc-sa-4.0
|
| 5 |
tags:
|
| 6 |
+
- RobeCzech
|
| 7 |
- Czech
|
| 8 |
- RoBERTa
|
| 9 |
- ÚFAL
|
|
|
|
| 11 |
|
| 12 |
# Model Card for RobeCzech
|
| 13 |
# Model Details
|
| 14 |
+
|
| 15 |
## Model Description
|
| 16 |
+
|
| 17 |
RobeCzech is a monolingual RoBERTa language representation model trained on Czech data.
|
| 18 |
+
|
| 19 |
- **Developed by:** Institute of Formal and Applied Linguistics, Charles University, Prague (UFAL)
|
| 20 |
+
- **Shared by:** Hugging Face and [LINDAT/CLARIAH-CZ](https://hdl.handle.net/11234/1-3691)
|
| 21 |
- **Model type:** Fill-Mask
|
| 22 |
- **Language(s) (NLP):** cs
|
| 23 |
- **License:** cc-by-nc-sa-4.0
|
| 24 |
+
- **Model Architecture:** RoBERTa
|
| 25 |
+
- **Resources for more information:**
|
| 26 |
+
- [RobeCzech: Czech RoBERTa, a Monolingual Contextualized Language Representation Model](https://doi.org/10.1007/978-3-030-83527-9_17)
|
| 27 |
+
- [arXiv preprint is also available](https://arxiv.org/abs/2105.11314)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
# Uses
|
| 31 |
+
|
| 32 |
## Direct Use
|
| 33 |
+
|
| 34 |
Fill-Mask tasks.
|
| 35 |
+
|
| 36 |
+
## Downstream Use
|
| 37 |
+
|
| 38 |
+
Morphological tagging and lemmatization, dependency parsing, named entity
|
| 39 |
+
recognition, and semantic parsing.
|
| 40 |
+
|
| 41 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
# Bias, Risks, and Limitations
|
| 43 |
+
|
| 44 |
+
Significant research has explored bias and fairness issues with language models
|
| 45 |
+
(see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf)
|
| 46 |
+
and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)).
|
| 47 |
+
Predictions generated by the model may include disturbing and harmful
|
| 48 |
+
stereotypes across protected classes; identity characteristics; and sensitive,
|
| 49 |
+
social, and occupational groups.
|
| 50 |
+
|
| 51 |
## Recommendations
|
| 52 |
+
|
| 53 |
+
Users (both direct and downstream) should be made aware of the risks, biases and
|
| 54 |
+
limitations of the model. More information needed for further recommendations.
|
| 55 |
+
|
| 56 |
+
|
| 57 |
# Training Details
|
| 58 |
+
|
| 59 |
## Training Data
|
| 60 |
+
|
| 61 |
The model creators note in the [associated paper](https://arxiv.org/pdf/2105.11314.pdf):
|
| 62 |
> We trained RobeCzech on a collection of the following publicly available texts:
|
| 63 |
+
> - SYN v4, a large corpus of contemporary written Czech, 4,188M tokens;
|
| 64 |
+
> - Czes, a collection of Czech newspaper and magazine articles, 432M tokens;
|
| 65 |
+
> - documents with at least 400 tokens from the Czech part of the web corpus.W2C , tokenized with MorphoDiTa, 16M tokens;
|
| 66 |
+
> - plain texts extracted from Czech Wikipedia dump 20201020 using WikiEx-tractor, tokenized with MorphoDiTa, 123M tokens
|
| 67 |
+
|
| 68 |
+
> All these corpora contain whole documents, even if the SYN v4 is
|
| 69 |
+
> block-shuffled (blocks with at most 100 words respecting sentence boundaries
|
| 70 |
+
> are permuted in a document) and in total contain 4,917M tokens.
|
| 71 |
+
|
| 72 |
## Training Procedure
|
| 73 |
+
|
| 74 |
### Preprocessing
|
| 75 |
+
|
| 76 |
+
The texts are tokenized into subwords with a byte-level BPE (BBPE) tokenizer,
|
| 77 |
+
which was trained on the entire corpus and we limit its vocabulary size to
|
| 78 |
+
52,000 items.
|
| 79 |
+
|
| 80 |
### Speeds, Sizes, Times
|
| 81 |
The model creators note in the [associated paper](https://arxiv.org/pdf/2105.11314.pdf):
|
| 82 |
+
> The training batch size is 8,192 and each training batch consists of sentences
|
| 83 |
+
> sampled contiguously, even across document boundaries, such that the total
|
| 84 |
+
> length of each sample is at most 512 tokens (FULL-SENTENCES setting). We use
|
| 85 |
+
> Adam optimizer with β1 = 0.9 and β2 = 0.98 to minimize the masked
|
| 86 |
+
> language-modeling objective.
|
| 87 |
+
|
| 88 |
+
### Software Used
|
| 89 |
+
The [Fairseq](https://github.com/facebookresearch/fairseq/tree/main/examples/roberta)
|
| 90 |
+
implementation was used for training.
|
| 91 |
+
|
| 92 |
+
|
| 93 |
# Evaluation
|
| 94 |
+
|
| 95 |
## Testing Data, Factors & Metrics
|
| 96 |
+
|
| 97 |
### Testing Data
|
| 98 |
The model creators note in the [associated paper](https://arxiv.org/pdf/2105.11314.pdf):
|
| 99 |
+
> We evaluate RobeCzech in five NLP tasks, three of them leveraging frozen
|
| 100 |
+
> contextualized word embeddings, two approached with fine-tuning:
|
| 101 |
+
> - morphological analysis and lemmatization: frozen contextualized word embeddings,
|
| 102 |
+
> - dependency parsing: frozen contextualized word embeddings,
|
| 103 |
+
> - named entity recognition: frozen contextualized word embeddings,
|
| 104 |
+
> - semantic parsing: fine-tuned,
|
| 105 |
+
> - sentiment analysis: fine-tuned.
|
| 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 |
# Environmental Impact
|
| 115 |
+
|
| 116 |
+
- **Hardware Type:** 8 QUADRO P5000 GPU
|
|
|
|
|
|
|
| 117 |
- **Hours used:** 2190 (~3 months)
|
| 118 |
+
|
| 119 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
# Citation
|
| 121 |
+
|
|
|
|
|
|
|
| 122 |
```
|
| 123 |
+
@InProceedings{10.1007/978-3-030-83527-9_17,
|
| 124 |
+
author={Straka, Milan and N{\'a}plava, Jakub and Strakov{\'a}, Jana and Samuel, David},
|
| 125 |
+
editor={Ek{\v{s}}tein, Kamil and P{\'a}rtl, Franti{\v{s}}ek and Konop{\'i}k, Miloslav},
|
| 126 |
+
title={{RobeCzech: Czech RoBERTa, a Monolingual Contextualized Language Representation Model}},
|
| 127 |
+
booktitle="Text, Speech, and Dialogue",
|
| 128 |
+
year="2021",
|
| 129 |
+
publisher="Springer International Publishing",
|
| 130 |
+
address="Cham",
|
| 131 |
+
pages="197--209",
|
| 132 |
+
isbn="978-3-030-83527-9"
|
| 133 |
+
}
|
| 134 |
```
|
| 135 |
+
|
| 136 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
# How to Get Started with the Model
|
| 138 |
+
|
| 139 |
Use the code below to get started with the model.
|
| 140 |
+
|
| 141 |
<details>
|
| 142 |
<summary> Click to expand </summary>
|
| 143 |
|
| 144 |
```python
|
| 145 |
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
| 146 |
+
|
| 147 |
tokenizer = AutoTokenizer.from_pretrained("ufal/robeczech-base")
|
| 148 |
+
|
| 149 |
model = AutoModelForMaskedLM.from_pretrained("ufal/robeczech-base")
|
| 150 |
```
|
| 151 |
</details>
|
|
|