Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visualize a Word2Vec model using Embedding Projector

What is the best way to visualize a Word2Vec model using TensorFlow's Embedding Projector? is there a way to export the Word2Vec model's vectors to the format that Embedding Projector expects? or is there a built in function in tensorflow for that?

Thanks!

like image 844
Codir Avatar asked Nov 24 '25 10:11

Codir


1 Answers

Save your model using

model = Word2Vec(sentences)
model.wv.save_word2vec_format('model_name')

And then convert the model to the input files required by Embedding Projector:

python -m gensim.scripts.word2vec2tensor --input model_name --output model_name

This will produce both: model_name_tensor.tsv and model_name_metadata.tsv

This last script was introduced in a PR from the issue linked in a comment in your original question.

like image 173
Leonel Galán Avatar answered Nov 27 '25 14:11

Leonel Galán



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!