快捷方式

CMUDict

class torchaudio.datasets.CMUDict(root: Union[str, Path], exclude_punctuations: bool = True, *, download: bool = False, url: str = 'http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b', url_symbols: str = 'http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b.symbols')[source]

卡耐基梅隆發音詞典 [Weide, 1998] (CMUDict) 資料集。

引數:
  • root (str or Path) – 資料集所在或下載到的目錄路徑。

  • exclude_punctuations (bool, optional) – 啟用時,排除標點的發音,例如 !EXCLAMATION-POINT#HASH-MARK

  • download (bool, optional) – 如果在 root 路徑找不到資料集時是否下載。(預設值:False)。

  • url (str, optional) – 下載詞典的 URL。(預設值: "http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b")

  • url_symbols (str, optional) – 下載符號列表的 URL。(預設值: "http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b.symbols")

屬性

symbols

property CMUDict.symbols: List[str]

音素符號列表,例如 "AA""AE""AH"

型別:

list[str]

方法

__getitem__

CMUDict.__getitem__(n: int) Tuple[str, List[str]][source]

載入資料集中的第 n 個樣本。

引數:

n (int) – 要載入樣本的索引。

返回值:

單詞及其音素的元組

str

單詞

List[str]

音素

文件

訪問 PyTorch 全面的開發者文件

檢視文件

教程

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

檢視教程

資源

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

檢視資源