word2vec

shape of my dataframe(#rows) and that of final embeddings array doesn't match

shape of my dataframe(#rows) and that of final embeddings array doesn't match Question: I generated the word embeddings for my corpus(2-D List) then tried to generate the Average Word2Vec embeddings for each of the individual word list(that is for each comment which have been converted into a list though split() method) inside my corpus but …

Total answers: 1

Gensim Word2Vec exhausting iterable

Gensim Word2Vec exhausting iterable Question: I’m getting the following prompt when calling model.train() from gensim word2vec INFO : EPOCH 0: training on 0 raw words (0 effective words) took 0.0s, 0 effective words/s The only solutions I found on my search for an answer point to the itarable vs iterator difference, and at this point, …

Total answers: 1

How do I subtract and add vectors with gensim KeyedVectors?

How do I subtract and add vectors with gensim KeyedVectors? Question: I need to add and subtract word vectors, for a project in which I use gensim.models.KeyedVectors (from the word2vec-google-news-300 model) Unfortunately, I’ve tried but can’t manage to do it correctly. Let’s look at the poular example queen ~= king – man + woman. When …

Total answers: 1

Are the document vectors used in doc2vec one-hot?

Are the document vectors used in doc2vec one-hot? Question: I understand conceptually how word2vec and doc2vec work, but am struggling with the nuts and bolts of how the numbers in the vectors get processed algorithmically. If the vectors for three context words are: [1000], [0100], [0010] and the vector for the target word is [0001], …

Total answers: 2

Interpreting negative Word2Vec similarity from gensim

Interpreting negative Word2Vec similarity from gensim Question: E.g. we train a word2vec model using gensim: from gensim import corpora, models, similarities from gensim.models.word2vec import Word2Vec documents = [“Human machine interface for lab abc computer applications”, “A survey of user opinion of computer system response time”, “The EPS user interface management system”, “System and human system …

Total answers: 3

TensorFlow 'module' object has no attribute 'global_variables_initializer'

TensorFlow 'module' object has no attribute 'global_variables_initializer' Question: I’m new to Tensorflow I’m running a Deep learning Assignment from Udacity on iPython notebook. link And it has an error. AttributeError Traceback (most recent call last) `<ipython-input-18-3446420b5935>` in `<module>`() 2 3 with tf.Session(graph=graph) as session: —-> 4 tf.global_variables_initializer().run() AttributeError: ‘module’ object has no attribute ‘global_variables_initializer’ Please …

Total answers: 4

How to load a pre-trained Word2vec MODEL File and reuse it?

How to load a pre-trained Word2vec MODEL File and reuse it? Question: I want to use a pre-trained word2vec model, but I don’t know how to load it in python. This file is a MODEL file (703 MB). It can be downloaded here: http://devmount.github.io/GermanWordEmbeddings/ Asked By: Vahid SJ || Source Answers: just for loading import …

Total answers: 4

What meaning does the length of a Word2vec vector have?

What meaning does the length of a Word2vec vector have? Question: I am using Word2vec through gensim with Google’s pretrained vectors trained on Google News. I have noticed that the word vectors I can access by doing direct index lookups on the Word2Vec object are not unit vectors: >>> import numpy >>> from gensim.models import …

Total answers: 1

gensim word2vec: Find number of words in vocabulary

gensim word2vec: Find number of words in vocabulary Question: After training a word2vec model using python gensim, how do you find the number of words in the model’s vocabulary? Asked By: hlin117 || Source Answers: In recent versions, the model.wv property holds the words-and-vectors, and can itself can report a length – the number of …

Total answers: 4

How to find the closest word to a vector using word2vec

How to find the closest word to a vector using word2vec Question: I have just started using Word2vec and I was wondering how can we find the closest word to a vector suppose. I have this vector which is the average vector for a set of vectors: array([-0.00449447, -0.00310097, 0.02421786, …], dtype=float32) Is there a …

Total answers: 3