Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AI and Deep Learning by (50.2k points)

I want to create a text file that is essentially a dictionary, with each word being paired with its vector representation through word2vec. I'm assuming the process would be to first train word2vec and then look-up each word from my list and find its representation (and then save it in a new text file)?

I'm new to word2vec and I don't know how to go about doing this. I've read from several of the main sites, and several of the questions on Stack, and haven't found a good tutorial yet.

1 Answer

0 votes
by (108k points)

You see, you cannot actually create a word2vec vector having just one word since word2vec estimates word vectors using context. It is trying to estimate the probability of your word to appear given some other word(s).

Or, in case you meant that you have some trained model, and you want to display a vector for a particular word, you’d better see the documentation of the library you use.

In gensim, for instance, it looks like this:

In[1]: model['computer']

# raw numpy vector of a word Out[1]: array([-0.00449447, -0.00310097, 0.02421786, ...], dtype=float32)

If you are looking to learn more about Artificial Intelligence then you visit Artificial Intelligence Tutorial.  Also, if you are appearing for job profiles of AI Engineer or AI Expert then you can prepare for the interviews on Artificial Intelligence Interview Questions.

Browse Categories

...