Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
05f36d8f
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
05f36d8f
编写于
3月 29, 2018
作者:
Y
Yibing Liu
提交者:
GitHub
3月 29, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #792 from kuke/expose_acoustic_scale
Expose acoustic scale in decoder
上级
bf380657
4a8e399f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
4 deletion
+18
-4
fluid/DeepASR/data_utils/util.py
fluid/DeepASR/data_utils/util.py
+7
-0
fluid/DeepASR/decoder/post_decode_faster.cc
fluid/DeepASR/decoder/post_decode_faster.cc
+3
-2
fluid/DeepASR/decoder/post_decode_faster.h
fluid/DeepASR/decoder/post_decode_faster.h
+2
-1
fluid/DeepASR/decoder/pybind.cc
fluid/DeepASR/decoder/pybind.cc
+1
-1
fluid/DeepASR/infer_by_ckpt.py
fluid/DeepASR/infer_by_ckpt.py
+5
-0
未找到文件。
fluid/DeepASR/data_utils/util.py
浏览文件 @
05f36d8f
...
...
@@ -35,6 +35,13 @@ def lodtensor_to_ndarray(lod_tensor):
return
ret
,
lod_tensor
.
lod
()
def
split_infer_result
(
infer_seq
,
lod
):
infer_batch
=
[]
for
i
in
xrange
(
0
,
len
(
lod
[
0
])
-
1
):
infer_batch
.
append
(
infer_seq
[
lod
[
0
][
i
]:
lod
[
0
][
i
+
1
]])
return
infer_batch
class
CriticalException
(
Exception
):
pass
...
...
fluid/DeepASR/decoder/post_decode_faster.cc
浏览文件 @
05f36d8f
...
...
@@ -21,14 +21,15 @@ using fst::StdArc;
Decoder
::
Decoder
(
std
::
string
word_syms_filename
,
std
::
string
fst_in_filename
,
std
::
string
logprior_rxfilename
)
{
std
::
string
logprior_rxfilename
,
kaldi
::
BaseFloat
acoustic_scale
)
{
const
char
*
usage
=
"Decode, reading log-likelihoods (of transition-ids or whatever symbol "
"is on the graph) as matrices."
;
kaldi
::
ParseOptions
po
(
usage
);
binary
=
true
;
acoustic_scale
=
1.5
;
this
->
acoustic_scale
=
acoustic_scale
;
allow_partial
=
true
;
kaldi
::
FasterDecoderOptions
decoder_opts
;
decoder_opts
.
Register
(
&
po
,
true
);
// true == include obscure settings.
...
...
fluid/DeepASR/decoder/post_decode_faster.h
浏览文件 @
05f36d8f
...
...
@@ -29,7 +29,8 @@ class Decoder {
public:
Decoder
(
std
::
string
word_syms_filename
,
std
::
string
fst_in_filename
,
std
::
string
logprior_rxfilename
);
std
::
string
logprior_rxfilename
,
kaldi
::
BaseFloat
acoustic_scale
);
~
Decoder
();
// Interface to accept the scores read from specifier and return
...
...
fluid/DeepASR/decoder/pybind.cc
浏览文件 @
05f36d8f
...
...
@@ -23,7 +23,7 @@ PYBIND11_MODULE(post_decode_faster, m) {
m
.
doc
()
=
"Decoder for Deep ASR model"
;
py
::
class_
<
Decoder
>
(
m
,
"Decoder"
)
.
def
(
py
::
init
<
std
::
string
,
std
::
string
,
std
::
string
>
())
.
def
(
py
::
init
<
std
::
string
,
std
::
string
,
std
::
string
,
kaldi
::
BaseFloat
>
())
.
def
(
"decode"
,
(
std
::
vector
<
std
::
string
>
(
Decoder
::*
)(
std
::
string
))
&
Decoder
::
decode
,
...
...
fluid/DeepASR/infer_by_ckpt.py
浏览文件 @
05f36d8f
...
...
@@ -106,6 +106,11 @@ def parse_args():
type
=
str
,
default
=
"./decoder/logprior"
,
help
=
"The log prior probs for training data. (default: %(default)s)"
)
parser
.
add_argument
(
'--acoustic_scale'
,
type
=
float
,
default
=
0.2
,
help
=
"Scaling factor for acoustic likelihoods. (default: %(default)f)"
)
args
=
parser
.
parse_args
()
return
args
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录