Skip to content

NER component in en_core_web_trf doesn't depend on transformer #13328

Discussion options

You must be logged in to vote

I suppose ner should depend upon transformer.

That's right - it does. In the config file for en_core_web_trf, you can see the following:

[components.ner.model.tok2vec]
@architectures = "spacy-curated-transformers.LastTransformerLayerListener.v1"
upstream = "transformer"

which means that the ner component relies on the transformer component. If you don't enable the latter, the output will be random/nonsensical.

I can see how this behaviour is a bit surprising if you're not used to the config details, especially as no warning is given. It's a bit of an unfortunate side effect of how the listener mechanism works. You might not be interested in all the technical details (🙈) but there's a s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@frankier
Comment options

Answer selected by frankier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / ner Feature: Named Entity Recognizer feat / pipeline Feature: Processing pipeline and components feat / ux Feature: User experience, error messages etc. feat / transformer Feature: Transformer
2 participants
Converted from issue

This discussion was converted from issue #13325 on February 14, 2024 17:10.