Views
No views yet
@inproceedings{ljubevsic2022parlaspeech,
title={ParlaSpeech-HR-a Freely Available ASR Dataset for Croatian Bootstrapped from the ParlaMint Corpus},
author={Ljube{\v{s}}i{\'c}, Nikola and Kor{\v{z}}inek, Danijel and Rupnik, Peter and Jazbec, Ivo-Pavao},
booktitle={Proceedings of the Workshop ParlaCLARIN III within the 13th Language Resources and Evaluation Conference},
pages={111--116},
year={2022},
url={http://www.lrec-conf.org/proceedings/lrec2022/workshops/ParlaCLARINIII/pdf/2022.parlaclariniii-1.16.pdf}
}| split | CER | WER |
|---|---|---|
| dev | 0.0448 | 0.1129 |
| test | 0.0363 | 0.0985 |
transformerstransformers==4.18.0, torch==1.11.0, and SoundFile==0.10.3.post1.1from transformers import Wav2Vec2ProcessorWithLM, Wav2Vec2ForCTC
2import soundfile as sf
3import torch
4import os
5device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
6# load model and tokenizer
7processor = Wav2Vec2ProcessorWithLM.from_pretrained(
8 "classla/wav2vec2-xls-r-parlaspeech-hr-lm")
9model = Wav2Vec2ForCTC.from_pretrained("classla/wav2vec2-xls-r-parlaspeech-hr-lm")
10# download the example wav files:
11os.system("wget https://huggingface.co/classla/wav2vec2-large-slavic-parlaspeech-hr/raw/main/00020570a.flac.wav")
12# read the wav file
13speech, sample_rate = sf.read("00020570a.flac.wav")
14input_values = processor(speech, sampling_rate=sample_rate, return_tensors="pt").input_values.cuda()
15inputs = processor(speech, sampling_rate=sample_rate, return_tensors="pt")
16with torch.no_grad():
17 logits = model(**inputs).logits
18transcription = processor.batch_decode(logits.numpy()).text[0]
19
20# remove the raw wav file
21os.system("rm 00020570a.flac.wav")
22transcription
23
24# transcription: 'velik broj poslovnih subjekata posluje sa minusom velik dio'| arg | value |
|---|---|
per_device_train_batch_size | 16 |
gradient_accumulation_steps | 4 |
num_train_epochs | 8 |
learning_rate | 3e-4 |
warmup_steps | 500 |