| from datasets import Dataset |
| from huggingface_hub import login |
| import json |
| |
| with open("norwegian_medical_qa_v2.json") as f: |
| raw_data = json.load(f) |
|
|
| |
| processed_data = [] |
| for item in raw_data: |
| wrong_answers = item["wrong_answers_text"] |
| |
| processed_data.append({ |
| "question": item["question_text"], |
| "answer": item["answer_text"], |
| "wrong_answers": wrong_answers, |
| "source_file": item["source_file"], |
| "question_number": item["question_number"] |
| }) |
|
|
| |
| dataset = Dataset.from_list(processed_data) |
|
|
| |
| dataset.push_to_hub("SimulaMet/NorMedQA") |
|
|