spacy ver 3.2.0: Error when adding multiple ner and entity_ruler pipes to pipeline in code. #10111
-
I am switching from spacy ver 2 to 3. I want my spacy pipeline in the following structure: ["entity_ruler_1", "ner_1", "entity_ruler_2", "ner_2", "entity_ruler_3", "ner_3"] Below is a dummy code to get the error:
The error I get:
I would like to stick to this way of model training only instead of using the terminal. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think that error is happening because you don't have a tok2vec - NER layers need vectorized features to work with, that can be provided by a tok2vec or a transformer. Your model structure is a little different from what we usually see, so we don't have an exact example for it. What I would recommend you do is use the Quickstart to generate a pipeline with just one NER component and look at how it's structured, in particular the |
Beta Was this translation helpful? Give feedback.
I think that error is happening because you don't have a tok2vec - NER layers need vectorized features to work with, that can be provided by a tok2vec or a transformer.
Your model structure is a little different from what we usually see, so we don't have an exact example for it. What I would recommend you do is use the Quickstart to generate a pipeline with just one NER component and look at how it's structured, in particular the
pipeline
entry. If you can use that config (even with an in-code training loop) to train one of your NER models then you know your structure is OK and you can work on adding in your other NER models and entity rulers.