Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Nickolay V. Shmyrev
2025-04-17 11:47:48 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2025-04-17 16:47:48 +0800
Commit
84ed5d428890c00df7d7431e0c51e50bed05b754
84ed5d42
1 parent
f3d23aa1
Expose dither in python API (#2127)
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
7 行增加
和
0 行删除
sherpa-onnx/python/sherpa_onnx/offline_recognizer.py
sherpa-onnx/python/sherpa_onnx/offline_recognizer.py
查看文件 @
84ed5d4
...
...
@@ -49,6 +49,7 @@ class OfflineRecognizer(object):
num_threads
:
int
=
1
,
sample_rate
:
int
=
16000
,
feature_dim
:
int
=
80
,
dither
:
float
=
0.0
,
decoding_method
:
str
=
"greedy_search"
,
max_active_paths
:
int
=
4
,
hotwords_file
:
str
=
""
,
...
...
@@ -89,6 +90,11 @@ class OfflineRecognizer(object):
Sample rate of the training data used to train the model.
feature_dim:
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:
Valid values: greedy_search, modified_beam_search.
max_active_paths:
...
...
@@ -142,6 +148,7 @@ class OfflineRecognizer(object):
feat_config
=
FeatureExtractorConfig
(
sampling_rate
=
sample_rate
,
feature_dim
=
feature_dim
,
dither
=
dither
,
)
if
len
(
hotwords_file
)
>
0
and
decoding_method
!=
"modified_beam_search"
:
...
...
请
注册
或
登录
后发表评论