ecg-qa
ecg-qa copied to clipboard
Error in Preprocessing
When I run the preprocess script, I encounter an error.
Traceback (most recent call last): File "/data/work/TimeLLM/ecg-qa/preprocess_ecgqa.py", line 198, in
main(args) File "/data/work/TimeLLM/ecg-qa/preprocess_ecgqa.py", line 109, in main sample["answer"] = encode_answer(sample_data["answer"], classes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/work/TimeLLM/ecg-qa/preprocess_ecgqa.py", line 150, in encode_answer idx = [classes[a] for a in answer if a != "none"] ~~~~~~~^^^ KeyError: 'late stage of myocardial infarction'
Replacing "late stage of myocardial infarction" with "old stage of myocardial infarction" in the file "ecgqa/ptbxl/train/110000.json" "ecgqa/ptbxl/valid/20000.json""ecgqa/ptbxl/test/20000.json" resolves the error.