Skip to content
Discussion options

You must be logged in to vote

Retraining the output layer is one of the possibilities that is worth trying. In spaCy, the hidden representations are made by the tok2vec component in a pipeline (or transformers if you are using transformers). You can freeze the tok2vec weights by putting adding it to the frozen_components option of the training section:

[training]
frozen_components = ["tok2vec"]

With this change, tok2vec is not called during training, so you need to add tok2vec to the list of annotating components as well, so that the textcat pipe still gets hidden representations from tok2vec:

[training]
frozen_components = ["tok2vec"]
annotating_components = ["tok2vec"]

To reuse the tok2vec parameters you can sourc…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wwpobt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
training Training and updating models feat / textcat Feature: Text Classifier
2 participants