Created
November 28, 2017 09:25
-
-
Save aneesha/842f047a77f55992bae362b39520fc42 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
# git clone https://github.com/mfaruqui/retrofitting.git | |
# Run retrofit.py with arguments to set the word vectors file, the lexicon file, the number of iterations | |
# and the output word vectors. The word vectors must be in text format | |
# Eg: | |
# python retrofit.py -i word_vec_file -l lexicon_file -n num_iter -o out_vec_file | |
# python retrofit.py -i /data/glove.6B.50d.txt -l /retrofitting/lexicons/ppdb-xl.txt -n 10 -o retrofittedglove.txt | |
# Convert txt based GLOVE word vectors to Word2Vec format | |
from gensim.scripts.glove2word2vec import glove2word2vec | |
glove2word2vec(glove_input_file="/data/glove.6B.50d.txt", word2vec_output_file="glove.6B.50d.word2vec.txt") | |
glove2word2vec(glove_input_file="/data/retrofittedglove.txt", word2vec_output_file="retrofittedglove.word2vec.txt") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment