All jobs / Data science / ML / AI / NLP

Data science / ML / AI interview question · 3–5 years

Your search matches queries to documents by averaging word2vec vectors of the words. Users searching “river bank” get pages about savings accounts.

What is the limitation, and what do you change?

The strongest answer

Static embeddings give one vector per word regardless of context, so both senses of “bank” share it and averaging blurs everything; a contextual model (BERT-style or a sentence-embedding model) encodes the phrase as a whole, sense included

Why it works

Exactly — one-vector-per-word cannot represent polysemy; contextual encoders produce different vectors for the same word in different sentences.

What a good answer covers

Answers that fall short

Who gets asked this

More NLP questions