1. Home
  2. Explore
  3. Computer Science
  4. Word Embedding

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Word Embedding

  • 21Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Foundations of Word Representation
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is 1-of-N encoding for word representation?

Tap to flipClick to flipspace

Each word is represented by a vector of size equal to the vocabulary (e.g., 100,000). Only one dimension is 1 (corresponding to the word’s index) and all others are 0.

Or swipe the card

21 cards

  1. What is 1-of-N encoding for word representation?

    Each word is represented by a vector of size equal to the vocabulary (e.g., 100,000). Only one dimension is 1 (corresponding to the word’s index) and all others are 0.

  2. What is a major limitation of 1-of-N encoding?

    It cannot capture any similarity between words; all vectors are independent and equally distant.

  3. What is Word Class representation?

    Words are clustered into classes (e.g., 'dog', 'cat' → class 1; 'flower', 'tree' → class 3) and each word is represented by its class ID.

  4. What is Word Embedding?

    Each word is projected into a low-dimensional continuous vector space (e.g., 50–100 dimensions) where semantically similar words are close.

  5. Why is Word Embedding considered an unsupervised learning problem?

    We have only input (words) but no predefined output vectors; the model learns embeddings purely from text data without explicit labels.

  6. Can auto-encoders be used for Word Embedding with 1-of-N encoding input?

    No, because 1-of-N vectors are independent; an auto-encoder would learn trivial identity mapping and fail to produce informative embeddings.

  7. What is the core idea of Count-based methods for Word Embedding (e.g., GloVe)?

    If two words co-occur frequently in the same document, their embedding vectors should be close (measured by inner product).

  8. How does GloVe formulate the relationship between word vectors and co-occurrence counts?

    It minimizes the difference between V(wi)⋅V(wj)V(w_i) \cdot V(w_j)V(wi​)⋅V(wj​) and log⁡Nij\log N_{ij}logNij​, where NijN_{ij}Nij​ is the number of times wiw_iwi​ and wjw_jwj​ co-occur in a document.

  9. What is the basic idea of Prediction-based methods for Word Embedding?

    Train a neural network to predict a word from its context (e.g., given previous words, predict the next word). The hidden layer activations are used as word embeddings.

  10. In a simple prediction-based model, what is the input and output?

    Input: 1-of-N encoding of previous word(s). Output: probability distribution over the vocabulary for the next word.

  11. Why must weights for different context positions be tied (shared) in prediction-based models?

    To ensure the same word gets the same embedding regardless of its position in the context (e.g., as the first or second previous word).

  12. How is weight tying implemented during training?

    Initialize the tied weights to the same values. At each update, the gradients for each tied weight are computed separately, but the update is the average (or each weight gets the sum of gradients from both positions).

  13. What is the Continuous Bag-of-Words (CBOW) model?

    CBOW predicts the current word given its surrounding context (e.g., wi−1w_{i-1}wi−1​ and wi+1w_{i+1}wi+1​). The embedding is taken from the hidden layer after combining context vectors.

  14. What is the Skip-gram model?

    Skip-gram predicts the surrounding context words given the current word (e.g., from wiw_iwi​ predict wi−1w_{i-1}wi−1​ and wi+1w_{i+1}wi+1​).

  15. Why are most successful Word Embedding models not deep (e.g., only one hidden layer)?

    Tomas Mikolov showed that a single hidden layer suffices for good performance; deeper models are computationally heavier and not necessary, enabling training on very large corpora.

  16. What analogy property do Word Embeddings exhibit?

    Vector differences correspond to semantic relationships, e.g., V(king)−V(queen)≈V(uncle)−V(aunt)V(\text{king}) - V(\text{queen}) \approx V(\text{uncle}) - V(\text{aunt})V(king)−V(queen)≈V(uncle)−V(aunt).

  17. How can a machine answer analogy questions using Word Embeddings?

    Compute the target vector: V(Berlin)−V(Rome)+V(Italy)V(\text{Berlin}) - V(\text{Rome}) + V(\text{Italy})V(Berlin)−V(Rome)+V(Italy), then find the word whose embedding is nearest (cosine similarity) in the space.

  18. How can Word Embeddings be used for cross-lingual mapping?

    Learn separate embeddings for each language. Using a bilingual dictionary of known word pairs, train a linear projection to map one language’s vectors to the other’s space.

  19. How are Word Embeddings applied to zero-shot image classification?

    Train a model to map images to the same vector space as word embeddings (e.g., for known classes like 'dog', 'horse'). For a new image of an unseen class (e.g., 'cat'), its projection near the corresponding word vector reveals the class.

  20. What is a key limitation of bag-of-words for document representation?

    It ignores word order, so sentences with the same words but different order (e.g., 'white blood cells destroying an infection' vs. 'an infection destroying white blood cells') have identical representations but opposite meanings.

  21. What are two families of Document Embedding methods?

    Unsupervised (e.g., auto-encoders on bag-of-words, or neural models like Paragraph Vector) and supervised (requiring additional labels like document categories to learn embeddings).

Card 1 of 21
Card 1 of 21

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent