text_plain_output_1.png image_output_1.png
from datasets import load_dataset

from datasets import load_dataset
train_ds = load_dataset('miladfa7/5-Flower-Types-Classification-Dataset')

train_ds = train_ds['train'].train_test_split(test_size=0.15)
train_data = train_ds['train']
test_data = train_ds['test']

label = list(set(train_data['label']))
id2label = {id: label for id, label in enumerate(label)}
label2id = {label: id for id, label in id2label.items()}
print(id2label, label2id)