Fill in README.md
Browse files
README.md
CHANGED
@@ -1,13 +1,15 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
# Model Card for Model ID
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
|
12 |
## Model Details
|
13 |
|
@@ -17,61 +19,65 @@ tags: []
|
|
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:**
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):**
|
25 |
-
- **License:**
|
26 |
-
- **Finetuned from model
|
27 |
|
28 |
-
### Model Sources
|
29 |
|
30 |
<!-- Provide the basic links for the model. -->
|
31 |
|
32 |
-
- **Repository:** [
|
33 |
-
- **Paper
|
34 |
-
- **
|
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 |
-
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
53 |
|
54 |
-
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
|
|
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
63 |
|
64 |
-
|
|
|
65 |
|
66 |
-
|
|
|
|
|
67 |
|
68 |
-
|
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 |
|
@@ -85,115 +91,46 @@ Use the code below to get started with the model.
|
|
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
|
89 |
|
90 |
-
[
|
|
|
|
|
91 |
|
|
|
92 |
|
93 |
#### Training Hyperparameters
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
|
|
102 |
|
103 |
## Evaluation
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
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 |
-
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
|
133 |
|
|
|
134 |
|
135 |
-
|
136 |
|
137 |
-
|
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 |
-
- **Hardware Type:** [More Information Needed]
|
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 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
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 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
|
197 |
## Model Card Contact
|
198 |
|
199 |
-
[
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
datasets:
|
4 |
+
- classla/Mici_Princ
|
5 |
+
language:
|
6 |
+
- hr
|
7 |
---
|
8 |
|
9 |
# Model Card for Model ID
|
10 |
|
11 |
+
This model was finetuned on [Mići Princ dataset](https://huggingface.co/datasets/classla/Mici_Princ),
|
12 |
+
audiobook of a translation of _Le Petit Prince_ in Chakavian dialect of Croatian.
|
|
|
13 |
|
14 |
## Model Details
|
15 |
|
|
|
19 |
|
20 |
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
21 |
|
22 |
+
- **Developed by:** Nikola Ljubešić, Peter Rupnik, Tea Perinčić
|
|
|
|
|
23 |
- **Model type:** [More Information Needed]
|
24 |
+
- **Language(s) (NLP):** Croatian - Chakavian dialect
|
25 |
+
- **License:** Creative Commons - Share Alike 4.0
|
26 |
+
- **Finetuned from model:** openai/whisper-large-v3
|
27 |
|
28 |
+
### Model Sources
|
29 |
|
30 |
<!-- Provide the basic links for the model. -->
|
31 |
|
32 |
+
- **Repository:** [GitHub](https://github.com/5roop/mici_princ_whisper)
|
33 |
+
- **Paper:** Coming soon
|
34 |
+
- **Dataset:** [Mići Princ](https://huggingface.co/datasets/classla/Mici_Princ)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
+
## Example use:
|
37 |
|
38 |
+
```python
|
39 |
+
import torch
|
40 |
+
from datasets import load_dataset
|
41 |
+
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
|
42 |
+
from transformers.pipelines.pt_utils import KeyDataset
|
43 |
|
44 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
45 |
+
model_id = "5roop/whisper-large-v3-mici-princ"
|
46 |
+
model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
47 |
+
model_id,
|
48 |
+
)
|
49 |
|
50 |
+
model.to(device)
|
51 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
52 |
|
53 |
+
ds = load_dataset("classla/Mici_Princ", split="test")
|
54 |
+
pipe = pipeline(
|
55 |
+
"automatic-speech-recognition",
|
56 |
+
model=model,
|
57 |
+
tokenizer=processor.tokenizer,
|
58 |
+
feature_extractor=processor.feature_extractor,
|
59 |
+
max_new_tokens=128,
|
60 |
+
chunk_length_s=30,
|
61 |
+
batch_size=16,
|
62 |
+
return_timestamps=True,
|
63 |
+
device=device,
|
64 |
+
)
|
65 |
|
66 |
+
result = pipe(
|
67 |
+
KeyDataset(ds, "audio"),
|
68 |
+
generate_kwargs={"language": "croatian"},
|
69 |
+
)
|
70 |
|
71 |
+
for i in result:
|
72 |
+
print(i)
|
73 |
|
74 |
+
# Output:
|
75 |
+
# {'text': ' Šesti planet je biv deset put veći. Na njin je bivav niki stari čovik ki je pisav vele knjige.', 'chunks': [{'timestamp': (0.0, 7.18), 'text': ' Šesti planet je biv deset put veći. Na njin je bivav niki stari čovik ki je pisav vele knjige.'}]}
|
76 |
+
# ...
|
77 |
|
78 |
+
```
|
79 |
|
|
|
80 |
|
|
|
|
|
|
|
81 |
|
82 |
## Training Details
|
83 |
|
|
|
91 |
|
92 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
93 |
|
94 |
+
#### Preprocessing
|
95 |
|
96 |
+
Model was trained on the `normalized_text` attribute of the [Mići Princ dataset](https://huggingface.co/datasets/classla/Mici_Princ). This means
|
97 |
+
that the data included capital letters and punctuation, except bullet points, newlines, and quotation marks. Special characters, present in
|
98 |
+
the dialect, but not in standard Croatian, were substituted.
|
99 |
|
100 |
+
Only the `train` split was used in training.
|
101 |
|
102 |
#### Training Hyperparameters
|
103 |
|
104 |
+
```
|
105 |
+
per_device_train_batch_size=4,
|
106 |
+
gradient_accumulation_steps=4,
|
107 |
+
learning_rate=1e-5,
|
108 |
+
warmup_steps=100,
|
109 |
+
max_steps=309 * 10,
|
110 |
+
gradient_checkpointing=True,
|
111 |
+
predict_with_generate=True,
|
112 |
+
generation_max_length=225,
|
113 |
+
save_steps=309,
|
114 |
+
```
|
115 |
|
116 |
## Evaluation
|
117 |
|
118 |
+
For evaluation, the `test` split of the [Mići Princ dataset](https://huggingface.co/datasets/classla/Mici_Princ) was used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
#### Metrics
|
121 |
|
122 |
+
* WER: 0.04422
|
123 |
+
* CER: 0.16248
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
|
126 |
+
## Citation
|
127 |
|
128 |
+
Coming soon.
|
129 |
|
130 |
+
## Model Card Authors
|
131 |
|
132 |
+
Peter Rupnik
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
## Model Card Contact
|
135 |
|
136 |
+
[https://huggingface.co/5roop](https://huggingface.co/5roop)
|