Bird
0
0

Which of the following is the correct way to initialize a Skip-gram Word2Vec model using the Gensim library in Python?

easy📝 Syntax Q12 of 15
NLP - Word Embeddings
Which of the following is the correct way to initialize a Skip-gram Word2Vec model using the Gensim library in Python?
AWord2Vec(sentences, size=100, window=5, sg=0)
BWord2Vec(sentences, vector_size=100, window=5, sg=0)
CWord2Vec(sentences, size=100, window=5, sg=1)
DWord2Vec(sentences, vector_size=100, window=5, sg=1)
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct parameter for Skip-gram

    In Gensim, 'sg=1' sets Skip-gram, 'sg=0' sets CBOW.
  2. Step 2: Use correct parameter names

    Since Gensim 4.0+, 'vector_size' replaces 'size' for embedding dimension.
  3. Final Answer:

    Word2Vec(sentences, vector_size=100, window=5, sg=1) -> Option D
  4. Quick Check:

    sg=1 and vector_size used correctly [OK]
Quick Trick: Use sg=1 for Skip-gram and vector_size for embedding size [OK]
Common Mistakes:
MISTAKES
  • Using 'size' instead of 'vector_size' in recent Gensim versions
  • Setting sg=0 which is CBOW, not Skip-gram
  • Confusing sg parameter values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NLP Quizzes