Skip to content

Adding custom components to existing config file but keep receiving 'Can't find factory' errors #12838

Discussion options

You must be logged in to vote

After speaking with some more experienced developers, I was told to use:

sentence.py:

Language.component("sentence_splitter", func=sentence_splitter)

instead of

nlp = spacy.load("en_core_web_lg")
nlp.add_pipe("sentence_splitter", name="sentence_splitter", after='ner')

and
for matcher.py

Language.factory("matcher", func=create_template_matcher)

instead of

nlp = spacy.load("en_core_web_lg")
nlp.add_pipe("matcher", name="matcher", after ='parser')

So far this seems to have worked and passed the config debug command and has successfully trained.
I hope this is useful in the future for someone else.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@rmitsch
Comment options

Answer selected by Norky101
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage General spaCy usage
3 participants