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
Fangjun Kuang
2023-05-23 15:57:33 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2023-05-23 15:57:33 +0800
Commit
d7114da4410d7cf9d76b3215bc214246d577e782
d7114da4
1 parent
44821ae2
Minor fixes (#161)
显示空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
8 行增加
和
6 行删除
sherpa-onnx/csrc/offline-stream.cc
sherpa-onnx/csrc/online-recognizer.h
sherpa-onnx/csrc/offline-stream.cc
查看文件 @
d7114da
...
...
@@ -219,19 +219,21 @@ std::string OfflineRecognitionResult::AsJsonString() const {
nlohmann
::
json
j
;
j
[
"text"
]
=
text
;
j
[
"tokens"
]
=
tokens
;
#if 1
// This branch chooses number of decimal points to keep in
// the return json string
std
::
ostringstream
os
;
os
<<
"["
;
std
::
string
sep
=
""
;
for
(
auto
t
:
timestamps
)
{
os
<<
sep
<<
std
::
fixed
<<
std
::
setprecision
(
2
)
<<
t
;
sep
=
","
;
sep
=
",
"
;
}
os
<<
"]"
;
// NOTE: We don't use j["timestamps"] = timestamps;
// because we need to control the number of decimal points to keep
j
[
"timestamps"
]
=
os
.
str
();
#else
j
[
"timestamps"
]
=
timestamps
;
#endif
return
j
.
dump
();
}
...
...
sherpa-onnx/csrc/online-recognizer.h
查看文件 @
d7114da
...
...
@@ -72,7 +72,7 @@ struct OnlineRecognizerConfig {
EndpointConfig
endpoint_config
;
bool
enable_endpoint
=
true
;
std
::
string
decoding_method
=
"
modified_beam
_search"
;
std
::
string
decoding_method
=
"
greedy
_search"
;
// now support modified_beam_search and greedy_search
int32_t
max_active_paths
=
4
;
// used only for modified_beam_search
...
...
请
注册
或
登录
后发表评论