speech_commands#

(s3prl.dataio.corpus.speech_commands)

Parse the Google Speech Commands V1 corpus

Authors:
  • Leo 2022

  • Cheng Liang 2022

SpeechCommandsV1#

class s3prl.dataio.corpus.speech_commands.SpeechCommandsV1(gsc1: str, gsc1_test: str, n_jobs: int = 4)[source][source]#

Bases: Corpus

Parameters:

dataset_root (str) – should contain a ‘dev’ sub-folder for the training/validation set and a ‘test’ sub-folder for the testing set

static split_dataset(root_dir: Union[str, Path], max_uttr_per_class=134217727) Tuple[List[Tuple[str, str]], List[Tuple[str, str]]][source][source]#

Split Speech Commands into 3 set.

Parameters:
  • root_dir – speech commands dataset root dir

  • max_uttr_per_class – predefined value in the original paper

Returns:

[(class_name, audio_path), …] valid_list: as above

Return type:

train_list

static parse_train_valid_data_list(data_list, train_dataset_root: Path)[source][source]#
static parse_test_data_list(test_dataset_root: Path)[source][source]#
static path_to_unique_name(path: str)[source][source]#
classmethod list_to_dict(data_list)[source][source]#
property all_data[source]#

Return: Container: id (str)

wav_path (str) class_name (str)

property data_split_ids[source]#
classmethod download_dataset(tgt_dir: str) None[source][source]#
property data_split[source]#
static dataframe_to_datapoints(df: DataFrame, unique_name_fn: callable)[source]#