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
Parth Khiera
2024-08-08 06:40:17 +0530
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-08-08 09:10:17 +0800
Commit
ba4cb6169f29efa24c7eef7c3c17897c393c67b3
ba4cb616
1 parent
8a5f5c19
feat: addition of blank_penalty config in online_recognizer (#1232)
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
8 行增加
和
0 行删除
scripts/go/sherpa_onnx.go
sherpa-onnx/c-api/c-api.cc
sherpa-onnx/c-api/c-api.h
scripts/go/sherpa_onnx.go
查看文件 @
ba4cb61
...
...
@@ -129,6 +129,7 @@ type OnlineRecognizerConfig struct {
Rule3MinUtteranceLength
float32
HotwordsFile
string
HotwordsScore
float32
BlankPenalty
float32
CtcFstDecoderConfig
OnlineCtcFstDecoderConfig
RuleFsts
string
RuleFars
string
...
...
@@ -212,6 +213,7 @@ func NewOnlineRecognizer(config *OnlineRecognizerConfig) *OnlineRecognizer {
defer
C
.
free
(
unsafe
.
Pointer
(
c
.
hotwords_file
))
c
.
hotwords_score
=
C
.
float
(
config
.
HotwordsScore
)
c
.
blank_penalty
=
C
.
float
(
config
.
BlankPenalty
)
c
.
rule_fsts
=
C
.
CString
(
config
.
RuleFsts
)
defer
C
.
free
(
unsafe
.
Pointer
(
c
.
rule_fsts
))
...
...
@@ -421,6 +423,7 @@ type OfflineRecognizerConfig struct {
MaxActivePaths
int
HotwordsFile
string
HotwordsScore
float32
BlankPenalty
float32
RuleFsts
string
RuleFars
string
}
...
...
@@ -530,6 +533,8 @@ func NewOfflineRecognizer(config *OfflineRecognizerConfig) *OfflineRecognizer {
c
.
hotwords_score
=
C
.
float
(
config
.
HotwordsScore
)
c
.
blank_penalty
=
C
.
float
(
config
.
BlankPenalty
)
c
.
rule_fsts
=
C
.
CString
(
config
.
RuleFsts
)
defer
C
.
free
(
unsafe
.
Pointer
(
c
.
rule_fsts
))
...
...
sherpa-onnx/c-api/c-api.cc
查看文件 @
ba4cb61
...
...
@@ -105,6 +105,8 @@ SherpaOnnxOnlineRecognizer *SherpaOnnxCreateOnlineRecognizer(
recognizer_config
.
hotwords_score
=
SHERPA_ONNX_OR
(
config
->
hotwords_score
,
1.5
);
recognizer_config
.
blank_penalty
=
SHERPA_ONNX_OR
(
config
->
blank_penalty
,
0.0
);
recognizer_config
.
ctc_fst_decoder_config
.
graph
=
SHERPA_ONNX_OR
(
config
->
ctc_fst_decoder_config
.
graph
,
""
);
recognizer_config
.
ctc_fst_decoder_config
.
max_active
=
...
...
sherpa-onnx/c-api/c-api.h
查看文件 @
ba4cb61
...
...
@@ -142,6 +142,7 @@ SHERPA_ONNX_API typedef struct SherpaOnnxOnlineRecognizerConfig {
/// Bonus score for each token in hotwords.
float
hotwords_score
;
float
blank_penalty
;
SherpaOnnxOnlineCtcFstDecoderConfig
ctc_fst_decoder_config
;
const
char
*
rule_fsts
;
...
...
请
注册
或
登录
后发表评论