fix parsing
some lines have a space " " as a token, like
O
Thanks, I also realized that while debugging and fixed the issue but the error remains. Would you know what could I have missed?
It turns out that both "I-iv-cont-q1" and "I-cv-cont-q1" annotations are not found within any of the .txt files. By removing them from the ClassLabels in the Features, the issue was fixed for the test set. But for the other two splits which only feature a subset of all the possible tags, the problems still exists so it seams that all of the ClassLabels have to appear in every split.
Would there be a way around this behavior? Like defining ClassLabels for each split?
it's not necessary that all the class labels appear in each split content
Ok, thanks for your anwer. Would you then have any further insights on the ValueError raised by _strval2int? The fact that the train split doesn't have any issue but the other two does is really perplexing. I don't see how the string class label value can still be empty after I removed the whitespace tokens.
You do splits = line.split(" ")
which sometimes returns ["", "", "O"]
(see my first comment), and you end up with an invalid label ""
instead of "O"
.
This PR fixes it using splits = line.rstrip().rsplit(" ", 1)
;)
I understand that there are some lines that have a space " " as a token but I changed the tokenization of the dataset upstream to remove all the lines with whitespaces as a token (which I thought should fix the issue). I then still implemented your fixe but the problem remained which is what I don't understand. Sorry if I wan't clear when saying that I had removed such lines.