From 466a6855c860c5a329a637741c4e023e65466667 Mon Sep 17 00:00:00 2001 From: chiiyeh <32455760+chiiyeh@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:54:20 +0800 Subject: [PATCH] add hotwords docstring to offline_recognizer and online_recognizer (#546) --- sherpa-onnx/python/sherpa_onnx/offline_recognizer.py | 6 ++++++ sherpa-onnx/python/sherpa_onnx/online_recognizer.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sherpa-onnx/python/sherpa_onnx/offline_recognizer.py b/sherpa-onnx/python/sherpa_onnx/offline_recognizer.py index 6a2142979..3ac80f8a4 100644 --- a/sherpa-onnx/python/sherpa_onnx/offline_recognizer.py +++ b/sherpa-onnx/python/sherpa_onnx/offline_recognizer.py @@ -82,6 +82,12 @@ def from_transducer( max_active_paths: Maximum number of active paths to keep. Used only when decoding_method is modified_beam_search. + hotwords_file: + The file containing hotwords, one words/phrases per line, and for each + phrase the bpe/cjkchar are separated by a space. + hotwords_score: + The hotword score of each token for biasing word/phrase. Used only if + hotwords_file is given with modified_beam_search as decoding method. blank_penalty: The penalty applied on blank symbol during decoding. debug: diff --git a/sherpa-onnx/python/sherpa_onnx/online_recognizer.py b/sherpa-onnx/python/sherpa_onnx/online_recognizer.py index 6af47e11f..a9f9e7d59 100644 --- a/sherpa-onnx/python/sherpa_onnx/online_recognizer.py +++ b/sherpa-onnx/python/sherpa_onnx/online_recognizer.py @@ -100,6 +100,12 @@ def from_transducer( max_active_paths: Use only when decoding_method is modified_beam_search. It specifies the maximum number of active paths during beam search. + hotwords_file: + The file containing hotwords, one words/phrases per line, and for each + phrase the bpe/cjkchar are separated by a space. + hotwords_score: + The hotword score of each token for biasing word/phrase. Used only if + hotwords_file is given with modified_beam_search as decoding method. provider: onnxruntime execution providers. Valid values are: cpu, cuda, coreml. model_type: