快捷鍵

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 ( str 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]][原始碼]

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

參數:

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

回傳:

一個單字及其音素的元組

str

單字

List[str]

音素

文件

取得 PyTorch 的完整開發者文件

檢視文件

教學

取得初學者和進階開發者的深入教學課程

檢視教學課程

資源

尋找開發資源並取得您的問題解答

檢視資源