import json from datasets import load_dataset dataset = load_dataset("./PxCorpus.py") print(dataset) # for d in dataset["train"]: # if d["label"] != "medical_prescription": # print(d) # print(dataset["train"][168]) # print(json.dumps(dataset["train"][0], sort_keys=True, indent=4))