Skip to content

Instantly share code, notes, and snippets.

@a-agmon
Created March 29, 2021 13:57
Show Gist options
  • Save a-agmon/7cf70f448c40f58f47badab51431076a to your computer and use it in GitHub Desktop.
Save a-agmon/7cf70f448c40f58f47badab51431076a to your computer and use it in GitHub Desktop.
# text_parts is a dictionary in which each key is a userID and the corresponding values are the items the user engaged with
# vector_size is the size of the embedding vector or the latent factors dimension
# window should be set to the max # of items of the user with the greatest # of items
model = Word2Vec(text_parts.values(), min_count=3, vector_size=20, window=36, sg=1, ns_exponent=-0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment