Update 'ner' tok2vec embeddings during training #10423
-
Based on my understanding of the 'ner' component, tok2vec (
and I have some code to extract the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's hard to know for sure without more info about the pipeline config and your custom code. If your If you have a separate In general, we strongly recommend using |
Beta Was this translation helpful? Give feedback.
It's hard to know for sure without more info about the pipeline config and your custom code.
If your
ner
has an internaltok2vec
model (vs. listening to separatetok2vec
component), then its weights should be updated in this loop.If you have a separate
tok2vec
component (which is the pipeline design you'd get from the quickstart orinit config
), then it won't be updated because you've disabled it in this context withnlp.disable_pipes
.In general, we strongly recommend using
spacy train
instead of a custom training loop like this. If you want to do it programmatically,spacy train
is just a CLI wrapper around training methods that you can call directly if you wish.