Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
02c7ef31
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,发现更多精彩内容 >>
提交
02c7ef31
编写于
11月 22, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format data support multi output
上级
f89f99fe
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
4 deletion
+14
-4
examples/ted_en_zh/t0/run.sh
examples/ted_en_zh/t0/run.sh
+2
-1
utils/format_data.py
utils/format_data.py
+12
-3
未找到文件。
examples/ted_en_zh/t0/run.sh
浏览文件 @
02c7ef31
...
...
@@ -2,6 +2,7 @@
set
-e
source
path.sh
gpus
=
0,1,2,3
stage
=
0
stop_stage
=
100
conf_path
=
conf/transformer_joint_noam.yaml
...
...
@@ -21,7 +22,7 @@ fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
0,1,2,3,4,5,6,7 ./local/train.sh
${
conf_path
}
${
ckpt
}
CUDA_VISIBLE_DEVICES
=
${
gpus
}
./local/train.sh
${
conf_path
}
${
ckpt
}
fi
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
...
...
utils/format_data.py
浏览文件 @
02c7ef31
...
...
@@ -87,15 +87,24 @@ def main():
tokens
=
text_feature
.
tokenize
(
line
)
tokenids
=
text_feature
.
featurize
(
line
)
output_json
[
'output'
].
append
({
'name'
:
't
ra
get1'
,
'name'
:
't
ar
get1'
,
'shape'
:
(
len
(
tokenids
),
vocab_size
),
'text'
:
line
,
'token'
:
' '
.
join
(
tokens
),
'tokenid'
:
' '
.
join
(
map
(
str
,
tokenids
)),
})
else
:
# isinstance(line, list), multi target
raise
NotImplementedError
(
"not support multi output now!"
)
# isinstance(line, list), multi target in one vocab
for
i
,
item
in
enumerate
(
line
,
1
):
tokens
=
text_feature
.
tokenize
(
item
)
tokenids
=
text_feature
.
featurize
(
item
)
output_json
[
'output'
].
append
({
'name'
:
f
'target
{
i
}
'
,
'shape'
:
(
len
(
tokenids
),
vocab_size
),
'text'
:
item
,
'token'
:
' '
.
join
(
tokens
),
'tokenid'
:
' '
.
join
(
map
(
str
,
tokenids
)),
})
# input
line
=
line_json
[
'feat'
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录