Downloads · 30 days
14
0% of all-time downloads
techiaith/wav2vec2-btb-cv-ft-cv-cy
wav2vec2-btb-cv-ft-cv-cy is a automatic speech recognition model from techiaith. Use it when you need speech turned into text. The card lists the license as apache-2.0.
This model is a version of techiaith/wav2vec2-xlsr-53-ft-btb-cv-cy fine-tuned with its encoder frozen and the training set commonvoicecy18
Downloads · 30 days
14
0% of all-time downloads
All-time downloads
13.8K
Public
Parameters
315M
33.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.bin3 GB · 70%
From the Hugging Face model README
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])