How to change the parameters of model

Hi all,

When I start with a blank spacy model, create and add textcat to pipeline , then use nlp.begin_training() , a default Textcategorizer model with input dimension of 300 would be generated. But can I modify the parameters ? For example, if I load pre-trained embeddings of 100 dimension, where can I modify the input size of model from 300(default) to 100?

It seems that I could use use_params, but I could not figure out the format of arguments of this function.

Could anyone help me with this problem? Thank you!

Apologies that this isn’t well documented. I had to look up the code myself to figure it out, but the following should work:

from spacy.pipeline import TextCategorizer

textcat = TextCategorizer(nlp.vocab, width=64, pretrained_dims=100)
1 Like