Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
F
Fairseq-S2T
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
xuchen
Fairseq-S2T
Commits
5d84c743
Commit
5d84c743
authored
Jul 12, 2022
by
xuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable the additional label for CTC learning
parent
e40eac14
全部展开
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
1 行删除
+13
-1
fairseq/data/audio/aligned_speech_to_text_dataset.py
+0
-0
fairseq/data/audio/speech_to_text_dataset.py
+1
-0
fairseq/tasks/speech_to_text.py
+12
-1
没有找到文件。
fairseq/data/audio/aligned_speech_to_text_dataset.py
0 → 100644
查看文件 @
5d84c743
差异被折叠。
点击展开。
fairseq/data/audio/speech_to_text_dataset.py
查看文件 @
5d84c743
...
@@ -190,6 +190,7 @@ def get_features_or_waveform_from_audio(
...
@@ -190,6 +190,7 @@ def get_features_or_waveform_from_audio(
else
get_fbank
(
path
,
offset
=
offset
,
size
=
size
)
else
get_fbank
(
path
,
offset
=
offset
,
size
=
size
)
return
features_or_waveform
return
features_or_waveform
def
get_features_or_waveform
(
path
:
str
,
need_waveform
=
False
):
def
get_features_or_waveform
(
path
:
str
,
need_waveform
=
False
):
"""Get speech features from .npy file or waveform from .wav/.flac file.
"""Get speech features from .npy file or waveform from .wav/.flac file.
The file may be inside an uncompressed ZIP file and is accessed via byte
The file may be inside an uncompressed ZIP file and is accessed via byte
...
...
fairseq/tasks/speech_to_text.py
查看文件 @
5d84c743
...
@@ -50,12 +50,19 @@ class SpeechToTextTask(LegacyFairseqTask):
...
@@ -50,12 +50,19 @@ class SpeechToTextTask(LegacyFairseqTask):
metavar
=
"N"
,
metavar
=
"N"
,
help
=
"max number of tokens in the target sequence"
,
help
=
"max number of tokens in the target sequence"
,
)
)
parser
.
add_argument
(
"--use-aligned-text"
,
default
=
False
,
action
=
"store_true"
,
help
=
"use aligned text for loss"
,
)
def
__init__
(
self
,
args
,
tgt_dict
,
src_dict
=
None
):
def
__init__
(
self
,
args
,
tgt_dict
,
src_dict
=
None
):
super
()
.
__init__
(
args
)
super
()
.
__init__
(
args
)
self
.
src_dict
=
src_dict
self
.
src_dict
=
src_dict
self
.
tgt_dict
=
tgt_dict
self
.
tgt_dict
=
tgt_dict
self
.
speed_perturb
=
args
.
speed_perturb
self
.
speed_perturb
=
args
.
speed_perturb
self
.
use_aligned_text
=
getattr
(
args
,
"use_aligned_text"
,
False
)
self
.
data_cfg
=
S2TDataConfig
(
op
.
join
(
args
.
data
,
args
.
config_yaml
))
self
.
data_cfg
=
S2TDataConfig
(
op
.
join
(
args
.
data
,
args
.
config_yaml
))
self
.
data_cfg
.
config
[
"speed_perturb"
]
=
self
.
speed_perturb
self
.
data_cfg
.
config
[
"speed_perturb"
]
=
self
.
speed_perturb
...
@@ -111,7 +118,11 @@ class SpeechToTextTask(LegacyFairseqTask):
...
@@ -111,7 +118,11 @@ class SpeechToTextTask(LegacyFairseqTask):
# src_bpe_tokenizer = bpe_tokenizer
# src_bpe_tokenizer = bpe_tokenizer
# else:
# else:
# src_bpe_tokenizer = None
# src_bpe_tokenizer = None
self
.
datasets
[
split
]
=
SpeechToTextDatasetCreator
.
from_tsv
(
if
self
.
use_aligned_text
:
from
fairseq.data.audio.aligned_speech_to_text_dataset
import
SpeechToTextDatasetCreator
as
Creator
else
:
from
fairseq.data.audio.speech_to_text_dataset
import
SpeechToTextDatasetCreator
as
Creator
self
.
datasets
[
split
]
=
Creator
.
from_tsv
(
self
.
args
.
data
,
self
.
args
.
data
,
self
.
data_cfg
,
self
.
data_cfg
,
split
,
split
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论