import datasets class NewDataset(datasets.GeneratorBasedBuilder): BUILDER_CONFIGS = [ datasets.BuilderConfig(name="first"), datasets.BuilderConfig(name="second"), ] DEFAULT_CONFIG_NAME = "first" def _info(self): return datasets.DatasetInfo( features=datasets.Features({"text": datasets.Value("string")}), ) def _split_generators(self, dl_manager): return [datasets.SplitGenerator(name=datasets.Split.TRAIN)] def _generate_examples(self): for key in range(5): yield key, {"text": f"{self.config.name}-{key}"}