October 2018
Intermediate to advanced
472 pages
10h 57m
English
Once we have configured the gensim word2vec object, we need to give the model some training. Be prepared, as this might take some time depending on the amount of data and the computation power you have. In this process, we have to define the number of epochs we need to run, which can vary depending on your data size. You can play around with these values and evaluate your word2vec model's performance.
Also, we will save the trained model so that we can use it later on while building our language models:
"""**Start training, this might take a minute or two...**"""model2vec.train(sentences ,total_examples=model2vec.corpus_count , epochs=100)"""**Save to file, can be useful later**"""if not os.path.exists(os.path.join("trained",'sample')): ...Read now
Unlock full access