reader_config = config["dataset_reader"]
reader = get_model(reader_config["name"])()
data_path = expand_path(reader_config.get("data_path", ""))
kwargs = reader_config.copy()
if "name" in kwargs: del kwargs["name"]
if "data_path" in kwargs: del kwargs["data_path"]
data = reader.read(data_path, **kwargs)
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"]