Skip to content

MetythornPenn/sdab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sdab

Khmer Automatic Speech Recognition

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

Installation

Install from PyPI

pip install sdab

Install from source

# clone repo 
git clone https://github.com/MetythornPenn/sdab.git

# install lib from source
pip install -e .

Usage

Download sample audio

wget -O audio.wav https://github.com/MetythornPenn/sdab/blob/main/sample/audio.wav

Python API

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 file
  • model_name : pretrain model path from huggingface or local
  • device : should be cpu or cuda but I use cpu by default
  • tokenized: show [PAD] in output, False by default
  • return: Khmer text from ASR

Reference

About

Khmer Speech to Text Inference with Pretrained Model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published