Comparing Text using Word Vectors

 

  • Word vectors try to represent meaning of words
  • Words which appear in similar context have similar vectors

This will require training word vectors based on a huge corpus of data.

We can use pretrained word vectors using the glove algorithm, Spacy library in python makes it easy to work with.

word vectors tpically have a lenth of few hundreds elements dimensions for word vectors

first pass the string to the nlp object

Using token we iterate over and try to print first few dimensions of the vector

actual values dont matter; what matters is how similar they are to other words

Similarity

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s