The Skip-Gram model works opposite of the CBOW model. It predicts the context based on the current word. In other words, it uses a central world to predict words appearing before and after the main word. The following figure represents the Skip-Gram model:
Based on the previous diagram, Skip-Gram can be formalized as:
The skip-gram model calculates and sums up the logarithmic probabilities of the previous and next, n, words surrounding the target word, .
The following is code to calculate Word2Vec using ...