I created my model using Word2Vec. But the results were not good. So I want to add a word. The code I created the first time Creation is possible, but can not be added. Please tell me how can add.
createModel.py
token = loadCsv("test_data")
embeddingmodel = []
for i in range(len(token)):
temp_embeddingmodel = []
for k in range(len(token[i][0])):
temp_embeddingmodel.append(token[i][0][k])
embeddingmodel.append(temp_embeddingmodel)
embedding = Word2Vec(embeddingmodel, size=300, window=5, min_count=3, iter=100, sg=1,workers=4, max_vocab_size = 360000000)
embedding.save('post.embedding')
loadWord2Vec.py
tokens = W2V.tokenize(sentence)
embedding = Convert2Vec('Data/post.embedding', tokens)
zero_pad = W2V.Zero_padding(embedding, Batch_size, Maxseq_length, Vector_size)
Tell me how to add or merge the results of Word2Vec
There's no easy way to merge two Word2Vec
models.
Only word-vectors that were trained together are "in the same space" and thus comparable.
The best policy would be to combine the two training corpuses of texts, and train a new model on the combined data, thus obtaining word-vectors for all words from the same training session.