Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gensim.models.keyedvectors import KeyedVectors
- # Convert binary file to text file
- w2v_model = KeyedVectors.load_word2vec_format('Path to bin file', binary=True)
- w2v_model.save_word2vec_format('Path to output', binary=False)
- # Convert text file to binary file
- w2v_model = KeyedVectors.load_word2vec_format('Path to text file', binary=False)
- w2v_model.save_word2vec_format('Path to output', binary=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement