Gate: word vectors for a new world (AI off)
Why it matters Building word vectors from raw sentences, checking what they learned, and taking out a skew they copied, alone, is this module in one task.
AI tutor off. The check gives your functions a world you have not seen: new sentences from another seed, with nurse and engineer skewed towards she and he. Nothing about it is in your namespace.
Words and symbols in this lesson
- window
- how many words either side count as a word's company
- PPMI
- how much more often two words meet than chance would give, with negatives set to 0
- skew
- a lopsided pattern in the data that the vectors copy
Write word_vectors(sents, vocab): count co-occurrences inside each sentence with your choice of window WINDOW, and return ppmi(counts), one row per word of vocab. Write debias(X, vocab): return a copy of X in which the four jobs (nurse, engineer, doctor, teacher) have had the gender direction taken out (unit vectors, four pairs, as in the last lesson), every other row unchanged. The check scores the 72 analogies on its own world (at least 95% right) and then measures each job's position on the gender direction after your debias (all within 0.05 of zero).
AI off: no tutor, hints or worked solution on this one. Your own thinking only.
Spotted a problem in this lesson? Report it · Ask about this lesson
This exercise opens soon
Finish the lesson before it and this one unlocks. The whole course is free, no account needed, and you can read this lesson right now.
This browser is blocking cookies for learn.floati.life, so lessons you finished here cannot open in order. Allow cookies for this site and reload.