Downloads · 30 days
156K
6% of all-time downloads
ifrz/wav2vec2-large-xlsr-galician
wav2vec2-large-xlsr-galician is a automatic speech recognition model from ifrz. Use it when you need speech turned into text. It is set up for transformers.
--- language: gl datasets: - OpenSLR 77 - mozilla-foundation commonvoice80 metrics: - wer tags: - audio - automatic-speech-recognition - speech - xlsr-fine-tuning-week license: apache-2.0 model-index: - name: Galician…
Downloads · 30 days
156K
6% of all-time downloads
All-time downloads
2.5M
Public
Repo size
5 GB
Likes
2
Public
Click a slice to open those files.
.bin1.3 GB · 100%
From the Hugging Face model README
language: gl datasets:
Fine-tuned model for Galician language
Based on the facebook/wav2vec2-large-xlsr-53 self-supervised model Fine-tune with audio labelled from OpenSLR and Mozilla Common_Voice (both datasets previously refined)
Check training metrics to see results
Make sure that the audio speech input is sampled at 16kHz (mono).
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
model = Wav2Vec2ForCTC.from_pretrained("ifrz/wav2vec2-large-xlsr-galician")
processor = Wav2Vec2Processor.from_pretrained("ifrz/wav2vec2-large-xlsr-galician")
# Reading taken audio clip
import librosa, torch
audio, rate = librosa.load("./gl_test_1.wav", sr = 16000)
# Taking an input value
input_values = processor(audio, sampling_rate=16_000, return_tensors = "pt", padding="longest").input_values
# Storing logits (non-normalized prediction values)
logits = model(input_values).logits
# Storing predicted ids
prediction = torch.argmax(logits, dim = -1)
# Passing the prediction to the tokenzer decode to get the transcription
transcription = processor.batch_decode(prediction)[0]
print(transcription)