Skip to content
Discussion options

You must be logged in to vote

There's not a built-in method, but you can just iterate over the vectors to get the plain text word2vec format:

print(nlp.vocab.vectors.n_keys, nlp.vocab.vectors.shape[1])
for word in nlp.vocab.vectors:
    print(nlp.vocab.strings[word], " ".join(str(x) for x in nlp.vocab.vectors[word]))

There are probably better or faster ways to do the vector printing/formatting with numpy, but this should work.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ines
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / vectors Feature: Word vectors and similarity
2 participants