Run this model with HF Jobs

Run IbrahimSalah/Arabic_speech_Syllables_recognition_Using_Wav2vec2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/IbrahimSalah/Arabic_speech_Syllables_recognition_Using_Wav2vec2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/IbrahimSalah/Arabic_speech_Syllables_recognition_Using_Wav2vec2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Arabic syllables recognition with tashkeel

paper DOI : https://doi.org/10.60161/2521-001-001-006
This is fine tuned wav2vec2 model to recognize arabic syllables from speech.
The model was trained on Modern standard arabic dataset .
5-gram language model is available with the model.

To try it out :

!pip install datasets transformers
!pip install https://github.com/kpu/kenlm/archive/master.zip pyctcdecode
from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
from transformers import Wav2Vec2ProcessorWithLM
processor = Wav2Vec2ProcessorWithLM.from_pretrained('IbrahimSalah/Syllables_final_Large')
model = Wav2Vec2ForCTC.from_pretrained("IbrahimSalah/Syllables_final_Large")
import pandas as pd
dftest = pd.DataFrame(columns=['audio'])
import datasets
from datasets import Dataset
path ='/content/908-33.wav'
dftest['audio']=[path]  ## audio path
dataset = Dataset.from_pandas(dftest)
import torch
import torchaudio
def speech_file_to_array_fn(batch):
    speech_array, sampling_rate = torchaudio.load(batch["audio"])
    print(sampling_rate)
    resampler = torchaudio.transforms.Resample(sampling_rate, 16_000) # The original data was with 48,000 sampling rate. You can change it according to your input.
    batch["audio"] = resampler(speech_array).squeeze().numpy()
    return batch
import numpy as np
from datasets import load_dataset
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
test_dataset = dataset.map(speech_file_to_array_fn)
inputs = processor(test_dataset["audio"], sampling_rate=16_000, return_tensors="pt", padding=True)
with torch.no_grad():
    logits = model(inputs.input_values).logits
    print(logits.numpy().shape)

transcription = processor.batch_decode(logits.numpy()).text
print("Prediction:",transcription[0])

You can then convert the syllables to full word using our fine tuned mT5 model[IbrahimSalah/Arabic_Syllables_to_text_Converter_Using_MT5]

Citation

BibTeX:

@article{2024SyllableBasedAS,
  title={Syllable-Based Arabic Speech Recognition Using Wav2Vec},
  author={ุฅุจุฑุงู‡ูŠู… ุนุจุฏุงู„ุนุงู„ and ู…ุตุทูู‰ ุงู„ุดุงูุนูŠ and ู…ุญู…ุฏ ุนุจุฏุงู„ูˆุงุญุฏ},
  journal={ู…ุฌู„ุฉ ุงู„ู„ุบุงุช ุงู„ุญุงุณูˆุจูŠุฉ ูˆุงู„ู…ุนุงู„ุฌุฉ ุงู„ุขู„ูŠุฉ ู„ู„ุบุฉ ุงู„ุนุฑุจูŠุฉ},
  year={2024},
  url={https://api.semanticscholar.org/CorpusID:269151543}
}
Downloads last month
673
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train IbrahimSalah/Arabic_speech_Syllables_recognition_Using_Wav2vec2

Spaces using IbrahimSalah/Arabic_speech_Syllables_recognition_Using_Wav2vec2 5