快捷方式

LIBRISPEECH

class torchaudio.datasets.LIBRISPEECH(root: Union[str, Path], url: str = 'train-clean-100', folder_in_archive: str = 'LibriSpeech', download: bool = False)[原始碼]

LibriSpeech [Panayotov 等人, 2015] 資料集。

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

  • url (str, optional) – 下載資料集的 URL,或要下載的資料集的型別。允許的型別值為 "dev-clean", "dev-other", "test-clean", "test-other", "train-clean-100", "train-clean-360""train-other-500"。(預設值: "train-clean-100")

  • folder_in_archive (str, optional) – 資料集的頂層目錄。(預設值: "LibriSpeech")

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

__getitem__

LIBRISPEECH.__getitem__(n: int) Tuple[Tensor, int, str, int, int, int][原始碼]

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

引數:

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

返回:

包含以下元素的元組;

Tensor

波形

int

取樣率

str

轉錄文字

int

發言人 ID

int

章 ID

int

話語 ID

get_metadata

LIBRISPEECH.get_metadata(n: int) Tuple[str, int, str, int, int, int][原始碼]

獲取資料集中第 n 個樣本的元資料。返回檔案路徑而非波形,但其他欄位與 __getitem__() 返回的相同。

引數:

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

返回:

包含以下元素的元組;

str

音訊路徑

int

取樣率

str

轉錄文字

int

發言人 ID

int

章 ID

int

話語 ID

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深入教程

檢視教程

資源

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

檢視資源