You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The evaluation on the validation set crashes at line 62 when there is a misspelled word is correctly detected but incorrectly classified.
Example from page1037.json:
[DETECTION MATCH] page1037.text.list.1.item.6.s.1.w.3: hobbies -> Hobies
[INCORRECT] Should be: hobby's
Traceback (most recent call last):
File "./CLIN28_ST_spelling_correction/clin28tools/evaluate.py", line 93, in <module>
main()
File "./CLIN28_ST_spelling_correction/clin28tools/evaluate.py", line 62, in main
print("[DETECTION WRONG] " + ";".join(outcorrection['span']) + ": " + " ".join([ outdata[wordid]['text'] for wordid in outcorrection['span'] ]) + " -> " + outcorrection['text'],file=sys.stderr)
File "./CLIN28_ST_spelling_correction/clin28tools/evaluate.py", line 62, in <listcomp>
print("[DETECTION WRONG] " + ";".join(outcorrection['span']) + ": " + " ".join([ outdata[wordid]['text'] for wordid in outcorrection['span'] ]) + " -> " + outcorrection['text'],file=sys.stderr)
File "/home/ebritochac/anaconda3/lib/python3.6/site-packages/clin28tools/format.py", line 89, in __getitem__
return self.data[key]
KeyError: 'page1037.text.list.1.item.1.s.1.w.1'
I changed that line by the following and it seems to work, but maybe I am misunderstanding what it is expected in the json file with the corrections:
Hmm, I'm still a bit puzzled why it goes wrong (hard to reproduce without having your output), but the way you changed the line is fine indeed (the reference text and output text should be the same, so this error shouldn't really happen). Anyway, I now included your fix in case anybody else stumbled on this problem.
The evaluation on the validation set crashes at line 62 when there is a misspelled word is correctly detected but incorrectly classified.
Example from page1037.json:
I changed that line by the following and it seems to work, but maybe I am misunderstanding what it is expected in the json file with the corrections:
The text was updated successfully, but these errors were encountered: