Views
No views yet
from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
from datasets import load_dataset
import torch
# load model and processor
processor = Wav2Vec2Processor.from_pretrained("GetmanY1/wav2vec2-base-fi-lp-from-scratch-1500h")
model = Wav2Vec2ForCTC.from_pretrained("GetmanY1/wav2vec2-base-fi-lp-from-scratch-1500h")
# load dummy dataset and read soundfiles
ds = load_dataset("mozilla-foundation/common_voice_16_1", "fi", split='test')
# tokenize
input_values = processor(ds[0]["audio"]["array"], return_tensors="pt", padding="longest").input_values # Batch size 1
# retrieve logits
logits = model(input_values).logits
# take argmax and decode
predicted_ids = torch.argmax(logits, dim=-1)
transcription = processor.batch_decode(predicted_ids)| System | Labeled training data, h | dev WER [%] | dev CER [%] | test WER [%] | test CER [%] |
|---|---|---|---|---|---|
| Base Models | |||||
| GetmanY1/wav2vec2-base-fi-voxpopuli-v2-100h | 100 | 29.35 | 7.94 | 31.90 | 9.05 |
| GetmanY1/wav2vec2-base-fi-voxpopuli-v2-1500h | 1500 | 22.18 | 5.96 | 24.43 | 6.97 |
| GetmanY1/wav2vec2-base-fi-lp-from-scratch-100h | 100 | 26.40 | 6.86 | 28.92 | 8.09 |
| GetmanY1/wav2vec2-base-fi-lp-from-scratch-1500h | 1500 | 21.61 | 5.59 | 24.35 | 6.87 |
| GetmanY1/wav2vec2-base-fi-lp-cont-pt-100h | 100 | 22.49 | 5.84 | 24.95 | 7.09 |
| GetmanY1/wav2vec2-base-fi-lp-cont-pt-1500h | 1500 | 17.38 | 4.61 | 19.65 | 5.69 |
| Large Models | |||||
| GetmanY1/wav2vec2-large-uralic-voxpopuli-v2-100h | 100 | 21.02 | 5.70 | 22.98 | 6.90 |
| GetmanY1/wav2vec2-large-uralic-voxpopuli-v2-1500h | 1500 | 19.14 | 5.05 | 20.49 | 5.93 |
| GetmanY1/wav2vec2-large-fi-lp-from-scratch-100h | 100 | 21.66 | 5.61 | 23.85 | 6.76 |
| GetmanY1/wav2vec2-large-fi-lp-from-scratch-1500h | 1500 | 17.54 | 4.59 | 19.26 | 5.58 |
| GetmanY1/wav2vec2-large-fi-lp-cont-pt-100h | 100 | 20.20 | 5.40 | 22.81 | 6.64 |
| GetmanY1/wav2vec2-large-fi-lp-cont-pt-1500h | 1500 | 16.24 | 4.34 | 18.04 | 5.29 |
1@inproceedings{getman24_interspeech,
2 title = {What happens in continued pre-training? Analysis of self-supervised speech
3 models with continued pre-training for colloquial Finnish ASR},
4 author = {Yaroslav Getman and Tamas Grosz and Mikko Kurimo},
5 year = {2024},
6 booktitle = {Interspeech 2024},
7 pages = {5043--5047},
8 doi = {10.21437/Interspeech.2024-476},
9}