Khmer Speech To Text Inference API using Wav2Vec2 with Pretrain Model
Project description
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 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
Reference
- Inspired by Techcast
- Khmer word segmentation from SeangHay khmercut | khmersegment
- Wav2Vec2 from Facebook Wav2Vec2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sdab-0.1.2.tar.gz
(7.1 kB
view details)
Built Distribution
sdab-0.1.2-py3-none-any.whl
(7.2 kB
view details)
File details
Details for the file sdab-0.1.2.tar.gz
.
File metadata
- Download URL: sdab-0.1.2.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6f6bfde776115eb7ccca34cd14cd0fd8e5dc15be6be8a4ea6e5c72c494883d8 |
|
MD5 | b35b6ae95ff9aac88658732eff017667 |
|
BLAKE2b-256 | 5ef148ef0a7504355cb664cc07e7ecbaa8316b86943a5c4f65d416745afae615 |
File details
Details for the file sdab-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: sdab-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 230a9b3b416cacbf6b72a901761b4033afe3b3de463e33a4e2cf1244103f6b64 |
|
MD5 | e93a3242af4b70904ffec8f8e072cb4c |
|
BLAKE2b-256 | 88ae7ea9576c5071115233846f6716c4da97d7093dc331404222a2085c43ecf0 |