Sdab is a Python package for Automatic Speech Recognition with focus on Khmer language. It have offline khmer automatic speech recognition model from my Pretrain Model and other that using Wav2Vec2 model.
License: Apache-2.0 License
Pretrain Model: Huggingface
pip install sdab
# clone repo
git clone https://github.com/MetythornPenn/sdab.git
# install lib from source
pip install -e .
wget -O audio.wav https://github.com/MetythornPenn/sdab/blob/main/sample/audio.wav
from sdab import Sdab
file_path = "audio.wav"
model_name = "metythorn/khmer-asr-openslr" # or local directory path
sdab = Sdab( file_path = file_path, model_name = model_name)
print(sdab.result)
# result : ស្ពានកំពងចំលងអ្នកលើងនៅព្រីវែញជាស្ពានវេញជាងគេសក្នុងព្រសរាជាអាចកម្ពុជា
file_path
: path of audio filemodel_name
: pretrain model path fromhuggingface
orlocal
device
: should becpu
orcuda
but I usecpu
by defaulttokenized
: show[PAD]
in output,False
by defaultreturn
: Khmer text from ASR
- Inspired by Bong Vitou Phy | Techcast
- Khmer word segmentation from SeangHay khmercut | khmersegment
- Wav2Vec2 from Facebook Wav2Vec2