Skip to main content

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 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

Project details


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)

Uploaded Source

Built Distribution

sdab-0.1.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

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

Hashes for sdab-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f6f6bfde776115eb7ccca34cd14cd0fd8e5dc15be6be8a4ea6e5c72c494883d8
MD5 b35b6ae95ff9aac88658732eff017667
BLAKE2b-256 5ef148ef0a7504355cb664cc07e7ecbaa8316b86943a5c4f65d416745afae615

See more details on using hashes here.

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

Hashes for sdab-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 230a9b3b416cacbf6b72a901761b4033afe3b3de463e33a4e2cf1244103f6b64
MD5 e93a3242af4b70904ffec8f8e072cb4c
BLAKE2b-256 88ae7ea9576c5071115233846f6716c4da97d7093dc331404222a2085c43ecf0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page