Update README.md
Browse files
README.md
CHANGED
@@ -1,201 +1,114 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
|
8 |
<!-- Provide a quick summary of what the model is/does. -->
|
|
|
9 |
|
10 |
|
11 |
-
|
12 |
-
## Model Details
|
13 |
-
|
14 |
-
### Model Description
|
15 |
-
|
16 |
-
<!-- Provide a longer summary of what this model is. -->
|
17 |
-
|
18 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
19 |
-
|
20 |
-
- **Developed by:** [More Information Needed]
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
-
|
28 |
-
### Model Sources [optional]
|
29 |
-
|
30 |
-
<!-- Provide the basic links for the model. -->
|
31 |
-
|
32 |
-
- **Repository:** [More Information Needed]
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
-
|
36 |
-
## Uses
|
37 |
-
|
38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
39 |
-
|
40 |
-
### Direct Use
|
41 |
-
|
42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
-
|
44 |
-
[More Information Needed]
|
45 |
-
|
46 |
-
### Downstream Use [optional]
|
47 |
-
|
48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
-
|
52 |
-
### Out-of-Scope Use
|
53 |
-
|
54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
-
|
56 |
-
[More Information Needed]
|
57 |
-
|
58 |
-
## Bias, Risks, and Limitations
|
59 |
-
|
60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
-
|
64 |
-
### Recommendations
|
65 |
-
|
66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
-
|
74 |
-
[More Information Needed]
|
75 |
-
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
## Evaluation
|
104 |
|
105 |
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
-
## Model Examination [optional]
|
136 |
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
|
139 |
-
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
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).
|
146 |
|
147 |
-
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
|
153 |
-
|
154 |
|
155 |
-
|
|
|
156 |
|
157 |
-
|
|
|
158 |
|
159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
|
161 |
-
|
162 |
|
163 |
-
|
|
|
164 |
|
165 |
-
|
|
|
166 |
|
167 |
-
|
168 |
|
169 |
-
|
|
|
170 |
|
171 |
-
## Citation
|
172 |
|
173 |
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
license: cc-by-4.0
|
4 |
+
datasets:
|
5 |
+
- uonlp/CulturaX
|
6 |
+
language:
|
7 |
+
- uk
|
8 |
+
pipeline_tag: fill-mask
|
9 |
---
|
10 |
|
11 |
+
# LiBERTa
|
12 |
|
13 |
<!-- Provide a quick summary of what the model is/does. -->
|
14 |
+
LiBERTa Large is a BERT-like model pre-trained from scratch exclusively for Ukrainian. It was presented during the [UNLP](https://unlp.org.ua/) @ [LREC-COLING 2024](https://lrec-coling-2024.org/). Further details are in the [LiBERTa: Advancing Ukrainian Language Modeling through Pre-training from Scratch](https://aclanthology.org/2024.unlp-1.14/) paper.
|
15 |
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
## Evaluation
|
18 |
|
19 |
<!-- This section describes the evaluation protocols and provides the results. -->
|
20 |
|
21 |
+
Read the [paper](https://aclanthology.org/2024.unlp-1.14/) for more detailed tasks descriptions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
+
| | NER-UK (Micro F1) | WikiANN (Micro F1) | UD POS (Accuracy) | News (Macro F1) |
|
24 |
+
|:------------------------------------------------------------------------------------------------------------------------|:------------------------:|:------------------:|:------------------------------:|:----------------------------------------:|
|
25 |
+
| <tr><td colspan="5" style="text-align: center;"><strong>Base Models</strong></td></tr>
|
26 |
+
| [xlm-roberta-base](https://huggingface.co/FacebookAI/xlm-roberta-base) | 90.86 (0.81) | 92.27 (0.09) | 98.45 (0.07) | - |
|
27 |
+
| [roberta-base-wechsel-ukrainian](https://huggingface.co/benjamin/roberta-base-wechsel-ukrainian) | 90.81 (1.51) | 92.98 (0.12) | 98.57 (0.03) | - |
|
28 |
+
| [electra-base-ukrainian-cased-discriminator](https://huggingface.co/lang-uk/electra-base-ukrainian-cased-discriminator) | 90.43 (1.29) | 92.99 (0.11) | 98.59 (0.06) | - |
|
29 |
+
| <tr><td colspan="5" style="text-align: center;"><strong>Large Models</strong></td></tr>
|
30 |
+
| [xlm-roberta-large](https://huggingface.co/FacebookAI/xlm-roberta-large) | 90.16 (2.98) | 92.92 (0.19) | 98.71 (0.04) | 95.13 (0.49) |
|
31 |
+
| [roberta-large-wechsel-ukrainian](https://huggingface.co/benjamin/roberta-large-wechsel-ukrainian) | 91.24 (1.16) | __93.22 (0.17)__ | 98.74 (0.06) | __96.48 (0.09)__ |
|
32 |
+
| [liberta-large](https://huggingface.co/Goader/liberta-large) | 91.27 (1.22) | 92.50 (0.07) | 98.62 (0.08) | 95.44 (0.04) |
|
33 |
+
| [liberta-large-v2](https://huggingface.co/Goader/liberta-large-v2) | __91.73 (1.81)__ | __93.22 (0.14)__ | __98.79 (0.06)__ | 95.67 (0.12) |
|
34 |
|
|
|
35 |
|
|
|
36 |
|
37 |
+
## How to Get Started with the Model
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
+
Use the code below to get started with the model. Note, that the repository contains custom code for tokenization:
|
|
|
|
|
|
|
|
|
40 |
|
41 |
+
Pipeline usage:
|
42 |
|
43 |
+
```python
|
44 |
+
>>> from transformers import pipeline
|
45 |
|
46 |
+
>>> fill_mask = pipeline("fill-mask", "Goader/liberta-large", trust_remote_code=True)
|
47 |
+
>>> fill_mask("Арсенальна - найглибша станція <mask> у світі.")
|
48 |
|
49 |
+
[{'score': 0.929235577583313,
|
50 |
+
'token': 8670,
|
51 |
+
'token_str': 'метро',
|
52 |
+
'sequence': 'Арсенальна - найглибша станція метро у світі.'},
|
53 |
+
{'score': 0.005501953419297934,
|
54 |
+
'token': 8608,
|
55 |
+
'token_str': 'світла',
|
56 |
+
'sequence': 'Арсенальна - найглибша станція світла у світі.'},
|
57 |
+
{'score': 0.0037314200308173895,
|
58 |
+
'token': 3808,
|
59 |
+
'token_str': 'Європи',
|
60 |
+
'sequence': 'Арсенальна - найглибша станція Європи у світі.'},
|
61 |
+
{'score': 0.0032518072985112667,
|
62 |
+
'token': 21678,
|
63 |
+
'token_str': 'ЮНЕСКО',
|
64 |
+
'sequence': 'Арсенальна - найглибша станція ЮНЕСКО у світі.'},
|
65 |
+
{'score': 0.002941741142421961,
|
66 |
+
'token': 20250,
|
67 |
+
'token_str': 'залізниці',
|
68 |
+
'sequence': 'Арсенальна - найглибша станція залізниці у світі.'}]
|
69 |
+
```
|
70 |
|
71 |
+
Extracting embeddings:
|
72 |
|
73 |
+
```python
|
74 |
+
from transformers import AutoTokenizer, AutoModel
|
75 |
|
76 |
+
tokenizer = AutoTokenizer.from_pretrained("Goader/liberta-large", trust_remote_code=True)
|
77 |
+
model = AutoModel.from_pretrained("Goader/liberta-large")
|
78 |
|
79 |
+
encoded = tokenizer('Арсенальна - найглибша станція метро у світі.', return_tensors='pt')
|
80 |
|
81 |
+
output = model(**encoded)
|
82 |
+
```
|
83 |
|
84 |
+
## Citation
|
85 |
|
86 |
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
87 |
|
88 |
+
```
|
89 |
+
@inproceedings{haltiuk-smywinski-pohl-2024-liberta,
|
90 |
+
title = "{L}i{BERT}a: Advancing {U}krainian Language Modeling through Pre-training from Scratch",
|
91 |
+
author = "Haltiuk, Mykola and
|
92 |
+
Smywi{\'n}ski-Pohl, Aleksander",
|
93 |
+
editor = "Romanyshyn, Mariana and
|
94 |
+
Romanyshyn, Nataliia and
|
95 |
+
Hlybovets, Andrii and
|
96 |
+
Ignatenko, Oleksii",
|
97 |
+
booktitle = "Proceedings of the Third Ukrainian Natural Language Processing Workshop (UNLP) @ LREC-COLING 2024",
|
98 |
+
month = may,
|
99 |
+
year = "2024",
|
100 |
+
address = "Torino, Italia",
|
101 |
+
publisher = "ELRA and ICCL",
|
102 |
+
url = "https://aclanthology.org/2024.unlp-1.14",
|
103 |
+
pages = "120--128",
|
104 |
+
abstract = "Recent advancements in Natural Language Processing (NLP) have spurred remarkable progress in language modeling, predominantly benefiting English. While Ukrainian NLP has long grappled with significant challenges due to limited data and computational resources, recent years have seen a shift with the emergence of new corpora, marking a pivotal moment in addressing these obstacles. This paper introduces LiBERTa Large, the inaugural BERT Large model pre-trained entirely from scratch only on Ukrainian texts. Leveraging extensive multilingual text corpora, including a substantial Ukrainian subset, LiBERTa Large establishes a foundational resource for Ukrainian NLU tasks. Our model outperforms existing multilingual and monolingual models pre-trained from scratch for Ukrainian, demonstrating competitive performance against those relying on cross-lingual transfer from English. This achievement underscores our ability to achieve superior performance through pre-training from scratch with additional enhancements, obviating the need to rely on decisions made for English models to efficiently transfer weights. We establish LiBERTa Large as a robust baseline, paving the way for future advancements in Ukrainian language modeling.",
|
105 |
+
}
|
106 |
+
```
|
107 |
+
|
108 |
+
## Licence
|
109 |
+
|
110 |
+
CC-BY 4.0
|
111 |
+
|
112 |
+
## Authors
|
113 |
+
|
114 |
+
The model was trained by Mykola Haltiuk as a part of his Master's Thesis under the supervision of Aleksander Smywiński-Pohl, PhD, AGH University of Krakow.
|