Neura's picture
Update README.md
65a2cf9 verified
|
raw
history blame
2.52 kB
metadata
library_name: transformers
tags:
  - persian
  - whisper-base
  - whisper
  - farsi
  - Neura
  - NeuraSpeech
license: apache-2.0
language:
  - fa
pipeline_tag: automatic-speech-recognition

Model Description

  • Developed by: Neura company
  • Funded by: Neura
  • Model type: Whisper Base
  • Language(s) (NLP): Persian

Model Architecture

This model uses a FastConformer-TDT architecture. FastConformer [1] is an optimized version of the Conformer model with 8x depthwise-separable convolutional downsampling. You may find more information on the details of FastConformer here: Fast-Conformer Model. Fast Conformer with Linearly Scalable Attention for Efficient Speech Recognition.

Uses

Check out the Google Colab demo to run NeuraSpeech ASR on a free-tier Google Colab instance: Open In Colab

make sure these packages are installed:

from IPython.display import Audio, display
display(Audio('persian_audio.mp3', rate = 32_000,autoplay=True))
from transformers import WhisperProcessor, WhisperForConditionalGeneration
import librosa

# load model and processor
processor = WhisperProcessor.from_pretrained("Neurai/NeuraSpeech_WhisperBase")
model = WhisperForConditionalGeneration.from_pretrained("Neurai/NeuraSpeech_WhisperBase")
forced_decoder_ids = processor.get_decoder_prompt_ids(language="fa", task="transcribe")

array, sample_rate = librosa.load('persian_audio.mp3', sr=16000,mono=True) 
sr = 16000
array = librosa.to_mono(array)
array = librosa.resample(array, orig_sr=sample_rate, target_sr=16000)
input_features = processor(array, sampling_rate=sr, return_tensors="pt").input_features

# generate token ids
predicted_ids = model.generate(input_features)
# decode token ids to text
transcription = processor.batch_decode(predicted_ids,)
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
print(transcription)

trascribed text :

او خواهان آزاد کردن بردگان بود

More Information

https://neura.info

Model Card Authors

Esmaeil Zahedi, Mohsen Yazdinejad

Model Card Contact

[email protected]