Skip to content

Instantly share code, notes, and snippets.

@rajeshmr
Created December 7, 2017 10:32
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 rajeshmr/d163535758139e1637833c9e34ca8caa to your computer and use it in GitHub Desktop.
Save rajeshmr/d163535758139e1637833c9e34ca8caa to your computer and use it in GitHub Desktop.
print("Odd word out:", word2vec.doesnt_match("banana apple grapes carrot".split()))
print("-"*10)
print("Cosine similarity between TV and HBO:", word2vec.similarity("tv", "hbo"))
print("-"*10)
print("Most similar words to Computers:", ", ".join(map(lambda x: x[0], word2vec.most_similar("computers"))))
print("-"*10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment