Gensim Word2vec Freeze some wordvectors and Update others
There is! But it's an experimental feature with little documentation – you'd need to read the source to fully understand it, and directly mutate your model to make use of it.
Look through the word2vec.py source for properties ending _lockf – specifically in the latest code, one named vectors_lockf. It's a sort of mask which either allows, weakens, or stops training of certain words. For each word, if it's value is 1.0, normal full backpropagated updates are applied. Any lower value weakens the update – so 0.0 freezes a word against updates. (The potential update is still calculated – so there's no net speedup – it's just multiplied-by-0.0 before final application to particular frozen words.)
Regarding word2vec with gensim,
Suppose you already trained a model on a big corpus, and you want to update it with new words from new sentences, but not update the words which already have a vector.
Is it possible to freeze the vectors of some words and update only some chosen words (like the new words) when calling model.train ?
Or maybe is there a trick to do it ?
Thanks.