1
$\begingroup$

I am trying to apply word2vec/doc2vec to find similar sentences. First consider word2vec for word similarity. What I understand is, CBOW can be used to find most suitable word given a context, whereas Skip-gram is used to find the context given some word, so in both cases, I am getting words that co-occurs frequently. But how does it work to find similar words? My intuition is, since similar words tend to occur in similar contexts, the words similarity is actually measured from the similarity among contextual/co-occuring words. In the neural net, when the vector representation for some word at the hidden layer is passed through the output layer, it outputs probabilities of co-occuring words. So, the co-occuring words influence the vector of some words, and since similar words have similar set of co-occuring words, their vector representations are also similar. To find the similarity, we need to extract the hidden layer weights (or vectors) for each word and measure their similarities. Do I understand it correctly?

Finally, what is a good way to find tweet text (full sentence) similarity using word2vec/doc2vec?

$\endgroup$
0
$\begingroup$

The important thing is getting vectors for each word. The similarity is captured from the context. Words with similar context end up with similar vectors.

The similarity can be calculated using cosine similarity or euclidean distance on word vectors. No neural network is involved here

Yes, the vectors are extracted from the hidden layer weights.

There is already algorithm which calculates the document distance using word embedding. You can find the paper here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.