Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
37e98df7
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看板
提交
37e98df7
编写于
7月 04, 2017
作者:
Y
Yibing Liu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enable resetting params in scorer
上级
90d83bf7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
3 deletion
+12
-3
lm/lm_scorer.py
lm/lm_scorer.py
+5
-0
tests/test_decoders.py
tests/test_decoders.py
+1
-1
tune.py
tune.py
+6
-2
未找到文件。
lm/lm_scorer.py
浏览文件 @
37e98df7
...
...
@@ -42,6 +42,11 @@ class LmScorer(object):
words
=
sentence
.
strip
().
split
(
' '
)
return
len
(
words
)
# reset alpha and beta
def
reset_params
(
self
,
alpha
,
beta
):
self
.
_alpha
=
alpha
self
.
_beta
=
beta
# execute evaluation
def
__call__
(
self
,
sentence
,
log
=
False
):
"""Evaluation function, gathering all the different scores
...
...
tests/test_decoders.py
浏览文件 @
37e98df7
...
...
@@ -76,7 +76,7 @@ class TestDecoders(unittest.TestCase):
blank_id
=
len
(
self
.
vocab_list
))
self
.
assertEqual
(
beam_result
[
0
][
1
],
self
.
beam_search_result
[
1
])
def
test_beam_search_
nproc_decoder
(
self
):
def
test_beam_search_
decoder_batch
(
self
):
beam_results
=
ctc_beam_search_decoder_batch
(
probs_split
=
[
self
.
probs_seq1
,
self
.
probs_seq2
],
beam_size
=
self
.
beam_size
,
...
...
tune.py
浏览文件 @
37e98df7
...
...
@@ -12,6 +12,7 @@ from model import deep_speech2
from
decoder
import
*
from
lm.lm_scorer
import
LmScorer
from
error_rate
import
wer
import
utils
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
parser
.
add_argument
(
...
...
@@ -180,10 +181,13 @@ def tune():
params_grid
=
[(
alpha
,
beta
)
for
alpha
in
cand_alphas
for
beta
in
cand_betas
]
ext_scorer
=
LmScorer
(
args
.
alpha_from
,
args
.
beta_from
,
args
.
language_model_path
)
## tune parameters in loop
for
(
alpha
,
beta
)
in
params_grid
:
for
alpha
,
beta
in
params_grid
:
wer_sum
,
wer_counter
=
0
,
0
ext_scorer
=
LmScorer
(
alpha
,
beta
,
args
.
language_model_path
)
# reset scorer
ext_scorer
.
reset_params
(
alpha
,
beta
)
# beam search using multiple processes
beam_search_results
=
ctc_beam_search_decoder_batch
(
probs_split
=
probs_split
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录