A comparison of skip-gram and CBOW model architectures

The following diagram shows a comparison of the CBOW and skip-gram model architectures:

This diagram shows how skip-gram learns to predict the target word by using the words nearby. On the other hand, CBOW learns to predict the target word based on the words present in its context, which is represented as a bag-of-words, present in a fixed-size window that is around the target word.

In general, the skip-gram approach tends to produce better word representations when the datasets are larger. Hence, we will concentrate on building a skip-gram model for the rest of this chapter. We will also look at how to visualize the trained word embeddings by using TensorBoard. Such a visualization would allow us to get the intuitions behind word embeddings. The following section will walk through the code and analyze the results.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset