Skip to content

Instantly share code, notes, and snippets.

@alfredfrancis
Created July 7, 2018 08:26
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 alfredfrancis/a88bcd5e8d42a2bd53aca9f044019c67 to your computer and use it in GitHub Desktop.
Save alfredfrancis/a88bcd5e8d42a2bd53aca9f044019c67 to your computer and use it in GitHub Desktop.
# import modules & set up logging
import gensim, logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
sentences = [['first', 'sentence'], ['second', 'sentence']]
# train word2vec on the two sentences
model = gensim.models.Word2Vec(sentences, min_count=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment