HKAB
commited on
Commit
·
bf1f61c
1
Parent(s):
8ee4ae6
Update Readme.md
Browse files
README.md
CHANGED
@@ -1,4 +1,18 @@
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
# Whisper Finetune 1 Notebook
|
3 |
|
4 |
In this experiment, Whisper (base) is finetuned on VinBigData 100h dataset, but with special pre-processing:
|
@@ -11,6 +25,23 @@ As state in the [paper](https://arxiv.org/pdf/2212.04356.pdf):
|
|
11 |
|
12 |
Whisper output is already in written form, and we would want to keep this ability by doing the last 2 preprocessing step. **However, the result is not perfect**.
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
## Installation
|
16 |
|
@@ -38,11 +69,4 @@ batch_size = 16
|
|
38 |
num_epochs = 10
|
39 |
learning_rate=5e-4
|
40 |
warmup_steps=2000,
|
41 |
-
```
|
42 |
-
## Checkpoint to play with
|
43 |
-
|
44 |
-
Updating...
|
45 |
-
|
46 |
-
---
|
47 |
-
license: mit
|
48 |
-
---
|
|
|
1 |
|
2 |
+
---
|
3 |
+
language:
|
4 |
+
- vi
|
5 |
+
thumbnail: "url to a thumbnail used in social sharing"
|
6 |
+
tags:
|
7 |
+
- automatic-speech-recognition
|
8 |
+
- whisper
|
9 |
+
license: mit
|
10 |
+
datasets:
|
11 |
+
- google/fleurs
|
12 |
+
metrics:
|
13 |
+
- Unnormalized WER
|
14 |
+
---
|
15 |
+
|
16 |
# Whisper Finetune 1 Notebook
|
17 |
|
18 |
In this experiment, Whisper (base) is finetuned on VinBigData 100h dataset, but with special pre-processing:
|
|
|
25 |
|
26 |
Whisper output is already in written form, and we would want to keep this ability by doing the last 2 preprocessing step. **However, the result is not perfect**.
|
27 |
|
28 |
+
## Usage
|
29 |
+
```python
|
30 |
+
from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
31 |
+
|
32 |
+
model_trained = WhisperForConditionalGeneration.from_pretrained('hkab/whisper-base-vietnamese-finetuned')
|
33 |
+
processor = WhisperProcessor.from_pretrained("hkab/whisper-base-vietnamese-finetuned")
|
34 |
+
|
35 |
+
forced_decoder_ids = processor.get_decoder_prompt_ids(language="vi", task="transcribe")
|
36 |
+
|
37 |
+
input_speech, rate = librosa.load('/path/to/audio.wav', sr=16000)
|
38 |
+
input_features = processor(input_speech, sampling_rate=rate, return_tensors="pt").input_features
|
39 |
+
|
40 |
+
predicted_ids = model_trained.generate(input_features, forced_decoder_ids=forced_decoder_ids)
|
41 |
+
|
42 |
+
print(f'Prediction: {processor.batch_decode(predicted_ids, skip_special_tokens=True)}')
|
43 |
+
```
|
44 |
+
|
45 |
|
46 |
## Installation
|
47 |
|
|
|
69 |
num_epochs = 10
|
70 |
learning_rate=5e-4
|
71 |
warmup_steps=2000,
|
72 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|