Spacy: EntityRuler throws Segmentation Fault in complex pattern case

Created on 20 Sep 2018  Â·  4Comments  Â·  Source: explosion/spaCy

How to reproduce the behaviour

import spacy
nlp = spacy.load("en_core_web_lg")
ruler = nlp.create_pipe('entity_ruler')
nlp.add_pipe(ruler, before="ner")
ruler.add_patterns([{"label": "PRODUCT", "pattern": [{"lower": "arial"}, {"lower": "("}, {"lower": "ab987"}, {"lower": ")"}, {"lower": "foo"}, {"lower": "bar"}, {"lower": "baz"}, {"lower": "boo"}]}])
nlp("Arial (ab987) foo bar baz boo")

Results in:Segmentation fault: 11

Your Environment

  • Operating System: Mac OS X (10.13.6)
  • Python Version Used: 3.6.6
  • spaCy Version Used: 2.1.0a1
  • Environment Information: built from commit 1759abf1e5703cb568e0f2de56ed1beb0388a6f6 on develop branch

Related to Issue #2513

bug feat / matcher feat / ner 🌙 nightly

Most helpful comment

Thanks for the report! Fixed on develop now. Will be out in the next nightly.

All 4 comments

Thanks a lot – also for testing the entity ruler with a real-world use case! This is really helpful. I suspect this case might have something to do with how the entity recognizer handles existing entities in this particular case.

Hi,
I too am getting a segmentation fault on this example (which is a common pattern we are using). (I just installed the nightly build using pip install spacy-nightly)

import spacy
nlp = spacy.load("en_core_web_lg")
ruler = nlp.create_pipe('entity_ruler')
nlp.add_pipe(ruler, before="ner")
ruler.add_patterns([{"label": "Age", "pattern":[{"IS_DIGIT":True},{"LOWER":"years"}]}])
nlp("10 years")

Thanks for the report! Fixed on develop now. Will be out in the next nightly.

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.

Was this page helpful?
0 / 5 - 0 ratings