Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
46645285
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
11 个月 前同步成功
通知
203
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,发现更多精彩内容 >>
未验证
提交
46645285
编写于
5月 20, 2022
作者:
H
Hui Zhang
提交者:
GitHub
5月 20, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1931 from Jackwaterveg/cli_2
[CLI] add calc CER in cli
上级
be8d0fdd
c9dc388c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
2 deletion
+20
-2
tests/unit/cli/aishell_test_prepare.py
tests/unit/cli/aishell_test_prepare.py
+6
-0
tests/unit/cli/calc_RTF_CER_by_aishell.sh
tests/unit/cli/calc_RTF_CER_by_aishell.sh
+13
-2
tests/unit/cli/utils
tests/unit/cli/utils
+1
-0
未找到文件。
tests/unit/cli/aishell_test_prepare.py
浏览文件 @
46645285
...
...
@@ -55,6 +55,7 @@ args = parser.parse_args()
def
create_manifest
(
data_dir
,
manifest_path_prefix
):
print
(
"Creating manifest %s ..."
%
manifest_path_prefix
)
json_lines
=
[]
reference_lines
=
[]
transcript_path
=
os
.
path
.
join
(
data_dir
,
'transcript'
,
'aishell_transcript_v0.8.txt'
)
transcript_dict
=
{}
...
...
@@ -88,6 +89,7 @@ def create_manifest(data_dir, manifest_path_prefix):
duration
=
float
(
len
(
audio_data
)
/
samplerate
)
text
=
transcript_dict
[
audio_id
]
json_lines
.
append
(
audio_path
)
reference_lines
.
append
(
str
(
total_num
+
1
)
+
"
\t
"
+
text
)
total_sec
+=
duration
total_text
+=
len
(
text
)
...
...
@@ -98,6 +100,10 @@ def create_manifest(data_dir, manifest_path_prefix):
for
line
in
json_lines
:
fout
.
write
(
line
+
'
\n
'
)
with
codecs
.
open
(
manifest_path
+
".text"
,
'w'
,
'utf-8'
)
as
fout
:
for
line
in
reference_lines
:
fout
.
write
(
line
+
'
\n
'
)
manifest_dir
=
os
.
path
.
dirname
(
manifest_path_prefix
)
def
prepare_dataset
(
url
,
md5sum
,
target_dir
,
manifest_path
=
None
):
...
...
tests/unit/cli/calc_
rtf
_by_aishell.sh
→
tests/unit/cli/calc_
RTF_CER
_by_aishell.sh
浏览文件 @
46645285
...
...
@@ -3,6 +3,10 @@
source
path.sh
stage
=
-1
stop_stage
=
100
model_name
=
conformer_online_aishell
gpus
=
5
log_file
=
res.log
res_file
=
res.rsl
MAIN_ROOT
=
../../..
.
${
MAIN_ROOT
}
/utils/parse_options.sh
||
exit
-1
;
...
...
@@ -20,9 +24,16 @@ if [ ${stage} -le -1 ] && [ ${stop_stage} -ge -1 ]; then
echo
"Prepare Aishell failed. Terminated."
exit
1
fi
fi
if
[
${
stage
}
-le
0
]
&&
[
${
stop_stage
}
-ge
0
]
;
then
cat
data/manifest.test | paddlespeech asr
--model
conformer_online_aishell
--device
gpu
--decode_method
ctc_prefix_beam_search
--rtf
-v
export
CUDA_VISIBLE_DEVICES
=
${
gpus
}
cat
data/manifest.test | paddlespeech asr
--model
${
model_name
}
--device
gpu
--decode_method
attention_rescoring
--rtf
-v
&>
${
log_file
}
fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
cat
${
log_file
}
|
grep
"^[0-9]"
>
${
res_file
}
python utils/compute-wer.py
--char
=
1
--v
=
1
\
data/manifest.test.text
${
res_file
}
>
${
res_file
}
.error
fi
tests/unit/cli/utils
0 → 120000
浏览文件 @
46645285
../../../utils
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录