Parser fails with lots of "!"
While working with Kaggle Competition https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge/, the nlp routine was getting stuck while processing a text with a lot of "!". The text is part of test dataset, which is most likely a augmented text to fool the algorithms.
Details of the issue can be found at @ https://www.kaggle.com/c/jigsaw-toxic-comment-classification-challenge/discussion/46218
In short the nlp fails to process text (trimmed here):
nlp = spacy.load('en_core_web_sm')
text = ... #loaded from the dataset
print(text)
nlp(text)
Some word!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!...
If you're looking for help with your code, consider posting a question on StackOverflow instead: http://stackoverflow.com/questions/tagged/spacy -->
Your Environment
- spaCy version: 1.9 and 2.0.5
- Platform: Linux-4.10.0-42-generic-x86_64-with-debian-stretch-sid
- Python version: 3.5 and 3.6.1
- Models: en_core_web_sm, en
I can confirm this issue. I've done a few tests and parsing 20k ! symbols is really slow comparing to parsing ~80k symbols consisting of words.
Related issue: #1765
Thanks for the report; I regret not being able to see to this sooner (I was on holidays, and then sick).
This comes back to the current weird non-linearities in the tokenizer regex. I'm very unhappy with the state of this --- I consider the current behaviour a minor shame upon my house :angry: . Looking forward to getting it fixed.
Merging this with #1765!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.