Skip to main content

Python client for Kaldi GRPC server

Project description

Kaldi gRPC client

Python client library for Kaldi gRPC server. This client has similar - identical - semantics to the Google speech Python library.

Installation

You can install from source

git clone https://github.com/georgepar/kaldi-grpc-server
cd client
pip install .

or from Pypi

pip install kaldigrpc-client

Usage from command line

We assume you have a server running on port 50051. See kaldi-grpc-server README for more information.

kaldigrpc-transcribe --port 50051 $MY_WAV_FILE

For long files we recommend using the streaming client

kaldigrpc-transcribe --streaming --port 50051 $MY_WAV_FILE

Programmatic usage

The following is a simple example for streaming recognition using the ILSPASRClient. You can also refer to the code and the proto files for more configuration options and more outputs (e.g. confidence, word start and end times etc.)

Warning: Some configuration options are included for compatibility / easy swapping with the Google Speech client library but are not yet fully implemented. Please refer to the code for more details.

cli = ILSPASRClient(host="localhost", port=50051)

chunks = ...  # list of audio chunks (bytes)

for partial_result in cli.streaming_recognize(chunks):
    # Print best path partial transcription
    print(partial_result.results[0].alternatives[0].transcript)

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

kaldigrpc_client-1.0.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

kaldigrpc_client-1.0.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file kaldigrpc_client-1.0.1.tar.gz.

File metadata

  • Download URL: kaldigrpc_client-1.0.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.14.16-zen1-1-zen

File hashes

Hashes for kaldigrpc_client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f29f31bf7ecfbcd7e138eb3c5c3e95bb1b2c6b61b32b7c0acb45726054e95d11
MD5 363a6bc5779cee6dfd4a3336246f5ecd
BLAKE2b-256 7b7bda10616bcadb044863515daafcab65459324be0fb82f2c6bc796f87e10a5

See more details on using hashes here.

File details

Details for the file kaldigrpc_client-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: kaldigrpc_client-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.14.16-zen1-1-zen

File hashes

Hashes for kaldigrpc_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b40cfa8065d40fef8b071327e80059b210a0886617f9979ab514ba7427f1bf9c
MD5 9a8e8505488aebe1509b81c0484a8e6f
BLAKE2b-256 e3f539945eacd977a762e6e0dfc4c7cd202248a075e860d570963388b6aef3a9

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