模型:
techiaith/wav2vec2-xlsr-ft-en-cy
任务:
许可:
A speech recognition acoustic model for Welsh and English, fine-tuned from facebook/wav2vec2-large-xlsr-53 using English/Welsh balanced data derived from version 11 of their respective Common Voice datasets ( https://commonvoice.mozilla.org/cy/datasets ). Custom bilingual Common Voice train/dev and test splits were built using the scripts at https://github.com/techiaith/docker-commonvoice-custom-splits-builder#introduction
Source code and scripts for training wav2vec2-xlsr-ft-en-cy can be found at https://github.com/techiaith/docker-wav2vec2-cy .
The wav2vec2-xlsr-ft-en-cy model can be used directly as follows:
import torch import torchaudio import librosa from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor processor = Wav2Vec2Processor.from_pretrained("techiaith/wav2vec2-xlsr-ft-en-cy") model = Wav2Vec2ForCTC.from_pretrained("techiaith/wav2vec2-xlsr-ft-en-cy") audio, rate = librosa.load(audio_file, sr=16000) inputs = processor(audio, sampling_rate=16_000, return_tensors="pt", padding=True) with torch.no_grad(): tlogits = model(inputs.input_values, attention_mask=inputs.attention_mask).logits # greedy decoding predicted_ids = torch.argmax(logits, dim=-1) print("Prediction:", processor.batch_decode(predicted_ids))
According to a balanced English+Welsh test set derived from Common Voice version 11, the WER of techiaith/wav2vec2-xlsr-ft-en-cy is 17.7%
However, when evaluated with language specific test sets, the model exhibits a bias to perform better with Welsh.
Common Voice Test Set Language | WER | CER |
---|---|---|
EN+CY | 17.07 | 7.32 |
EN | 27.54 | 11.6 |
CY | 7.13 | 2.2 |