Downloads · 30 days
3.7K
7% of all-time downloads
boumehdi/wav2vec2-large-xlsr-moroccan-darija
wav2vec2-large-xlsr-moroccan-darija is a automatic speech recognition model from boumehdi. Use it when you need speech turned into text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
3.7K
7% of all-time downloads
All-time downloads
49.9K
Public
Repo size
307 GB
Likes
35
Public
Click a slice to open those files.
.pt2.5 GB · 66%
From the Hugging Face model README
wav2vec2-large-xlsr-53 new model
The model can be used directly as follows:
import librosa
import torch
from transformers import Wav2Vec2CTCTokenizer, Wav2Vec2ForCTC, Wav2Vec2Processor, TrainingArguments, Wav2Vec2FeatureExtractor, Trainer
tokenizer = Wav2Vec2CTCTokenizer("./vocab.json", unk_token="[UNK]", pad_token="[PAD]", word_delimiter_token="|")
processor = Wav2Vec2Processor.from_pretrained('boumehdi/wav2vec2-large-xlsr-moroccan-darija', tokenizer=tokenizer)
model=Wav2Vec2ForCTC.from_pretrained('boumehdi/wav2vec2-large-xlsr-moroccan-darija')
# load the audio data (use your own wav file here!)
input_audio, sr = librosa.load('file.wav', sr=16000)
# tokenize
input_values = processor(input_audio, return_tensors="pt", padding=True).input_values
# retrieve logits
logits = model(input_values).logits
tokens = torch.argmax(logits, axis=-1)
# decode using n-gram
transcription = tokenizer.batch_decode(tokens)
# print the output
print(transcription)
Output: قالت ليا هاد السيد هادا ما كاينش بحالو
email: [email protected]
BOUMEHDI Ahmed