sklearn-crfsuite
sklearn-crfsuite copied to clipboard
TypeError when printing model info
The library often throws this TypeError when trying to print state features of general information about the model. It seems that the internal regex match is coming back as a None which causes a NoneType error when isolating the regex groups.
This is quite annoying and something as straightforward as a mismatched regex shouldn't break the build. Is there a quick fix for this or do you have an intuition as to why the regex match is coming back with a None?
I spent some time debugging this and it seems that whenever there is a new line character within the feature the regex fails to match it causing the TypeError. Using regex in Python the dot character doesn't include the new-line character. A quick fix would be to update the regex to ([\s\S]+)
instead of of (.+)