快捷方式

FluentSpeechCommands

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

Fluent Speech Commands [Lugosch et al., 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 的全面开发者文档

查看文档

教程

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

查看教程

资源

查找开发资源并获得问题解答

查看资源