Topics

In word2vec, the context window size determines how many surrounding words are considered as context. Taking the example of skip-gram algo, instead of using a fixed window size, dynamic window size means that for each center word, the window size is randomly sampled between 1 and (the maximum window size)

Example

If , then for the sentence The quick brown fox jumps over the lazy dog:

  • For the center word “fox”, the model may sample , meaning it only considers the words “brown” and “jumps” (1 word on each side) as context
  • For some other word “over”, it might sample , and include “fox”, “jumps”, “the”, and “lazy” as the context