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
zr_jin
2023-09-21 20:32:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-09-21 20:32:13 +0800
Commit
b640c295b9b452e5354586d29dd6207858bba5b3
b640c295
1 parent
532ed142
Swift API for hotwords support (#331)
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
12 行增加
和
4 行删除
swift-api-examples/SherpaOnnx.swift
swift-api-examples/SherpaOnnx.swift
查看文件 @
b640c29
...
...
@@ -108,7 +108,9 @@ func sherpaOnnxOnlineRecognizerConfig(
rule2MinTrailingSilence
:
Float
=
1.2
,
rule3MinUtteranceLength
:
Float
=
30
,
decodingMethod
:
String
=
"greedy_search"
,
maxActivePaths
:
Int
=
4
maxActivePaths
:
Int
=
4
,
hotwordsFile
:
String
=
""
,
hotwordsScore
:
Float
=
1.5
)
->
SherpaOnnxOnlineRecognizerConfig
{
return
SherpaOnnxOnlineRecognizerConfig
(
feat_config
:
featConfig
,
...
...
@@ -118,7 +120,9 @@ func sherpaOnnxOnlineRecognizerConfig(
enable_endpoint
:
enableEndpoint
?
1
:
0
,
rule1_min_trailing_silence
:
rule1MinTrailingSilence
,
rule2_min_trailing_silence
:
rule2MinTrailingSilence
,
rule3_min_utterance_length
:
rule3MinUtteranceLength
)
rule3_min_utterance_length
:
rule3MinUtteranceLength
,
hotwords_file
:
toCPointer
(
hotwordsFile
),
hotwords_score
:
hotwordsScore
)
}
/// Wrapper for recognition result.
...
...
@@ -327,14 +331,18 @@ func sherpaOnnxOfflineRecognizerConfig(
modelConfig
:
SherpaOnnxOfflineModelConfig
,
lmConfig
:
SherpaOnnxOfflineLMConfig
=
sherpaOnnxOfflineLMConfig
(),
decodingMethod
:
String
=
"greedy_search"
,
maxActivePaths
:
Int
=
4
maxActivePaths
:
Int
=
4
,
hotwordsFile
:
String
=
""
,
hotwordsScore
:
Float
=
1.5
)
->
SherpaOnnxOfflineRecognizerConfig
{
return
SherpaOnnxOfflineRecognizerConfig
(
feat_config
:
featConfig
,
model_config
:
modelConfig
,
lm_config
:
lmConfig
,
decoding_method
:
toCPointer
(
decodingMethod
),
max_active_paths
:
Int32
(
maxActivePaths
)
max_active_paths
:
Int32
(
maxActivePaths
),
hotwords_file
:
toCPointer
(
hotwordsFile
),
hotwords_score
:
hotwordsScore
)
}
...
...
请
注册
或
登录
后发表评论