Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
a7858551
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,发现更多精彩内容 >>
提交
a7858551
编写于
11月 19, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add utt2spk for all dataset
上级
b9790d03
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
27 addition
and
9 deletion
+27
-9
examples/dataset/aidatatang_200zh/aidatatang_200zh.py
examples/dataset/aidatatang_200zh/aidatatang_200zh.py
+3
-0
examples/dataset/mini_librispeech/mini_librispeech.py
examples/dataset/mini_librispeech/mini_librispeech.py
+7
-6
examples/dataset/thchs30/thchs30.py
examples/dataset/thchs30/thchs30.py
+3
-0
examples/dataset/timit/timit.py
examples/dataset/timit/timit.py
+2
-2
examples/dataset/timit/timit_kaldi_standard_split.py
examples/dataset/timit/timit_kaldi_standard_split.py
+8
-0
examples/dataset/voxforge/voxforge.py
examples/dataset/voxforge/voxforge.py
+4
-1
未找到文件。
examples/dataset/aidatatang_200zh/aidatatang_200zh.py
浏览文件 @
a7858551
...
...
@@ -22,6 +22,7 @@ import argparse
import
codecs
import
json
import
os
from
pathlib
import
Path
import
soundfile
...
...
@@ -79,6 +80,7 @@ def create_manifest(data_dir, manifest_path_prefix):
audio_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
subfolder
,
fname
))
audio_id
=
os
.
path
.
basename
(
fname
)[:
-
4
]
utt2spk
=
Path
(
audio_path
).
parent
.
name
audio_data
,
samplerate
=
soundfile
.
read
(
audio_path
)
duration
=
float
(
len
(
audio_data
)
/
samplerate
)
...
...
@@ -87,6 +89,7 @@ def create_manifest(data_dir, manifest_path_prefix):
json
.
dumps
(
{
'utt'
:
audio_id
,
'utt2spk'
:
str
(
utt2spk
),
'feat'
:
audio_path
,
'feat_shape'
:
(
duration
,
),
# second
'text'
:
text
,
...
...
examples/dataset/mini_librispeech/mini_librispeech.py
浏览文件 @
a7858551
...
...
@@ -74,15 +74,16 @@ def create_manifest(data_dir, manifest_path):
audio_filepath
=
os
.
path
.
join
(
subfolder
,
segments
[
0
]
+
'.flac'
)
audio_data
,
samplerate
=
soundfile
.
read
(
audio_filepath
)
duration
=
float
(
len
(
audio_data
))
/
samplerate
utt
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
audio_filepath
))[
0
]
utt2spk
=
'-'
.
join
(
utt
.
split
(
'-'
)[:
2
])
json_lines
.
append
(
json
.
dumps
({
'utt'
:
os
.
path
.
splitext
(
os
.
path
.
basename
(
audio_filepath
))[
0
],
'feat'
:
audio_filepath
,
'utt'
:
utt
,
'utt2spk'
:
utt2spk
,
'feat'
:
audio_filepath
,
'feat_shape'
:
(
duration
,
),
#second
'text'
:
text
'text'
:
text
,
}))
total_sec
+=
duration
...
...
examples/dataset/thchs30/thchs30.py
浏览文件 @
a7858551
...
...
@@ -113,6 +113,8 @@ def create_manifest(data_dir, manifest_path_prefix):
assert
os
.
path
.
exists
(
audio_path
)
and
os
.
path
.
exists
(
text_path
)
audio_id
=
os
.
path
.
basename
(
audio_path
)[:
-
4
]
spk
=
audio_id
.
split
(
'_'
)[
0
]
word_text
,
syllable_text
,
phone_text
=
read_trn
(
text_path
)
audio_data
,
samplerate
=
soundfile
.
read
(
audio_path
)
duration
=
float
(
len
(
audio_data
)
/
samplerate
)
...
...
@@ -122,6 +124,7 @@ def create_manifest(data_dir, manifest_path_prefix):
json
.
dumps
(
{
'utt'
:
audio_id
,
'utt2spk'
,
spk
,
'feat'
:
audio_path
,
'feat_shape'
:
(
duration
,
),
# second
'text'
:
word_text
,
# charactor
...
...
examples/dataset/timit/timit.py
浏览文件 @
a7858551
...
...
@@ -180,12 +180,12 @@ def create_manifest(data_dir, manifest_path_prefix):
json
.
dumps
(
{
'utt'
:
utt_id
,
'utt2spk'
:
spk
,
'utt2gender'
:
gender
,
'feat'
:
str
(
audio_path
),
'feat_shape'
:
(
duration
,
),
# second
'text'
:
word_text
,
# word
'phone'
:
phone_text
,
'spk'
:
spk
,
'gender'
:
gender
,
},
ensure_ascii
=
False
))
...
...
examples/dataset/timit/timit_kaldi_standard_split.py
浏览文件 @
a7858551
...
...
@@ -24,6 +24,7 @@ import json
import
os
import
soundfile
from
pathlib
import
Path
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
parser
.
add_argument
(
...
...
@@ -67,10 +68,17 @@ def create_manifest(data_dir, manifest_path_prefix):
audio_data
,
samplerate
=
soundfile
.
read
(
audio_path
)
duration
=
float
(
len
(
audio_data
)
/
samplerate
)
text
=
phn_dict
[
audio_id
]
gender_spk
=
str
(
Path
(
audio_path
).
parent
.
stem
)
spk
=
gender_spk
[
1
:]
gender
=
gender_spk
[
0
]
utt_id
=
'_'
.
join
([
spk
,
gender
,
audio_id
])
json_lines
.
append
(
json
.
dumps
(
{
'utt'
:
audio_id
,
'utt2spk'
:
spk
,
'utt2gender'
:
gender
,
'feat'
:
audio_path
,
'feat_shape'
:
(
duration
,
),
# second
'text'
:
text
...
...
examples/dataset/voxforge/voxforge.py
浏览文件 @
a7858551
...
...
@@ -175,9 +175,12 @@ def generate_manifest(data_dir, manifest_path):
audio_data
,
samplerate
=
soundfile
.
read
(
u
)
duration
=
float
(
len
(
audio_data
))
/
samplerate
utt
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
u
))[
0
]
json_lines
.
append
(
json
.
dumps
({
'utt'
:
os
.
path
.
splitext
(
os
.
path
.
basename
(
u
))[
0
],
'utt'
:
utt
,
'utt2spk'
:
speaker
,
'feat'
:
u
,
'feat_shape'
:
(
duration
,
),
#second
'text'
:
trans
.
lower
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录