Tacotron2TTSBundle.TextProcessor
- class torchaudio.pipelines.Tacotron2TTSBundle.TextProcessor
Interface of the text processing part of Tacotron2TTS pipeline
See
torchaudio.pipelines.Tacotron2TTSBundle.get_text_processor()
for the usage.
Properties
tokens
- abstract property TextProcessor.tokens
The tokens that the each value in the processed tensor represent.
- Type:
List[str]
Methods
__call__
- abstract TextProcessor.__call__(texts: Union[str, List[str]]) Tuple[Tensor, Tensor]
Encode the given (batch of) texts into numerical tensors
- Parameters:
text (str or list of str) – The input texts.
- Returns:
- Tensor:
The encoded texts. Shape: (batch, max length)
- Tensor:
The valid length of each sample in the batch. Shape: (batch, ).
- Return type:
(Tensor, Tensor)