Speech Recognition Models
Collection
Models for Welsh language and bilingual speech recognition
•
14 items
•
Updated
This model is a version of techiaith/wav2vec2-xlsr-53-ft-btb-cv-cy fine-tuned with its encoder frozen and the training set commonvoice_cy_18
It achieves the following results on the Welsh Common Voice version 18 standard test set:
However, when the accompanying KenLM language model is used, it achieves the following results on the same test set:
import torch
import torchaudio
import librosa
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
processor = Wav2Vec2Processor.from_pretrained("techiaith/wav2vec2-xlsr-ft-cy")
model = Wav2Vec2ForCTC.from_pretrained("techiaith/wav2vec2-xlsr-ft-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():
logits = 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))
import torch
import torchaudio
import librosa
from transformers import Wav2Vec2ForCTC, Wav2Vec2ProcessorWithLM
processor = Wav2Vec2ProcessorWithLM.from_pretrained("techiaith/wav2vec2-xlsr-ft-cy")
model = Wav2Vec2ForCTC.from_pretrained("techiaith/wav2vec2-xlsr-ft-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():
logits = model(inputs.input_values, attention_mask=inputs.attention_mask).logits
# ctc decoding
print("Prediction:", processor.batch_decode(logits.numpy()).text[0])
Base model
facebook/wav2vec2-large-xlsr-53