Search⌘ K

Second Mini Project

Explore building a word analogies system using word2vec embeddings where you compute relationships like A is to B as C is to D. Understand vector operations and cosine similarity to find words fitting the analogy and test your function with examples. This lesson enhances your practical NLP skills by applying word embedding concepts.

Introduction to the project

In the previous lesson, we used word2vec vectors to create an odd one out project. In this lesson, we will go one step further and build a word analogies system.

In the word analogies task, we will basically try to complete the sentence A is to B as C is to ____. We try to find the value to be filled in the blank. For example, Man is to Woman as King is to Queen.

In other words, we are trying to find a word, D, such that the associated word vectors are related in the same manner.

B - A = D - C

We will measure the similarity between B - A and D - C using cosine_similarity ...