You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The model does not build new vocabs for new input words from add_keyword_corpus. The model would only build_vocab() during initialization (inside mixin class) and during training (if train_embed() has input sentences or keywords).
from embedding import SecWord2Vec
keywords = ['hello', 'cat']
sentences = ['hello world test', 'this is a cat']
model = SecWord2Vec(keywords, sentences, min_count=1, size=10)
print('After initialized:')
print('vocabs: {}'.format(model.wv.vocab.keys()))
model.add_keyword_corpus('dog', ['that is a dog', 'cats are adorable'])
print('\nAfter adding new keyword corpus:')
print('vocabs: {}'.format(model.wv.vocab.keys()))
model.train_embed()
print('\nAfter training:')
print('vocabs: {}'.format(model.wv.vocab.keys()))
The text was updated successfully, but these errors were encountered:
The model does not build new vocabs for new input words from add_keyword_corpus. The model would only build_vocab() during initialization (inside mixin class) and during training (if train_embed() has input sentences or keywords).
The text was updated successfully, but these errors were encountered: