Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
b5317169
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b5317169
编写于
10月 22, 2021
作者:
H
huangyuxin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
releace the <space> with ' ' in ctcdecoder
上级
b1a90d4d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
5 addition
and
11 deletion
+5
-11
deepspeech/decoders/ctcdecoder/swig/ctc_greedy_decoder.cpp
deepspeech/decoders/ctcdecoder/swig/ctc_greedy_decoder.cpp
+2
-1
deepspeech/decoders/ctcdecoder/swig/decoder_utils.cpp
deepspeech/decoders/ctcdecoder/swig/decoder_utils.cpp
+2
-1
deepspeech/decoders/ctcdecoder/swig/decoder_utils.h
deepspeech/decoders/ctcdecoder/swig/decoder_utils.h
+1
-0
deepspeech/exps/deepspeech2/bin/test_hub.py
deepspeech/exps/deepspeech2/bin/test_hub.py
+0
-4
deepspeech/exps/deepspeech2/model.py
deepspeech/exps/deepspeech2/model.py
+0
-5
未找到文件。
deepspeech/decoders/ctcdecoder/swig/ctc_greedy_decoder.cpp
浏览文件 @
b5317169
...
@@ -53,7 +53,8 @@ std::string ctc_greedy_decoder(
...
@@ -53,7 +53,8 @@ std::string ctc_greedy_decoder(
std
::
string
best_path_result
;
std
::
string
best_path_result
;
for
(
size_t
i
=
0
;
i
<
idx_vec
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
idx_vec
.
size
();
++
i
)
{
if
(
idx_vec
[
i
]
!=
blank_id
)
{
if
(
idx_vec
[
i
]
!=
blank_id
)
{
best_path_result
+=
vocabulary
[
idx_vec
[
i
]];
std
::
string
ch
=
vocabulary
[
idx_vec
[
i
]];
best_path_result
+=
(
ch
==
kSPACE
)
?
tSPACE
:
ch
;
}
}
}
}
return
best_path_result
;
return
best_path_result
;
...
...
deepspeech/decoders/ctcdecoder/swig/decoder_utils.cpp
浏览文件 @
b5317169
...
@@ -74,7 +74,8 @@ std::vector<std::pair<double, std::string>> get_beam_search_result(
...
@@ -74,7 +74,8 @@ std::vector<std::pair<double, std::string>> get_beam_search_result(
// convert index to string
// convert index to string
std
::
string
output_str
;
std
::
string
output_str
;
for
(
size_t
j
=
0
;
j
<
output
.
size
();
j
++
)
{
for
(
size_t
j
=
0
;
j
<
output
.
size
();
j
++
)
{
output_str
+=
vocabulary
[
output
[
j
]];
std
::
string
ch
=
vocabulary
[
output
[
j
]];
output_str
+=
(
ch
==
kSPACE
)
?
tSPACE
:
ch
;
}
}
std
::
pair
<
double
,
std
::
string
>
output_pair
(
std
::
pair
<
double
,
std
::
string
>
output_pair
(
-
space_prefixes
[
i
]
->
approx_ctc
,
output_str
);
-
space_prefixes
[
i
]
->
approx_ctc
,
output_str
);
...
...
deepspeech/decoders/ctcdecoder/swig/decoder_utils.h
浏览文件 @
b5317169
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "path_trie.h"
#include "path_trie.h"
const
std
::
string
kSPACE
=
"<space>"
;
const
std
::
string
kSPACE
=
"<space>"
;
const
std
::
string
tSPACE
=
" "
;
const
float
NUM_FLT_INF
=
std
::
numeric_limits
<
float
>::
max
();
const
float
NUM_FLT_INF
=
std
::
numeric_limits
<
float
>::
max
();
const
float
NUM_FLT_MIN
=
std
::
numeric_limits
<
float
>::
min
();
const
float
NUM_FLT_MIN
=
std
::
numeric_limits
<
float
>::
min
();
...
...
deepspeech/exps/deepspeech2/bin/test_hub.py
浏览文件 @
b5317169
...
@@ -56,10 +56,6 @@ class DeepSpeech2Tester_hub():
...
@@ -56,10 +56,6 @@ class DeepSpeech2Tester_hub():
cutoff_prob
=
cfg
.
cutoff_prob
,
cutoff_prob
=
cfg
.
cutoff_prob
,
cutoff_top_n
=
cfg
.
cutoff_top_n
,
cutoff_top_n
=
cfg
.
cutoff_top_n
,
num_processes
=
cfg
.
num_proc_bsearch
)
num_processes
=
cfg
.
num_proc_bsearch
)
#replace the '<space>' with ' '
result_transcripts
=
[
sentence
.
replace
(
"<space>"
,
" "
)
for
sentence
in
result_transcripts
]
return
result_transcripts
return
result_transcripts
...
...
deepspeech/exps/deepspeech2/model.py
浏览文件 @
b5317169
...
@@ -341,11 +341,6 @@ class DeepSpeech2Tester(DeepSpeech2Trainer):
...
@@ -341,11 +341,6 @@ class DeepSpeech2Tester(DeepSpeech2Trainer):
cutoff_prob
=
cfg
.
cutoff_prob
,
cutoff_prob
=
cfg
.
cutoff_prob
,
cutoff_top_n
=
cfg
.
cutoff_top_n
,
cutoff_top_n
=
cfg
.
cutoff_top_n
,
num_processes
=
cfg
.
num_proc_bsearch
)
num_processes
=
cfg
.
num_proc_bsearch
)
#replace the <space> with ' '
result_transcripts
=
[
self
.
_text_featurizer
.
detokenize
(
sentence
)
for
sentence
in
result_transcripts
]
self
.
autolog
.
times
.
stamp
()
self
.
autolog
.
times
.
stamp
()
self
.
autolog
.
times
.
stamp
()
self
.
autolog
.
times
.
stamp
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录