Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Created November 3, 2019 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prateekjoshi565/9e9d480e4803dd204e1020fd38882472 to your computer and use it in GitHub Desktop.
Save prateekjoshi565/9e9d480e4803dd204e1020fd38882472 to your computer and use it in GitHub Desktop.
# train skip-gram (word2vec) model
model = Word2Vec(window = 4, sg = 1, hs = 0,
negative = 10, # for negative sampling
alpha=0.03, min_alpha=0.0007,
seed = 14)
model.build_vocab(random_walks, progress_per=2)
model.train(random_walks, total_examples = model.corpus_count, epochs=20, report_delay=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment