Created
November 28, 2017 09:26
-
-
Save aneesha/e249d5b69d929a438156b5e9469f823a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load the original word vectors and the retrofitted word vectors as separate gensim models | |
original_glove_model = gensim.models.KeyedVectors.load_word2vec_format('glove.6B.50d.word2vec.txt', binary=False) | |
retrofitted_glove_model = gensim.models.KeyedVectors.load_word2vec_format('retrofittedglove.word2vec.txt', binary=False) | |
# display the words closest to 'happy' using the original GLOVE vectors | |
display_closestwords_tsnescatterplot(original_glove_model, 'happy', 50, 10, "Original Glove Word Vectors - 'Happy'") | |
# display the words closest to 'happy' using the GLOVE vectors retrofitted with the Paraphrase lexicons | |
display_closestwords_tsnescatterplot(retrofitted_glove_model, 'happy', 50, 10, "Retroffited Glove Word Vectors - 'Happy'") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment