There's a mismatch between set(self.classes) and list(self.classes) and repr(self.classes).
It seems crazy but the pickle.load() chose the repr(self.classes) as the order to save the serialized set. And the only way to json serialize this properly is to load the old pkl file, set classes = repr(classes) before json dump.
Now the doctest on the nltk perceptron tagger in the main repo passes after this revision.
There's a mismatch between
set(self.classes)
andlist(self.classes)
andrepr(self.classes)
.It seems crazy but the
pickle.load()
chose therepr(self.classes)
as the order to save the serialized set. And the only way to json serialize this properly is to load the old pkl file, setclasses = repr(classes)
before json dump.Now the doctest on the nltk perceptron tagger in the main repo passes after this revision.