ground_truth = json.loads(sample["ground_truth"]) KeyError: 'ground_truth'
作者: monarchmio创建于 2024年10月10日更新于 2025年6月7日
我使用的是自己创建的数据集,JSON 文件的内容格式如下: {"file_name": "document_100.png", "ground_truth": "{\"gt_parse\": {\"patient_id\": 659136, \"patient_name\": \"中村 篤司\", \"amount\": \"¥21,976.00\", \"date\": \"1983-06-13\", \"hospital\": \"東京病院\", \"description\": \"入院费用\"}}"} 在训练时,我在执行 ground_truth = json.loads(sample["ground_truth"]) 时遇到错误 KeyError: 'ground_truth'。如何解决这个问题?
内容来源: clovaai/donut