快捷方式

Tacotron2TTSBundle.TextProcessor

class torchaudio.pipelines.Tacotron2TTSBundle.TextProcessor

Tacotron2TTS pipeline 中文字處理部分的介面

請參閱 torchaudio.pipelines.Tacotron2TTSBundle.get_text_processor() 瞭解用法。

屬性

tokens

abstract property TextProcessor.tokens

處理後的張量中每個值所代表的 token。

型別:

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 開發者綜合文件

檢視文件

教程

獲取針對初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得疑問解答

檢視資源