waveletdeboshir
commited on
Commit
•
e1891d9
1
Parent(s):
fbf8a84
Add model info
Browse files
README.md
CHANGED
@@ -1,3 +1,97 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- ru
|
5 |
+
library_name: transformers
|
6 |
+
pipeline_tag: automatic-speech-recognition
|
7 |
+
base_model: waveletdeboshir/whisper-base-ru-pruned-finetuned
|
8 |
+
tags:
|
9 |
+
- asr
|
10 |
+
- Pytorch
|
11 |
+
- pruned
|
12 |
+
- finetune
|
13 |
+
- audio
|
14 |
+
- automatic-speech-recognition
|
15 |
+
model-index:
|
16 |
+
- name: Whisper Base Pruned and Finetuned for Russian
|
17 |
+
results:
|
18 |
+
- task:
|
19 |
+
name: Speech Recognition
|
20 |
+
type: automatic-speech-recognition
|
21 |
+
dataset:
|
22 |
+
name: Common Voice 15.0 (Russian part, test)
|
23 |
+
type: mozilla-foundation/common_voice_15_0
|
24 |
+
args: ru
|
25 |
+
metrics:
|
26 |
+
- name: WER
|
27 |
+
type: wer
|
28 |
+
value: null
|
29 |
+
- task:
|
30 |
+
name: Speech Recognition
|
31 |
+
type: automatic-speech-recognition
|
32 |
+
dataset:
|
33 |
+
name: Common Voice 15.0 (Russian part, test)
|
34 |
+
type: mozilla-foundation/common_voice_15_0
|
35 |
+
args: ru
|
36 |
+
metrics:
|
37 |
+
- name: WER (without punctuation)
|
38 |
+
type: wer
|
39 |
+
value: null
|
40 |
+
datasets:
|
41 |
+
- mozilla-foundation/common_voice_15_0
|
42 |
+
---
|
43 |
+
|
44 |
+
# Whisper-base-ru-pruned-finetuned
|
45 |
+
|
46 |
+
## Model info
|
47 |
+
This is a finetuned version of pruned whisper-base model ([waveletdeboshir/whisper-base-ru-pruned](https://huggingface.co/waveletdeboshir/whisper-base-ru-pruned)) for Russian language.
|
48 |
+
|
49 |
+
Model was finetuned on russian part of [mozilla-foundation/common_voice_15_0](https://huggingface.co/datasets/mozilla-foundation/common_voice_15_0).
|
50 |
+
|
51 |
+
## Metrics
|
52 |
+
|
53 |
+
| metric | dataset | waveletdeboshir/whisper-base-ru-pruned | waveletdeboshir/whisper-small-ru-pruned-finetuned |
|
54 |
+
| :------ | :------ | :------ | :------ |
|
55 |
+
| WER* | common_voice_15_0_test | | |
|
56 |
+
| WER | common_voice_15_0_test | | |
|
57 |
+
*Metrics were computed after text normalization
|
58 |
+
|
59 |
+
## Size
|
60 |
+
Only 10% tokens was left including special whisper tokens (no language tokens except \<|ru|\> and \<|en|\>, no timestamp tokens), 200 most popular tokens from tokenizer and 4000 most popular Russian tokens computed by tokenization of russian text corpus.
|
61 |
+
|
62 |
+
Model size is 30% less then original whisper-base:
|
63 |
+
| | openai/whisper-base | waveletdeboshir/whisper-base-ru-pruned-finetuned |
|
64 |
+
| :------ | :------ | :------ |
|
65 |
+
| n of parameters | 74 M | 48 M |
|
66 |
+
| n of parameters (with proj_out layer) | 99 M | 50 M |
|
67 |
+
| model file size | 290 Mb | 201 Mb |
|
68 |
+
| vocab_size | 51865 | 4207 |
|
69 |
+
|
70 |
+
## Usage
|
71 |
+
Model can be used as an original whisper:
|
72 |
+
|
73 |
+
```python
|
74 |
+
>>> from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
75 |
+
>>> import torchaudio
|
76 |
+
|
77 |
+
>>> # load audio
|
78 |
+
>>> wav, sr = torchaudio.load("audio.wav")
|
79 |
+
|
80 |
+
>>> # load model and processor
|
81 |
+
>>> processor = WhisperProcessor.from_pretrained("waveletdeboshir/whisper-base-ru-pruned-finetuned")
|
82 |
+
>>> model = WhisperForConditionalGeneration.from_pretrained("waveletdeboshir/whisper-base-ru-pruned-finetuned")
|
83 |
+
|
84 |
+
>>> input_features = processor(wav[0], sampling_rate=sr, return_tensors="pt").input_features
|
85 |
+
|
86 |
+
>>> # generate token ids
|
87 |
+
>>> predicted_ids = model.generate(input_features)
|
88 |
+
>>> # decode token ids to text
|
89 |
+
>>> transcription = processor.batch_decode(predicted_ids, skip_special_tokens=False)
|
90 |
+
['<|startoftranscript|><|ru|><|transcribe|><|notimestamps|> Начинаем работу.<|endoftext|>']
|
91 |
+
|
92 |
+
```
|
93 |
+
The context tokens can be removed from the start of the transcription by setting `skip_special_tokens=True`.
|
94 |
+
|
95 |
+
## Other pruned whisper models
|
96 |
+
* [waveletdeboshir/whisper-tiny-ru-pruned](https://huggingface.co/waveletdeboshir/whisper-tiny-ru-pruned)
|
97 |
+
* [waveletdeboshir/whisper-small-ru-pruned](https://huggingface.co/waveletdeboshir/whisper-small-ru-pruned)
|