ValueError: Cannot get dimension 'nO' for model 'sparse_linear': value unset #10196
-
How to reproduce the behaviourI have a pipeline with three components that can't work together for some reason. Currently I can't make a minimal reproducible example right away - I'd need some pointers on how to locate the issue. The following pipeline pipeline = ["textcat_multilabel", "sentencizer", "financial_entities"] throws this error (when loading the model)
Diving deeper into the error message, reveals that specifically it breaks when building The very odd thing is that the pipeline works just fine in these constellations pipeline = ["textcat_multilabel", "financial_entities"]
pipeline = ["sentencizer", "financial_entities"]
pipeline = ["textcat_multilabel", "sentencizer"] Any ideas how to debug this? Your Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Okay so I finally got a little wiser on the issue. My
in In
All in all I'm confused here but it seems to me that I have one tokenizer when |
Beta Was this translation helpful? Give feedback.
-
Because entity ruler phrase patterns run the pipeline (up to the current position in the pipeline), you want to load patterns in |
Beta Was this translation helpful? Give feedback.
Because entity ruler phrase patterns run the pipeline (up to the current position in the pipeline), you want to load patterns in
initialize
rather than__init__
so that the previous components have already been initialized. The entity ruler itself already supports this directly, but you can add whatever additional kwargs to your method that you need for the custom component: https://spacy.io/api/entityruler#initialize