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
Install From Source
# clone repo
git clone https://github.com/MetythornPenn/sdab.git
# install lib from source (recommend python 3.8)
pip install -e .
Usage
from sdab import Sdab
file_path = "sample/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.0.tar.gz
(7.0 kB
view details)
Built Distribution
sdab-0.1.0-py3-none-any.whl
(7.2 kB
view details)
File details
Details for the file sdab-0.1.0.tar.gz
.
File metadata
- Download URL: sdab-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e41edb9e866fcf2d86cd9bea6f0b36fcfc060c12edb3eb2003806a77621427ef |
|
MD5 | c0cd30c487b13e6fd4ad05bcfc9c0579 |
|
BLAKE2b-256 | 463256911b089d938edfbcaad2a0902bec18080310a216d52cb88dbdb31aa608 |
File details
Details for the file sdab-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: sdab-0.1.0-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 | e215a58753b3c8a15b43206391323203e43e978bf9fe7ecae9d874f57bfe124b |
|
MD5 | 58821c3ee6f07ff926e5b5e47efa65c1 |
|
BLAKE2b-256 | ca7045aa2893d9433a2583aeea34d8a1d25ce079b29805633572c5bb6c2198d7 |