from datasets import load_dataset requests_dataset = load_dataset('EnergyStarAI/requests_debug')['test'] def normalize_task(task): # Makes assumption about how the task names are being written, and called. return '_'.join(task.split()).lower() for request in requests_dataset: status = request['status'] if status == 'PENDING': model = request['model'] task = normalize_task(request['task']) print("%s,%s" % (model, task))