快捷方式

FluentSpeechCommands¶

class torchaudio.datasets.FluentSpeechCommands(root: Union[str, Path], subset: str = 'train')[source]

Fluent Speech Commands [Lugosch , 2019] 資料集

引數:
  • root (str 或 Path) – 資料集所在的目錄路徑。

  • subset (str, 可選) – 要使用的資料集的子集。選項:["train", "valid", "test"]。(預設值:"train")

__getitem__¶

FluentSpeechCommands.__getitem__(n: int) Tuple[Tensor, int, str, int, str, str, str, str][source]

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

引數:

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

返回值:

包含以下項的元組;

Tensor

波形

int

取樣率

str

檔名

int

發言人 ID

str

轉錄文字

str

動作

str

物件

str

位置

get_metadata¶

FluentSpeechCommands.get_metadata(n: int) Tuple[str, int, str, int, str, str, str, str][source]

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

引數:

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

返回值:

包含以下項的元組;

str

音訊路徑

int

取樣率

str

檔名

int

發言人 ID

str

轉錄文字

str

動作

str

物件

str

位置

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取適合初學者和高階開發者的深度教程

檢視教程

資源

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

檢視資源