dataset_config = config.get("dataset", None)
if dataset_config is not None:
del config["dataset"]
ds_type = dataset_config["type"]
if ds_type == "classification":
reader = {"name": "basic_classification_reader"}
iterator = {"name": "basic_classification_iterator"}
After Change
reader_config = config["dataset_reader"]
reader = get_model(reader_config["name"])()
data_path = expand_path(reader_config.get("data_path", ""))
kwargs = {k: v for k, v in reader_config.items() if k not in ["name", "data_path"]}
data = reader.read(data_path, **kwargs)
iterator_config = config["dataset_iterator"]
dataset: BasicDatasetIterator = from_params(iterator_config, data=data)