快捷方式

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')[源代码]

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

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

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

  • download (bool, 可选) – 如果在 root 路径找不到数据集,是否下载它。(默认:False)。

  • url (str, 可选) – 下载词典的 URL。(默认:"http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b"

  • url_symbols (str, 可选) – 下载符号列表的 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]][源代码]

加载数据集中的第 n 个样本。

参数

n (int) – 要加载的样本的索引。

返回

一个单词及其音素的元组

str

单词

List[str]

音素

文档

访问全面的 PyTorch 开发者文档

查看文档

教程

为初学者和高级开发者提供深入的教程

查看教程

资源

查找开发资源并让您的问题得到解答

查看资源