Python binding for Rhino Speech-to-Intent engine. It directly infers the user's intent from spoken commands in
real-time. Rhino processes incoming audio in consecutive frames and indicates if the inference is finalized. When
finalized, the inferred intent can be retrieved as structured data in the form of an intent string and pairs of
slots and values. The number of samples per frame can be attained by calling `.frame_length`. The incoming audio
needs to have a sample rate equal to `.sample_rate` and be 16-bit linearly-encoded. Rhino operates on single-channel
audio.
Definition at line 66 of file rhino.py.
def python.rhino.Rhino.__init__ |
( |
|
self, |
|
|
|
access_key, |
|
|
|
library_path, |
|
|
|
model_path, |
|
|
|
context_path, |
|
|
|
sensitivity = 0.5 , |
|
|
|
require_endpoint = True |
|
) |
| |
Constructor.
:param access_key: AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
:param library_path: Absolute path to Rhino's dynamic library.
:param model_path: Absolute path to file containing model parameters.
:param context_path: Absolute path to file containing context parameters. A context represents the set of
expressions (spoken commands), intents, and intent arguments (slots) within a domain of interest.
:param sensitivity: Inference sensitivity. It should be a number within [0, 1]. A higher sensitivity value
results in fewer misses at the cost of (potentially) increasing the erroneous inference rate.
:param require_endpoint If set to `False`, Rhino does not require an endpoint (chunk of silence) before
finishing inference.
Definition at line 116 of file rhino.py.
def python.rhino.Rhino.get_inference |
( |
|
self | ) |
|
Gets inference results from Rhino. If the spoken command was understood, it includes the specific intent name
that was inferred, and (if applicable) slot keys and specific slot values. Should only be called after the
process function returns true, otherwise Rhino has not yet reached an inference conclusion.
:return Inference object with `.is_understood`, `.intent` , and `.slots` getters.
Definition at line 245 of file rhino.py.