Skip to content
Discussion options

You must be logged in to vote

Hi @CarlosGMPZ,

I see what you're trying to do here, and the best approach will be to get your two components into one pipeline.

To get this to work, you just have to give them each a unique name. If you don't do that, they take the factory name "hf_token_pipe" by default and the second one will complain that the name already exists. You can set a different name with nlp.add_pipe(..., name=XXX).

Then we need to make a few more adjustements. If you set both of them to "annotate": "ents" then yes, the second one will overwrite the first, which is not what we want. Instead, we'll let both components store their results in doc.spans, each using a unique key, like so:

"annotate": "spans",
"ann…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by svlandeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage General spaCy usage feat / pipeline Feature: Processing pipeline and components
2 participants