CLI training "Can't find factory" #13138
Replies: 1 comment
-
figured out my issue needed to add training paths to config file and the --code worked after that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I created a pipeline using Python and the nlp.add_pipe() for a spancat and custom_component. loaded it to disk using the nlp.to_disk() function and then using the generated config file from this which can be seen below.
I am running this code block in a Jupyter Notebook using VS Code:
%%python -m spacy train verisma_model/config.cfg --output training/
--code custom_components.py
--paths.train corpus/train.spacy --paths.dev corpus/eval.spacy
--training.eval_frequency 10
--training.patience 100
--gpu-id -1
--system.seed 0
I get this error: ValueError: [E002] Can't find factory for 'custom_sensitivity_confidence_scorer' for language English (en). This usually happens when spaCy calls
nlp.create_pipe
with a custom component name that's not registered on the current language class. If you're using a Transformer, make sure to install 'spacy-transformers'. If you're using a custom component, make sure you've added the decorator@Language.component
(for function components) or@Language.factory
(for class components).This is my custom_components.py:

And this is my config file pertaining to the custom_component:

Anyone understand why I am getting this error and how to fix it.
Beta Was this translation helpful? Give feedback.
All reactions