Machine translation and document search
Word vectors make two clever tricks possible. Translation: English and Hindi word vectors are shaped similarly, so we can learn a transformation matrix (R) that maps English vectors onto Hindi ones, then pick the nearest Hindi word. Document search: a whole document can be represented by adding up its word vectors, then we find the documents whose vectors are closest to the question. To search millions of vectors quickly, locality-sensitive hashing (LSH) puts similar vectors into the same "bucket" so we only search nearby.
Everyday analogy
Two cities built on the same plan but with different street names. Learn how one map lines up with the other, and you can find the matching street in the second city. LSH is like first going to the right neighbourhood instead of knocking on every door in the city.
Example
Start with a small dictionary of a few thousand known word pairs (cat → बिल्ली, dog → कुत्ता, house → घर). Learn R from these pairs by repeatedly measuring the gap between X × R and the Hindi vectors and reducing it. Then a word not in the dictionary can be translated by multiplying its vector by R and finding the nearest Hindi word.
Translating with word vectors
Locality-sensitive hashing: search only the right bucket
- Represent each word (or each document, by summing its word vectors) as a vector.
- For translation, learn the matrix R from known word pairs; for search, turn the question into a vector too.
- Use LSH: a few random dividing lines (planes) split the space into buckets, and each vector gets a bucket code.
- Look only inside the query's bucket and find the K nearest neighbours by cosine similarity.
- Return the closest word (translation) or the closest documents (search results).
Try it yourself
About 10 minSearch by meaning
- Write 5 short notes on different topics.
- Ask an AI chatbot which note best answers a question that uses none of the same words.
- Translate one note into Hindi and back to check what is lost.
What you should see: Meaning-based search and translation both rely on word vectors.
Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.