Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
5e8e46ed
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 1 年 前同步成功
通知
206
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
5e8e46ed
编写于
8月 04, 2021
作者:
H
Hui Zhang
提交者:
GitHub
8月 04, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #747 from LittleChenCc/develop
refine the code and correct yaml
上级
566f636c
45e71a0a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
10 deletion
+14
-10
deepspeech/io/collator_st.py
deepspeech/io/collator_st.py
+1
-1
deepspeech/utils/bleu_score.py
deepspeech/utils/bleu_score.py
+5
-3
examples/dataset/ted_en_zh/ted_en_zh.py
examples/dataset/ted_en_zh/ted_en_zh.py
+6
-4
examples/ted_en_zh/conf/transformer_joint_noam.yaml
examples/ted_en_zh/conf/transformer_joint_noam.yaml
+2
-2
未找到文件。
deepspeech/io/collator_st.py
浏览文件 @
5e8e46ed
...
...
@@ -563,7 +563,7 @@ class KaldiPrePorocessedCollator(SpeechCollator):
@
property
def
feature_size
(
self
):
return
self
.
_feat_dim
@
property
def
stride_ms
(
self
):
return
self
.
_stride_ms
...
...
deepspeech/utils/bleu_score.py
浏览文件 @
5e8e46ed
...
...
@@ -35,6 +35,7 @@ def bleu(hypothesis, reference):
return
sacrebleu
.
corpus_bleu
(
hypothesis
,
reference
)
def
char_bleu
(
hypothesis
,
reference
):
"""Calculate BLEU. BLEU compares reference text and
hypothesis text in char-level using scarebleu.
...
...
@@ -47,7 +48,8 @@ def char_bleu(hypothesis, reference):
:type hypothesis: list[str]
:raises ValueError: If the reference number is zero.
"""
hypothesis
=
[
' '
.
join
(
list
(
hyp
.
replace
(
' '
,
''
)))
for
hyp
in
hypothesis
]
reference
=
[[
' '
.
join
(
list
(
ref_i
.
replace
(
' '
,
''
)))
for
ref_i
in
ref
]
for
ref
in
reference
]
hypothesis
=
[
' '
.
join
(
list
(
hyp
.
replace
(
' '
,
''
)))
for
hyp
in
hypothesis
]
reference
=
[[
' '
.
join
(
list
(
ref_i
.
replace
(
' '
,
''
)))
for
ref_i
in
ref
]
for
ref
in
reference
]
return
sacrebleu
.
corpus_bleu
(
hypothesis
,
reference
)
\ No newline at end of file
return
sacrebleu
.
corpus_bleu
(
hypothesis
,
reference
)
examples/dataset/ted_en_zh/ted_en_zh.py
浏览文件 @
5e8e46ed
...
...
@@ -44,9 +44,11 @@ def create_manifest(data_dir, manifest_path_prefix):
print
(
"Creating manifest %s ..."
%
manifest_path_prefix
)
json_lines
=
[]
data_types_infos
=
[(
'train'
,
'train-split/train-segment'
,
'En-Zh/train.en-zh'
),
(
'dev'
,
'test-segment/tst2010'
,
'En-Zh/tst2010.en-zh'
),
(
'test'
,
'test-segment/tst2015'
,
'En-Zh/tst2015.en-zh'
)]
data_types_infos
=
[
(
'train'
,
'train-split/train-segment'
,
'En-Zh/train.en-zh'
),
(
'dev'
,
'test-segment/tst2010'
,
'En-Zh/tst2010.en-zh'
),
(
'test'
,
'test-segment/tst2015'
,
'En-Zh/tst2015.en-zh'
)
]
for
data_info
in
data_types_infos
:
dtype
,
audio_relative_dir
,
text_relative_path
=
data_info
del
json_lines
[:]
...
...
@@ -63,7 +65,7 @@ def create_manifest(data_dir, manifest_path_prefix):
continue
audio_id
,
trancription
,
translation
=
line
.
split
(
'
\t
'
)
utt
=
audio_id
.
split
(
'.'
)[
0
]
audio_path
=
os
.
path
.
join
(
audio_dir
,
audio_id
)
if
os
.
path
.
exists
(
audio_path
):
if
os
.
path
.
getsize
(
audio_path
)
<
30000
:
...
...
examples/ted_en_zh/conf/transformer_joint_noam.yaml
浏览文件 @
5e8e46ed
...
...
@@ -3,8 +3,8 @@ data:
train_manifest
:
data/manifest.train
dev_manifest
:
data/manifest.dev
test_manifest
:
data/manifest.test
min_input_len
:
0.5
# second
max_input_len
:
30
00
.0
# second
min_input_len
:
0.
0
5
# second
max_input_len
:
30.0
# second
min_output_len
:
0.0
# tokens
max_output_len
:
400.0
# tokens
min_output_input_ratio
:
0.01
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录