espnet2.s2t.espnet_ctc_model.ESPnetS2TCTCModel
espnet2.s2t.espnet_ctc_model.ESPnetS2TCTCModel
class espnet2.s2t.espnet_ctc_model.ESPnetS2TCTCModel(vocab_size: int, token_list: Tuple[str, ...] | List[str], frontend: AbsFrontend | None, specaug: AbsSpecAug | None, normalize: AbsNormalize | None, encoder: AbsEncoder, prompt_encoder: AbsEncoder, ctc: CTC, interctc_weight: float = 0.0, ignore_id: int = -1, report_cer: bool = True, report_wer: bool = True, sym_space: str = '<space>', sym_blank: str = '<blank>', sym_sos: str = '<sos>', sym_eos: str = '<eos>', sym_sop: str = '<sop>', sym_na: str = '<na>', extract_feats_in_collect_stats: bool = True, ctc_asr_only: List[bool] = [False])
Bases: AbsESPnetModel
OWSM-CTC model
Initialize internal Module state, shared by both nn.Module and ScriptModule.
collect_feats(speech: Tensor, speech_lengths: Tensor, text: Tensor, text_lengths: Tensor, text_prev: Tensor, text_prev_lengths: Tensor, text_ctc: Tensor, text_ctc_lengths: Tensor, **kwargs) β Dict[str, Tensor]
encode(speech: Tensor, speech_lengths: Tensor, text_prev: Tensor, text_prev_lengths: Tensor, prefix: Tensor, prefix_lengths: Tensor)
Encode input speech.
forward(speech: Tensor, speech_lengths: Tensor, text: Tensor, text_lengths: Tensor, text_prev: Tensor, text_prev_lengths: Tensor, text_ctc: Tensor, text_ctc_lengths: Tensor, prefix: Tensor, prefix_lengths: Tensor, **kwargs) β Tuple[Tensor, Dict[str, Tensor], Tensor]
Frontend + Encoder + Calc loss
- Parameters:
- speech β (Batch, Length, β¦)
- speech_lengths β (Batch, )
- text β (Batch, Length)
- text_lengths β (Batch,)
- text_prev β (Batch, Length)
- text_prev_lengths β (Batch,)
- text_ctc β (Batch, Length)
- text_ctc_lengths β (Batch,)
- prefix β (Batch, Length=2), <lang> and <task>
- prefix_lengths β (Batch,)
- kwargs β βutt_idβ is among the input.
