Skip to main content

Cheetah Speech-to-Text Engine.

Project description

Cheetah Binding for Python

Cheetah Speech-to-Text Engine

Made in Vancouver, Canada by Picovoice

Cheetah is an on-device streaming speech-to-text engine. Cheetah is:

  • Private; All voice processing runs locally.
  • Accurate
  • Compact and Computationally-Efficient
  • Cross-Platform:
    • Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64, arm64)
    • Android and iOS
    • Chrome, Safari, Firefox, and Edge
    • Raspberry Pi (3, 4, 5)

Compatibility

  • Python 3.9+
  • Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64), and Raspberry Pi (3, 4, 5).

Installation

pip3 install pvcheetah

AccessKey

Cheetah requires a valid Picovoice AccessKey at initialization. AccessKey acts as your credentials when using Cheetah SDKs. You can get your AccessKey for free. Make sure to keep your AccessKey secret. Signup or Login to Picovoice Console to get your AccessKey.

Usage

Basic Transcription

Create an instance of the engine and transcribe audio:

import pvcheetah

handle = pvcheetah.create(access_key='${ACCESS_KEY}')

def get_next_audio_frame():
    pass

while True:
    partial_transcript, is_endpoint = handle.process(get_next_audio_frame())
    if is_endpoint:
        final_transcript = handle.flush()

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console. When done be sure to explicitly release the resources using handle.delete().

Annotated Transcription

Create an instance of the engine and get the audio transcription and word-level metadata:

import pvcheetah

handle = pvcheetah.create(access_key='${ACCESS_KEY}')

def get_next_audio_frame():
    pass

while True:
    partial_output = handle.process_annotated(get_next_audio_frame())
    partial_transcript = partial_output.transcript
    partial_words = partial_output.words
    is_endpoint = partial_output.is_endpoint

    if is_endpoint:
        final_output = handle.flush_annotated()
        final_transcript = final_output.transcript
        final_words = final_output.words

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console. When done be sure to explicitly release the resources using handle.delete().

Language Model

The Cheetah Python SDK comes preloaded with a default English language model (.pv file). Default models for other supported languages can be found in lib/common.

Create custom language models using the Picovoice Console. Here you can train language models with custom vocabulary and boost words in the existing vocabulary.

Pass in the .pv file via the model_path argument:

cheetah = pvcheetah.create(
    access_key='${ACCESS_KEY}',
    model_path='${MODEL_FILE_PATH}')

Demos

pvcheetahdemo provides command-line utilities for processing audio using Cheetah.

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

pvcheetah-4.1.0.tar.gz (40.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pvcheetah-4.1.0-py3-none-any.whl (40.9 MB view details)

Uploaded Python 3

File details

Details for the file pvcheetah-4.1.0.tar.gz.

File metadata

  • Download URL: pvcheetah-4.1.0.tar.gz
  • Upload date:
  • Size: 40.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pvcheetah-4.1.0.tar.gz
Algorithm Hash digest
SHA256 7ae0b7ba3f1c4020adb20f90391f5e6623fca6fd9919e67acf03288d01ac0377
MD5 cb4ed05604266b2e2884316471eae5d6
BLAKE2b-256 f661cdba22292452f34bfeadf559cea82b39f000e46162af6552a420e6c40c7a

See more details on using hashes here.

File details

Details for the file pvcheetah-4.1.0-py3-none-any.whl.

File metadata

  • Download URL: pvcheetah-4.1.0-py3-none-any.whl
  • Upload date:
  • Size: 40.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pvcheetah-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0272d0fee022b65c615ea82510b38aa56a1980e8876e508f27ac62684a74fada
MD5 287bf4d1d65a3364ee6296810ad368e9
BLAKE2b-256 99828b072b619592aa77cc218f7d390963ba0886819696b6865b776eafaed004

See more details on using hashes here.

Supported by

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