O'Reilly logo

Hands-On Natural Language Processing with Python by Rajalingappaa Shanmugamani, Rajesh Arumugam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

From word to document embeddings

Word2vec provided a very elegant method to produce good word vectors. However, sentence-or document-level vector representation is not inherently possible with word vectors, as the number of words in every document is variable. Hence, one of the simplest methods proposed in literature to extend word embeddings to a document is to average the individual word embeddings available in the document.

Therefore, document embedding can now be represented as follows:

In the preceding equation, since we are equally weighting all of the words in the sentence, . Hence, all of the weights are equally weighted to obtain ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required