espnet3.components.data_organizer.DatasetConfig
espnet3.components.data_organizer.DatasetConfig
class espnet3.components.data_organizer.DatasetConfig(name: str, dataset: Dict[str, Any] = None, transform: Dict[str, Any] | None = None)
Bases: object
Configuration class for dataset metadata and construction.
This class encapsulates the necessary fields to define and instantiate a dataset. Used with Hydra to allow modular and flexible configuration via YAML or dictionaries.
name
Name identifier for the dataset.
- Type: str
path
Optional path or ID required for dataset instantiation.
- Type: Optional[str]
dataset
A dictionary for Hydra instantiation of the dataset.
- Type: Dict[str, Any]
transform
A dictionary for Hydra instantiation of a transform applied to each sample after loading.
- Type: Optional[Dict[str, Any]]
Example
>>> cfg_dict = {
... "name": "custom",
... "dataset": {
... "_target_": "my_project.datasets.MyDataset",
... },
... "transform": {
... "_target_": "my_project.transforms.uppercase_transform"
... }
... }
>>> config = DatasetConfig.from_dict(cfg_dict)dataset
static from_dict(cfg: Dict[str, Any]) β DatasetConfig
Create a DatasetConfig instance from a plain dictionary.
- Parameters:cfg (Dict *[*str , Any ]) β Dictionary containing keys matching DatasetConfig fields.
- Returns: Parsed configuration object.
- Return type:DatasetConfig
name
transform
