espnet.utils.io_utils.LoadInputsAndTargets
Less than 1 minute
espnet.utils.io_utils.LoadInputsAndTargets
class espnet.utils.io_utils.LoadInputsAndTargets(mode='asr', preprocess_conf=None, load_input=True, load_output=True, sort_in_input_length=True, use_speaker_embedding=False, use_second_target=False, preprocess_args=None, keep_all_data_on_mem=False)
Bases: object
Create a mini-batch from a list of dicts.
>>> batch = [('utt1',
... dict(input=[dict(feat='some.ark:123',
... filetype='mat',
... name='input1',
... shape=[100, 80])],
... output=[dict(tokenid='1 2 3 4',
... name='target1',
... shape=[4, 31])]]))
>>> l = LoadInputsAndTargets()
>>> feat, target = l(batch)
- Param: str mode: Specify the task mode, “asr” or “tts”
- Param: str preprocess_conf: The path of a json file for pre-processing
- Param: bool load_input: If False, not to load the input data
- Param: bool load_output: If False, not to load the output data
- Param: bool sort_in_input_length: Sort the mini-batch in descending order of the input length
- Param: bool use_speaker_embedding: Used for tts mode only
- Param: bool use_second_target: Used for tts mode only
- Param: dict preprocess_args: Set some optional arguments for preprocessing
- Param: Optional[dict] preprocess_args: Used for tts mode only
Initialize Load inputs and Targets.