Skip to content

Instantly share code, notes, and snippets.

View tmdavid's full-sized avatar

David tmdavid

  • Barcelona
View GitHub Profile
@tmdavid
tmdavid / word_embedding_vis.py
Last active September 20, 2019 01:32
Visualize word embeddings, using tsne.
"""
Visualize word embeddings, using tsne.
First computes cosine distance of the 100 closests words, and then shows a clustering graph
of the first 11 closest words (the first one is always the word)
IT REQUIRES GLOVE MODEL.txt
line 31: glove_file = '../TBIR/glove.840B.300d.txt' MODIFY with the appropiate path
To Use it, you can just type: python word_embedding_vis.py <list of words space separated>
e.g: python word_embedding_vis.py cake word embedding music
"""