Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
c463a00f
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
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看板
提交
c463a00f
编写于
11月 04, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add reference code license
上级
b49fbe65
变更
70
显示空白变更内容
内联
并排
Showing
70 changed file
with
73 addition
and
14 deletion
+73
-14
paddlespeech/s2t/decoders/README.md
paddlespeech/s2t/decoders/README.md
+1
-0
paddlespeech/s2t/decoders/beam_search/batch_beam_search.py
paddlespeech/s2t/decoders/beam_search/batch_beam_search.py
+1
-0
paddlespeech/s2t/decoders/beam_search/beam_search.py
paddlespeech/s2t/decoders/beam_search/beam_search.py
+1
-0
paddlespeech/s2t/decoders/recog.py
paddlespeech/s2t/decoders/recog.py
+1
-0
paddlespeech/s2t/decoders/recog_bin.py
paddlespeech/s2t/decoders/recog_bin.py
+1
-0
paddlespeech/s2t/decoders/scorers/ctc.py
paddlespeech/s2t/decoders/scorers/ctc.py
+1
-0
paddlespeech/s2t/decoders/scorers/length_bonus.py
paddlespeech/s2t/decoders/scorers/length_bonus.py
+1
-0
paddlespeech/s2t/decoders/scorers/ngram.py
paddlespeech/s2t/decoders/scorers/ngram.py
+1
-0
paddlespeech/s2t/decoders/scorers/scorer_interface.py
paddlespeech/s2t/decoders/scorers/scorer_interface.py
+1
-0
paddlespeech/s2t/decoders/utils.py
paddlespeech/s2t/decoders/utils.py
+1
-0
paddlespeech/s2t/io/batchfy.py
paddlespeech/s2t/io/batchfy.py
+1
-0
paddlespeech/s2t/io/converter.py
paddlespeech/s2t/io/converter.py
+1
-0
paddlespeech/s2t/io/dataset.py
paddlespeech/s2t/io/dataset.py
+2
-0
paddlespeech/s2t/io/reader.py
paddlespeech/s2t/io/reader.py
+1
-0
paddlespeech/s2t/models/asr_interface.py
paddlespeech/s2t/models/asr_interface.py
+1
-0
paddlespeech/s2t/models/lm/transformer.py
paddlespeech/s2t/models/lm/transformer.py
+1
-0
paddlespeech/s2t/models/lm_interface.py
paddlespeech/s2t/models/lm_interface.py
+1
-0
paddlespeech/s2t/models/st_interface.py
paddlespeech/s2t/models/st_interface.py
+1
-0
paddlespeech/s2t/modules/attention.py
paddlespeech/s2t/modules/attention.py
+1
-0
paddlespeech/s2t/modules/cmvn.py
paddlespeech/s2t/modules/cmvn.py
+1
-0
paddlespeech/s2t/modules/conformer_convolution.py
paddlespeech/s2t/modules/conformer_convolution.py
+1
-0
paddlespeech/s2t/modules/decoder.py
paddlespeech/s2t/modules/decoder.py
+1
-0
paddlespeech/s2t/modules/decoder_layer.py
paddlespeech/s2t/modules/decoder_layer.py
+1
-0
paddlespeech/s2t/modules/embedding.py
paddlespeech/s2t/modules/embedding.py
+1
-0
paddlespeech/s2t/modules/encoder.py
paddlespeech/s2t/modules/encoder.py
+1
-0
paddlespeech/s2t/modules/encoder_layer.py
paddlespeech/s2t/modules/encoder_layer.py
+1
-0
paddlespeech/s2t/modules/loss.py
paddlespeech/s2t/modules/loss.py
+1
-0
paddlespeech/s2t/modules/mask.py
paddlespeech/s2t/modules/mask.py
+1
-0
paddlespeech/s2t/modules/positionwise_feed_forward.py
paddlespeech/s2t/modules/positionwise_feed_forward.py
+1
-0
paddlespeech/s2t/modules/subsampling.py
paddlespeech/s2t/modules/subsampling.py
+1
-0
paddlespeech/s2t/training/extensions/evaluator.py
paddlespeech/s2t/training/extensions/evaluator.py
+1
-0
paddlespeech/s2t/training/extensions/extension.py
paddlespeech/s2t/training/extensions/extension.py
+1
-0
paddlespeech/s2t/training/extensions/plot.py
paddlespeech/s2t/training/extensions/plot.py
+1
-0
paddlespeech/s2t/training/extensions/snapshot.py
paddlespeech/s2t/training/extensions/snapshot.py
+1
-0
paddlespeech/s2t/training/optimizer.py
paddlespeech/s2t/training/optimizer.py
+1
-0
paddlespeech/s2t/training/reporter.py
paddlespeech/s2t/training/reporter.py
+1
-0
paddlespeech/s2t/training/scheduler.py
paddlespeech/s2t/training/scheduler.py
+1
-0
paddlespeech/s2t/training/triggers/compare_value_trigger.py
paddlespeech/s2t/training/triggers/compare_value_trigger.py
+1
-0
paddlespeech/s2t/training/triggers/interval_trigger.py
paddlespeech/s2t/training/triggers/interval_trigger.py
+1
-0
paddlespeech/s2t/training/triggers/limit_trigger.py
paddlespeech/s2t/training/triggers/limit_trigger.py
+1
-0
paddlespeech/s2t/training/triggers/time_trigger.py
paddlespeech/s2t/training/triggers/time_trigger.py
+1
-0
paddlespeech/s2t/training/updaters/standard_updater.py
paddlespeech/s2t/training/updaters/standard_updater.py
+1
-0
paddlespeech/s2t/training/updaters/trainer.py
paddlespeech/s2t/training/updaters/trainer.py
+1
-0
paddlespeech/s2t/training/updaters/updater.py
paddlespeech/s2t/training/updaters/updater.py
+1
-0
paddlespeech/s2t/transform/add_deltas.py
paddlespeech/s2t/transform/add_deltas.py
+1
-0
paddlespeech/s2t/transform/channel_selector.py
paddlespeech/s2t/transform/channel_selector.py
+1
-0
paddlespeech/s2t/transform/cmvn.py
paddlespeech/s2t/transform/cmvn.py
+1
-0
paddlespeech/s2t/transform/functional.py
paddlespeech/s2t/transform/functional.py
+1
-0
paddlespeech/s2t/transform/perturb.py
paddlespeech/s2t/transform/perturb.py
+1
-0
paddlespeech/s2t/transform/spec_augment.py
paddlespeech/s2t/transform/spec_augment.py
+1
-0
paddlespeech/s2t/transform/spectrogram.py
paddlespeech/s2t/transform/spectrogram.py
+1
-0
paddlespeech/s2t/transform/transform_interface.py
paddlespeech/s2t/transform/transform_interface.py
+3
-1
paddlespeech/s2t/transform/transformation.py
paddlespeech/s2t/transform/transformation.py
+1
-2
paddlespeech/s2t/transform/wpe.py
paddlespeech/s2t/transform/wpe.py
+1
-0
paddlespeech/s2t/utils/asr_utils.py
paddlespeech/s2t/utils/asr_utils.py
+1
-1
paddlespeech/s2t/utils/check_kwargs.py
paddlespeech/s2t/utils/check_kwargs.py
+1
-0
paddlespeech/s2t/utils/cli_readers.py
paddlespeech/s2t/utils/cli_readers.py
+1
-0
paddlespeech/s2t/utils/cli_utils.py
paddlespeech/s2t/utils/cli_utils.py
+1
-0
paddlespeech/s2t/utils/cli_writers.py
paddlespeech/s2t/utils/cli_writers.py
+1
-0
paddlespeech/s2t/utils/ctc_utils.py
paddlespeech/s2t/utils/ctc_utils.py
+1
-10
paddlespeech/s2t/utils/dynamic_import.py
paddlespeech/s2t/utils/dynamic_import.py
+1
-0
paddlespeech/t2s/training/extension.py
paddlespeech/t2s/training/extension.py
+1
-0
paddlespeech/t2s/training/extensions/evaluator.py
paddlespeech/t2s/training/extensions/evaluator.py
+1
-0
paddlespeech/t2s/training/extensions/snapshot.py
paddlespeech/t2s/training/extensions/snapshot.py
+1
-0
paddlespeech/t2s/training/reporter.py
paddlespeech/t2s/training/reporter.py
+1
-0
paddlespeech/t2s/training/triggers/interval_trigger.py
paddlespeech/t2s/training/triggers/interval_trigger.py
+1
-0
paddlespeech/t2s/training/triggers/limit_trigger.py
paddlespeech/t2s/training/triggers/limit_trigger.py
+1
-0
paddlespeech/t2s/training/triggers/time_trigger.py
paddlespeech/t2s/training/triggers/time_trigger.py
+1
-0
paddlespeech/t2s/training/updater.py
paddlespeech/t2s/training/updater.py
+1
-0
paddlespeech/t2s/training/updaters/standard_updater.py
paddlespeech/t2s/training/updaters/standard_updater.py
+1
-0
未找到文件。
paddlespeech/s2t/decoders/README.md
浏览文件 @
c463a00f
# Decoders
# Decoders
we borrow a lot of code from Espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
## Reference
## Reference
### CTC Prefix Beam Search
### CTC Prefix Beam Search
...
...
paddlespeech/s2t/decoders/beam_search/batch_beam_search.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
class
BatchBeamSearch
():
class
BatchBeamSearch
():
...
...
paddlespeech/s2t/decoders/beam_search/beam_search.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Beam search module."""
"""Beam search module."""
from
itertools
import
chain
from
itertools
import
chain
from
typing
import
Any
from
typing
import
Any
...
...
paddlespeech/s2t/decoders/recog.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""V2 backend for `asr_recog.py` using py:class:`decoders.beam_search.BeamSearch`."""
"""V2 backend for `asr_recog.py` using py:class:`decoders.beam_search.BeamSearch`."""
import
jsonlines
import
jsonlines
import
paddle
import
paddle
...
...
paddlespeech/s2t/decoders/recog_bin.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""End-to-end speech recognition model decoding script."""
"""End-to-end speech recognition model decoding script."""
import
logging
import
logging
import
os
import
os
...
...
paddlespeech/s2t/decoders/scorers/ctc.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""ScorerInterface implementation for CTC."""
"""ScorerInterface implementation for CTC."""
import
numpy
as
np
import
numpy
as
np
import
paddle
import
paddle
...
...
paddlespeech/s2t/decoders/scorers/length_bonus.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Length bonus module."""
"""Length bonus module."""
from
typing
import
Any
from
typing
import
Any
from
typing
import
List
from
typing
import
List
...
...
paddlespeech/s2t/decoders/scorers/ngram.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Ngram lm implement."""
"""Ngram lm implement."""
from
abc
import
ABC
from
abc
import
ABC
...
...
paddlespeech/s2t/decoders/scorers/scorer_interface.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Scorer interface module."""
"""Scorer interface module."""
import
warnings
import
warnings
from
typing
import
Any
from
typing
import
Any
...
...
paddlespeech/s2t/decoders/utils.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
numpy
as
np
import
numpy
as
np
from
paddlespeech.s2t.utils.log
import
Log
from
paddlespeech.s2t.utils.log
import
Log
...
...
paddlespeech/s2t/io/batchfy.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
itertools
import
itertools
import
numpy
as
np
import
numpy
as
np
...
...
paddlespeech/s2t/io/converter.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
numpy
as
np
import
numpy
as
np
from
paddlespeech.s2t.io.utility
import
pad_list
from
paddlespeech.s2t.io.utility
import
pad_list
...
...
paddlespeech/s2t/io/dataset.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from
typing
import
Optional
from
typing
import
Optional
from
paddle.io
import
Dataset
from
paddle.io
import
Dataset
...
...
paddlespeech/s2t/io/reader.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from
collections
import
OrderedDict
from
collections
import
OrderedDict
import
kaldiio
import
kaldiio
...
...
paddlespeech/s2t/models/asr_interface.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""ASR Interface module."""
"""ASR Interface module."""
import
argparse
import
argparse
...
...
paddlespeech/s2t/models/lm/transformer.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from
typing
import
Any
from
typing
import
Any
from
typing
import
List
from
typing
import
List
from
typing
import
Tuple
from
typing
import
Tuple
...
...
paddlespeech/s2t/models/lm_interface.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Language model interface."""
"""Language model interface."""
import
argparse
import
argparse
...
...
paddlespeech/s2t/models/st_interface.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""ST Interface module."""
"""ST Interface module."""
from
.asr_interface
import
ASRInterface
from
.asr_interface
import
ASRInterface
from
paddlespeech.s2t.utils.dynamic_import
import
dynamic_import
from
paddlespeech.s2t.utils.dynamic_import
import
dynamic_import
...
...
paddlespeech/s2t/modules/attention.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Multi-Head Attention layer definition."""
"""Multi-Head Attention layer definition."""
import
math
import
math
from
typing
import
Optional
from
typing
import
Optional
...
...
paddlespeech/s2t/modules/cmvn.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
paddle
import
paddle
from
paddle
import
nn
from
paddle
import
nn
...
...
paddlespeech/s2t/modules/conformer_convolution.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""ConvolutionModule definition."""
"""ConvolutionModule definition."""
from
typing
import
Optional
from
typing
import
Optional
from
typing
import
Tuple
from
typing
import
Tuple
...
...
paddlespeech/s2t/modules/decoder.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Decoder definition."""
"""Decoder definition."""
from
typing
import
Any
from
typing
import
Any
from
typing
import
List
from
typing
import
List
...
...
paddlespeech/s2t/modules/decoder_layer.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Decoder self-attention layer definition."""
"""Decoder self-attention layer definition."""
from
typing
import
Optional
from
typing
import
Optional
from
typing
import
Tuple
from
typing
import
Tuple
...
...
paddlespeech/s2t/modules/embedding.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Positonal Encoding Module."""
"""Positonal Encoding Module."""
import
math
import
math
from
typing
import
Tuple
from
typing
import
Tuple
...
...
paddlespeech/s2t/modules/encoder.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Encoder definition."""
"""Encoder definition."""
from
typing
import
List
from
typing
import
List
from
typing
import
Optional
from
typing
import
Optional
...
...
paddlespeech/s2t/modules/encoder_layer.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Encoder self-attention layer definition."""
"""Encoder self-attention layer definition."""
from
typing
import
Optional
from
typing
import
Optional
from
typing
import
Tuple
from
typing
import
Tuple
...
...
paddlespeech/s2t/modules/loss.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
inspect
import
inspect
import
paddle
import
paddle
...
...
paddlespeech/s2t/modules/mask.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
paddle
import
paddle
from
paddlespeech.s2t.utils.log
import
Log
from
paddlespeech.s2t.utils.log
import
Log
...
...
paddlespeech/s2t/modules/positionwise_feed_forward.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Positionwise feed forward layer definition."""
"""Positionwise feed forward layer definition."""
import
paddle
import
paddle
from
paddle
import
nn
from
paddle
import
nn
...
...
paddlespeech/s2t/modules/subsampling.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Subsampling layer definition."""
"""Subsampling layer definition."""
from
typing
import
Tuple
from
typing
import
Tuple
...
...
paddlespeech/s2t/training/extensions/evaluator.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
from
typing
import
Dict
from
typing
import
Dict
import
paddle
import
paddle
...
...
paddlespeech/s2t/training/extensions/extension.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
PRIORITY_WRITER
=
300
PRIORITY_WRITER
=
300
PRIORITY_EDITOR
=
200
PRIORITY_EDITOR
=
200
PRIORITY_READER
=
100
PRIORITY_READER
=
100
...
...
paddlespeech/s2t/training/extensions/plot.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
import
copy
import
copy
import
os
import
os
...
...
paddlespeech/s2t/training/extensions/snapshot.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
import
os
import
os
from
datetime
import
datetime
from
datetime
import
datetime
from
pathlib
import
Path
from
pathlib
import
Path
...
...
paddlespeech/s2t/training/optimizer.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from
typing
import
Any
from
typing
import
Any
from
typing
import
Dict
from
typing
import
Dict
from
typing
import
Text
from
typing
import
Text
...
...
paddlespeech/s2t/training/reporter.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
import
contextlib
import
contextlib
import
math
import
math
from
collections
import
defaultdict
from
collections
import
defaultdict
...
...
paddlespeech/s2t/training/scheduler.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from
typing
import
Any
from
typing
import
Any
from
typing
import
Dict
from
typing
import
Dict
from
typing
import
Text
from
typing
import
Text
...
...
paddlespeech/s2t/training/triggers/compare_value_trigger.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
from
..reporter
import
DictSummary
from
..reporter
import
DictSummary
from
.utils
import
get_trigger
from
.utils
import
get_trigger
...
...
paddlespeech/s2t/training/triggers/interval_trigger.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
class
IntervalTrigger
():
class
IntervalTrigger
():
...
...
paddlespeech/s2t/training/triggers/limit_trigger.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
class
LimitTrigger
():
class
LimitTrigger
():
...
...
paddlespeech/s2t/training/triggers/time_trigger.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
class
TimeTrigger
():
class
TimeTrigger
():
...
...
paddlespeech/s2t/training/updaters/standard_updater.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
from
typing
import
Dict
from
typing
import
Dict
from
typing
import
Optional
from
typing
import
Optional
...
...
paddlespeech/s2t/training/updaters/trainer.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
import
sys
import
sys
import
traceback
import
traceback
from
collections
import
OrderedDict
from
collections
import
OrderedDict
...
...
paddlespeech/s2t/training/updaters/updater.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
import
paddle
import
paddle
...
...
paddlespeech/s2t/transform/add_deltas.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
numpy
as
np
import
numpy
as
np
...
...
paddlespeech/s2t/transform/channel_selector.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
numpy
import
numpy
...
...
paddlespeech/s2t/transform/cmvn.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
io
import
io
import
h5py
import
h5py
...
...
paddlespeech/s2t/transform/functional.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
inspect
import
inspect
from
paddlespeech.s2t.transform.transform_interface
import
TransformInterface
from
paddlespeech.s2t.transform.transform_interface
import
TransformInterface
...
...
paddlespeech/s2t/transform/perturb.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
librosa
import
librosa
import
numpy
import
numpy
import
scipy
import
scipy
...
...
paddlespeech/s2t/transform/spec_augment.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Spec Augment module for preprocessing i.e., data augmentation"""
"""Spec Augment module for preprocessing i.e., data augmentation"""
import
random
import
random
...
...
paddlespeech/s2t/transform/spectrogram.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
librosa
import
librosa
import
numpy
as
np
import
numpy
as
np
...
...
paddlespeech/s2t/transform/transform_interface.py
浏览文件 @
c463a00f
...
@@ -11,7 +11,9 @@
...
@@ -11,7 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# TODO(karita): add this to all the transform impl.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
class
TransformInterface
:
class
TransformInterface
:
"""Transform Interface"""
"""Transform Interface"""
...
...
paddlespeech/s2t/transform/transformation.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Transformation module."""
"""Transformation module."""
import
copy
import
copy
import
io
import
io
...
@@ -23,8 +24,6 @@ import yaml
...
@@ -23,8 +24,6 @@ import yaml
from
paddlespeech.s2t.utils.dynamic_import
import
dynamic_import
from
paddlespeech.s2t.utils.dynamic_import
import
dynamic_import
# TODO(karita): inherit TransformInterface
# TODO(karita): register cmd arguments in asr_train.py
import_alias
=
dict
(
import_alias
=
dict
(
identity
=
"paddlespeech.s2t.transform.transform_interface:Identity"
,
identity
=
"paddlespeech.s2t.transform.transform_interface:Identity"
,
time_warp
=
"paddlespeech.s2t.transform.spec_augment:TimeWarp"
,
time_warp
=
"paddlespeech.s2t.transform.spec_augment:TimeWarp"
,
...
...
paddlespeech/s2t/transform/wpe.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from
nara_wpe.wpe
import
wpe
from
nara_wpe.wpe
import
wpe
...
...
paddlespeech/s2t/utils/asr_utils.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
json
import
json
import
numpy
as
np
import
numpy
as
np
...
@@ -18,7 +19,6 @@ import numpy as np
...
@@ -18,7 +19,6 @@ import numpy as np
__all__
=
[
"label_smoothing_dist"
]
__all__
=
[
"label_smoothing_dist"
]
# TODO(takaaki-hori): add different smoothing methods
def
label_smoothing_dist
(
odim
,
lsm_type
,
transcript
=
None
,
blank
=
0
):
def
label_smoothing_dist
(
odim
,
lsm_type
,
transcript
=
None
,
blank
=
0
):
"""Obtain label distribution for loss smoothing.
"""Obtain label distribution for loss smoothing.
...
...
paddlespeech/s2t/utils/check_kwargs.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
inspect
import
inspect
...
...
paddlespeech/s2t/utils/cli_readers.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
io
import
io
import
logging
import
logging
import
sys
import
sys
...
...
paddlespeech/s2t/utils/cli_utils.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
sys
import
sys
from
collections.abc
import
Sequence
from
collections.abc
import
Sequence
from
distutils.util
import
strtobool
as
dist_strtobool
from
distutils.util
import
strtobool
as
dist_strtobool
...
...
paddlespeech/s2t/utils/cli_writers.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from
pathlib
import
Path
from
pathlib
import
Path
from
typing
import
Dict
from
typing
import
Dict
...
...
paddlespeech/s2t/utils/ctc_utils.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference wenet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from
typing
import
List
from
typing
import
List
import
numpy
as
np
import
numpy
as
np
...
@@ -138,16 +139,6 @@ def forced_align(ctc_probs: paddle.Tensor, y: paddle.Tensor,
...
@@ -138,16 +139,6 @@ def forced_align(ctc_probs: paddle.Tensor, y: paddle.Tensor,
return
output_alignment
return
output_alignment
# ctc_align(
# self.model,
# self.align_loader,
# self.config.decoding.batch_size,
# self.align_loader.collate_fn.stride_ms,
# self.align_loader.collate_fn.vocab_list,
# self.args.result_file,
# )
def
ctc_align
(
model
,
dataloader
,
batch_size
,
stride_ms
,
token_dict
,
def
ctc_align
(
model
,
dataloader
,
batch_size
,
stride_ms
,
token_dict
,
result_file
):
result_file
):
"""ctc alignment.
"""ctc alignment.
...
...
paddlespeech/s2t/utils/dynamic_import.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference espnet Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import
importlib
import
importlib
import
inspect
import
inspect
from
typing
import
Any
from
typing
import
Any
...
...
paddlespeech/t2s/training/extension.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
from
typing
import
Callable
from
typing
import
Callable
PRIORITY_WRITER
=
300
PRIORITY_WRITER
=
300
...
...
paddlespeech/t2s/training/extensions/evaluator.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
from
typing
import
Dict
from
typing
import
Dict
import
paddle
import
paddle
...
...
paddlespeech/t2s/training/extensions/snapshot.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
import
logging
import
logging
import
os
import
os
from
datetime
import
datetime
from
datetime
import
datetime
...
...
paddlespeech/t2s/training/reporter.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
import
contextlib
import
contextlib
import
math
import
math
from
collections
import
defaultdict
from
collections
import
defaultdict
...
...
paddlespeech/t2s/training/triggers/interval_trigger.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
class
IntervalTrigger
(
object
):
class
IntervalTrigger
(
object
):
...
...
paddlespeech/t2s/training/triggers/limit_trigger.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
class
LimitTrigger
(
object
):
class
LimitTrigger
(
object
):
...
...
paddlespeech/t2s/training/triggers/time_trigger.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
class
TimeTrigger
(
object
):
class
TimeTrigger
(
object
):
...
...
paddlespeech/t2s/training/updater.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
import
logging
import
logging
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
...
...
paddlespeech/t2s/training/updaters/standard_updater.py
浏览文件 @
c463a00f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Reference chainer MIT (https://opensource.org/licenses/MIT)
import
logging
import
logging
import
time
import
time
from
typing
import
Dict
from
typing
import
Dict
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录