Word embeddings

Step 4 of 10 in NLP · Build · Medium

Learn dense vectors by predicting nearby words. Words used in similar contexts get similar vectors (king − man + woman ≈ queen).

Build it

  1. Skip-gram

    Skip-gram with negative sampling on text8 in PyTorch.

    Done when: Sensible nearest neighbours for 5 words.

Case study: Bias in word embeddings

  • Embeddings learned 'man : programmer :: woman : homemaker'.
  • Models absorb the statistics of their training text, including stereotypes.
  • Proposed debiasing showed the bias can be measured, but not fully removed.

Read the case study

Resources

Earn this star

On the map, you log what you built. Finish the step and its star lights.

Open this step on the map