ERROR: Create an Entity Ruler #10082
-
Hi, I would like to ask for your help because now I am trying to create and entity ruler but I am having the same error -------------Code-------------- nlp=spacy.load("en_core_web_md") Error: ValueError: [E002] Can't find factory for 'ruler' for language English (en). This usually happens when spaCy calls Available factories: attribute_ruler, tok2vec, merge_noun_chunks, merge_entities, merge_subtokens, token_splitter, doc_cleaner, parser, beam_parser, entity_linker, ner, beam_ner, entity_ruler, lemmatizer, tagger, morphologizer, senter, sentencizer, textcat, spancat, textcat_multilabel, en.lemmatizer |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Could you try adding the component with the name
There's also a self-contained example of the entity ruler component in the docs here you can use for reference. If that doesn't work, it looks to me like you've excluded some of the code you might be using. It's not clear to me how |
Beta Was this translation helpful? Give feedback.
-
It looks like you are using both methods to construct an entity ruler. The first is From that snippet you have I think this would resolve the error and also remove one of the two creation methods. nlp=English()
ruler=nlp.add_pipe('entity_ruler')
ruler.add_patterns(patterns) I made this notebook so that I can refer back to some of the nuance around the two methods that can create an entity_ruler if its helpful. |
Beta Was this translation helpful? Give feedback.
Could you try adding the component with the name
"entity_ruler"
and not"ruler"
, like this:There's also a self-contained example of the entity ruler component in the docs here you can use for reference.
If that doesn't work, it looks to me like you've excluded some of the code you might be using. It's not clear to me how
generate_rules
should be working without seeing how you're calling the function and what might exist prior to that call. Could you include a more complete snippet of your code to help us figure out what the issue might be?