快捷方式

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]

CMU 发音词典 [Weide, 1998] (CMUDict) 数据集。

参数:
  • root (strPath) – 数据集所在或下载到的目录路径。

  • exclude_punctuations (bool, optional) – 启用后,排除标点符号的发音,例如 !EXCLAMATION-POINT#HASH-MARK

  • download (bool, optional) – 如果在根路径下找不到数据集,是否下载。(默认值: 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"

属性

符号

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

查看文档

教程

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

查看教程

资源

查找开发资源并获得解答

查看资源