Expose dither in python API (#2127)
This commit is contained in:
committed by
GitHub
parent
f3d23aa170
commit
84ed5d4288
@@ -49,6 +49,7 @@ class OfflineRecognizer(object):
|
|||||||
num_threads: int = 1,
|
num_threads: int = 1,
|
||||||
sample_rate: int = 16000,
|
sample_rate: int = 16000,
|
||||||
feature_dim: int = 80,
|
feature_dim: int = 80,
|
||||||
|
dither: float = 0.0,
|
||||||
decoding_method: str = "greedy_search",
|
decoding_method: str = "greedy_search",
|
||||||
max_active_paths: int = 4,
|
max_active_paths: int = 4,
|
||||||
hotwords_file: str = "",
|
hotwords_file: str = "",
|
||||||
@@ -89,6 +90,11 @@ class OfflineRecognizer(object):
|
|||||||
Sample rate of the training data used to train the model.
|
Sample rate of the training data used to train the model.
|
||||||
feature_dim:
|
feature_dim:
|
||||||
Dimension of the feature used to train the model.
|
Dimension of the feature used to train the model.
|
||||||
|
dither:
|
||||||
|
Dithering constant (0.0 means no dither).
|
||||||
|
By default the audio samples are in range [-1,+1],
|
||||||
|
so dithering constant 0.00003 is a good value,
|
||||||
|
equivalent to the default 1.0 from kaldi
|
||||||
decoding_method:
|
decoding_method:
|
||||||
Valid values: greedy_search, modified_beam_search.
|
Valid values: greedy_search, modified_beam_search.
|
||||||
max_active_paths:
|
max_active_paths:
|
||||||
@@ -142,6 +148,7 @@ class OfflineRecognizer(object):
|
|||||||
feat_config = FeatureExtractorConfig(
|
feat_config = FeatureExtractorConfig(
|
||||||
sampling_rate=sample_rate,
|
sampling_rate=sample_rate,
|
||||||
feature_dim=feature_dim,
|
feature_dim=feature_dim,
|
||||||
|
dither=dither,
|
||||||
)
|
)
|
||||||
|
|
||||||
if len(hotwords_file) > 0 and decoding_method != "modified_beam_search":
|
if len(hotwords_file) > 0 and decoding_method != "modified_beam_search":
|
||||||
|
|||||||
Reference in New Issue
Block a user