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
Related to Issue #2513
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.
Most helpful comment
Thanks for the report! Fixed on develop now. Will be out in the next nightly.