快捷方式

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 全面的开发者文档

查看文档

教程

获取针对初学者和高级开发者的深度教程

查看教程

资源

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

查看资源