Closed Enantiodromis closed 3 years ago
I got the same error as @Enantiodromis and tried to fix it as shown in the above commit.
The error is raised in the following line:
raw_indexes = [(processed[i].text, processed[i].idx, exp['prediction']) for i in idxs]
in cases where the input string is truncated (see commit details), thus leading to strings of fewer tokens than the original input string. When the anchor index is the last token (or one of the last tokens) of the input, then such token is lost, thus raising the above IndexError ("Attempt to access token at 26, max length 26").
Hey!
I am encountering an error that I cannot seem to resolve. The error does not occur every time I run an explanation but more often than not. The error occurs when using the save_to_file function.
CODE SNIPPET
ERROR MESSAGE
I am not sure if there is an error that lies with my implementation or not... perhaps a tokenizer issue?
Any insight as always would be greatly appreciated!
Thanks!