Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
56480e10
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
1 年多 前同步成功
通知
207
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看板
提交
56480e10
编写于
11月 23, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix format
上级
7ec0ed4a
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
46 addition
and
31 deletion
+46
-31
examples/aishell/asr1/README.md
examples/aishell/asr1/README.md
+1
-1
examples/dataset/aishell/aishell.py
examples/dataset/aishell/aishell.py
+1
-1
examples/dataset/ted_en_zh/ted_en_zh.py
examples/dataset/ted_en_zh/ted_en_zh.py
+1
-2
examples/dataset/thchs30/thchs30.py
examples/dataset/thchs30/thchs30.py
+1
-1
examples/dataset/timit/timit_kaldi_standard_split.py
examples/dataset/timit/timit_kaldi_standard_split.py
+1
-1
examples/librispeech/asr1/README.md
examples/librispeech/asr1/README.md
+1
-1
examples/timit/README.md
examples/timit/README.md
+1
-1
examples/wenetspeech/README.md
examples/wenetspeech/README.md
+1
-1
examples/wenetspeech/asr1/RESULTS.md
examples/wenetspeech/asr1/RESULTS.md
+1
-1
examples/wenetspeech/asr1/local/extract_meta.py
examples/wenetspeech/asr1/local/extract_meta.py
+18
-7
examples/wenetspeech/asr1/local/process_opus.py
examples/wenetspeech/asr1/local/process_opus.py
+16
-6
paddlespeech/s2t/exps/u2/model.py
paddlespeech/s2t/exps/u2/model.py
+1
-6
paddlespeech/s2t/frontend/featurizer/text_featurizer.py
paddlespeech/s2t/frontend/featurizer/text_featurizer.py
+1
-1
paddlespeech/s2t/transform/spectrogram.py
paddlespeech/s2t/transform/spectrogram.py
+1
-1
未找到文件。
examples/aishell/asr1/README.md
浏览文件 @
56480e10
...
...
@@ -28,4 +28,4 @@ Need set `decoding.decoding_chunk_size=16` when decoding.
| transformer | 31.95M | conf/transformer.yaml | spec_aug | test | attention | 3.858648955821991 | 0.057293 |
| transformer | 31.95M | conf/transformer.yaml | spec_aug | test | ctc_greedy_search | 3.858648955821991 | 0.061837 |
| transformer | 31.95M | conf/transformer.yaml | spec_aug | test | ctc_prefix_beam_search | 3.858648955821991 | 0.061685 |
| transformer | 31.95M | conf/transformer.yaml | spec_aug | test | attention_rescoring | 3.858648955821991 | 0.053844 |
\ No newline at end of file
| transformer | 31.95M | conf/transformer.yaml | spec_aug | test | attention_rescoring | 3.858648955821991 | 0.053844 |
examples/dataset/aishell/aishell.py
浏览文件 @
56480e10
...
...
@@ -82,7 +82,7 @@ def create_manifest(data_dir, manifest_path_prefix):
# if no transcription for audio then skipped
if
audio_id
not
in
transcript_dict
:
continue
utt2spk
=
Path
(
audio_path
).
parent
.
name
audio_data
,
samplerate
=
soundfile
.
read
(
audio_path
)
duration
=
float
(
len
(
audio_data
)
/
samplerate
)
...
...
examples/dataset/ted_en_zh/ted_en_zh.py
浏览文件 @
56480e10
...
...
@@ -73,7 +73,6 @@ def create_manifest(data_dir, manifest_path_prefix):
audio_data
,
samplerate
=
soundfile
.
read
(
audio_path
)
duration
=
float
(
len
(
audio_data
)
/
samplerate
)
translation_str
=
" "
.
join
(
translation
.
split
())
trancription_str
=
" "
.
join
(
trancription
.
split
())
json_lines
.
append
(
...
...
@@ -82,7 +81,7 @@ def create_manifest(data_dir, manifest_path_prefix):
'utt'
:
utt
,
'feat'
:
audio_path
,
'feat_shape'
:
(
duration
,
),
# second
'text'
:
[
translation_str
,
trancription_str
],
'text'
:
[
translation_str
,
trancription_str
],
},
ensure_ascii
=
False
))
...
...
examples/dataset/thchs30/thchs30.py
浏览文件 @
56480e10
...
...
@@ -124,7 +124,7 @@ def create_manifest(data_dir, manifest_path_prefix):
json
.
dumps
(
{
'utt'
:
audio_id
,
'utt2spk'
,
spk
,
'utt2spk'
:
spk
,
'feat'
:
audio_path
,
'feat_shape'
:
(
duration
,
),
# second
'text'
:
word_text
,
# charactor
...
...
examples/dataset/timit/timit_kaldi_standard_split.py
浏览文件 @
56480e10
...
...
@@ -22,9 +22,9 @@ import argparse
import
codecs
import
json
import
os
from
pathlib
import
Path
import
soundfile
from
pathlib
import
Path
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
parser
.
add_argument
(
...
...
examples/librispeech/asr1/README.md
浏览文件 @
56480e10
...
...
@@ -24,4 +24,4 @@
| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | attention | 6.805267604192098, | 0.049795 |
| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | ctc_greedy_search | 6.805267604192098, | 0.054892 |
| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | ctc_prefix_beam_search | 6.805267604192098, | 0.054531 |
| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | attention_rescoring | 6.805267604192098, | 0.042244 |
\ No newline at end of file
| transformer | 32.52 M | conf/transformer.yaml | spec_aug | test-clean | attention_rescoring | 6.805267604192098, | 0.042244 |
examples/timit/README.md
浏览文件 @
56480e10
...
...
@@ -4,4 +4,4 @@ asr model with phone unit
*
asr0 - deepspeech2 Streaming/Non-Streaming
*
asr1 - transformer/conformer Streaming/Non-Streaming
*
asr2 - transformer/conformer Streaming/Non-Streaming with Kaldi feature
\ No newline at end of file
*
asr2 - transformer/conformer Streaming/Non-Streaming with Kaldi feature
examples/wenetspeech/README.md
浏览文件 @
56480e10
...
...
@@ -55,4 +55,4 @@ As shown in the following table, we provide 3 training subsets, namely `S`, `M`
|-----------------|-------|--------------|-----------------------------------------------------------------------------------------|
| DEV | 20 | Internet | Specially designed for some speech tools which require cross-validation set in training |
| TEST
\_
NET | 23 | Internet | Match test |
| TEST
\_
MEETING | 15 | Real meeting | Mismatch test which is a far-field, conversational, spontaneous, and meeting dataset |
\ No newline at end of file
| TEST
\_
MEETING | 15 | Real meeting | Mismatch test which is a far-field, conversational, spontaneous, and meeting dataset |
examples/wenetspeech/asr1/RESULTS.md
浏览文件 @
56480e10
...
...
@@ -21,4 +21,4 @@ Pretrain model from http://mobvoi-speech-public.ufile.ucloud.cn/public/wenet/wen
| conformer | 32.52 M | conf/conformer.yaml | spec_aug | aishell1 | attention | - | 0.048456 |
| conformer | 32.52 M | conf/conformer.yaml | spec_aug | aishell1 | ctc_greedy_search | - | 0.052534 |
| conformer | 32.52 M | conf/conformer.yaml | spec_aug | aishell1 | ctc_prefix_beam_search | - | 0.052915 |
| conformer | 32.52 M | conf/conformer.yaml | spec_aug | aishell1 | attention_rescoring | - | 0.047904 |
\ No newline at end of file
| conformer | 32.52 M | conf/conformer.yaml | spec_aug | aishell1 | attention_rescoring | - | 0.047904 |
examples/wenetspeech/asr1/local/extract_meta.py
浏览文件 @
56480e10
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright 2021 Xiaomi Corporation (Author: Yongqing Wang)
# Mobvoi Inc(Author: Di Wu, Binbin Zhang)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
@@ -12,11 +24,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
sys
import
os
import
argparse
import
json
import
os
import
sys
def
get_args
():
...
...
@@ -85,13 +96,13 @@ def meta_analysis(input_json, output_dir):
else
:
utt2text
.
write
(
f
'
{
sid
}
\t
{
text
}
\n
'
)
segments
.
write
(
f
'
{
sid
}
\t
{
aid
}
\t
{
start_time
}
\t
{
end_time
}
\n
'
)
f
'
{
sid
}
\t
{
aid
}
\t
{
start_time
}
\t
{
end_time
}
\n
'
)
utt2dur
.
write
(
f
'
{
sid
}
\t
{
dur
}
\n
'
)
segment_sub_names
=
" "
.
join
(
segment_subsets
)
utt2subsets
.
write
(
f
'
{
sid
}
\t
{
segment_sub_names
}
\n
'
)
def
main
():
args
=
get_args
()
...
...
@@ -99,4 +110,4 @@ def main():
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
main
()
examples/wenetspeech/asr1/local/process_opus.py
浏览文件 @
56480e10
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright 2021 NPU, ASLP Group (Author: Qijie Shao)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
@@ -11,14 +23,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# process_opus.py: segmentation and downsampling of opus audio
# usage: python3 process_opus.py wav.scp segments output_wav.scp
import
os
import
sys
from
pydub
import
AudioSegment
import
sys
import
os
def
read_file
(
wav_scp
,
segments
):
...
...
@@ -86,4 +96,4 @@ def main():
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
main
()
paddlespeech/s2t/exps/u2/model.py
浏览文件 @
56480e10
...
...
@@ -24,15 +24,10 @@ import jsonlines
import
numpy
as
np
import
paddle
from
paddle
import
distributed
as
dist
from
paddle.io
import
DataLoader
from
yacs.config
import
CfgNode
from
paddlespeech.s2t.frontend.featurizer
import
TextFeaturizer
from
paddlespeech.s2t.io.collator
import
SpeechCollator
from
paddlespeech.s2t.io.dataloader
import
BatchDataLoader
from
paddlespeech.s2t.io.dataset
import
ManifestDataset
from
paddlespeech.s2t.io.sampler
import
SortagradBatchSampler
from
paddlespeech.s2t.io.sampler
import
SortagradDistributedBatchSampler
from
paddlespeech.s2t.models.u2
import
U2Model
from
paddlespeech.s2t.training.optimizer
import
OptimizerFactory
from
paddlespeech.s2t.training.reporter
import
ObsScope
...
...
@@ -215,7 +210,7 @@ class U2Trainer(Trainer):
msg
+=
f
"
{
v
:
>
.
8
f
}
"
if
isinstance
(
v
,
float
)
else
f
"
{
v
}
"
msg
+=
f
"
{
k
.
split
(
','
)[
1
]
}
"
if
len
(
k
.
split
(
','
))
==
2
else
f
""
k
.
split
(
','
))
==
2
else
""
msg
+=
","
msg
=
msg
[:
-
1
]
# remove the last ","
if
(
batch_index
+
1
...
...
paddlespeech/s2t/frontend/featurizer/text_featurizer.py
浏览文件 @
56480e10
...
...
@@ -57,7 +57,7 @@ class TextFeaturizer():
vocab_filepath
,
maskctc
)
self
.
vocab_size
=
len
(
self
.
vocab_list
)
else
:
logger
.
warning
(
f
"TextFeaturizer: not have vocab file."
)
logger
.
warning
(
"TextFeaturizer: not have vocab file."
)
if
unit_type
==
'spm'
:
spm_model
=
spm_model_prefix
+
'.model'
...
...
paddlespeech/s2t/transform/spectrogram.py
浏览文件 @
56480e10
...
...
@@ -341,7 +341,7 @@ class LogMelSpectrogramKaldi():
self
.
eps
=
eps
self
.
remove_dc_offset
=
True
self
.
preemph
=
0.97
self
.
dither
=
dither
# only work in train mode
self
.
dither
=
dither
# only work in train mode
def
__repr__
(
self
):
return
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录