spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Parser fails with lots of "!"

Open Mageswaran1989 opened this issue 8 years ago • 5 comments

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

Mageswaran1989 avatar Dec 26 '17 04:12 Mageswaran1989

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.

fucking-signup avatar Jan 01 '18 01:01 fucking-signup

Related issue: #1765

Liebeck avatar Jan 03 '18 10:01 Liebeck

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.

honnibal avatar Jan 12 '18 21:01 honnibal

Merging this with #1765!

ines avatar Aug 15 '18 14:08 ines

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.

lock[bot] avatar Sep 14 '18 14:09 lock[bot]