Error when adding a Custom components to spaCy? #11181
-
I want to add custom components to spacy pipeline, e.g. add additional metadata to tokens or the document or to add entities. So I build the following ExtractorComponent component that will be added to the spaCy pipeline. However, we create a new custom attribute at the Doc level called doids.
and I use the component like that:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You need to use See: https://spacy.io/usage/processing-pipelines#custom-components |
Beta Was this translation helpful? Give feedback.
You need to use
Language.factory
instead ofLanguage.component
for components that go beyond a simple function (and then also addname
as one the required arguments for__init__
):See: https://spacy.io/usage/processing-pipelines#custom-components