快捷方式

Tacotron2TTSBundle.TextProcessor

class torchaudio.pipelines.Tacotron2TTSBundle.TextProcessor

Tacotron2TTS 管道的文本处理部分接口

请参阅 torchaudio.pipelines.Tacotron2TTSBundle.get_text_processor() 以了解用法。

属性

tokens

abstract property TextProcessor.tokens

处理后的张量中每个值代表的标记。

类型:

List[str]

方法

__call__

abstract TextProcessor.__call__(texts: Union[str, List[str]]) Tuple[Tensor, Tensor]

将给定的(批量)文本编码为数值张量

参数:

text (strstr 列表) – 输入文本。

返回:

Tensor

编码后的文本。形状: (batch, max length)

Tensor

批次中每个样本的有效长度。形状: (batch, )

返回类型:

(Tensor, Tensor)

文档

访问 PyTorch 的综合开发者文档

查看文档

教程

获取面向初学者和高级开发者的深度教程

查看教程

资源

查找开发资源并获得问题解答

查看资源