Keyword search versus search by meaning
The same question, two ways. Keyword search matches words; meaning search compares embeddings.
Keyword search (BM25)
Scores sentences that contain your exact words, weighting rare words more.
No sentence contains any of your words, so keyword search finds nothing.
Search by meaning (embeddings)
Embeds every sentence and your query, then ranks by cosine similarity.
Runs a real model in your browser
Embed each sentence and your query to rank by meaning. This uses all-MiniLM-L6-v2, a small sentence-embedding model that maps text to 384 numbers.
The first time, your browser downloads about 24 MB of model files from Hugging Face, plus a 14 MB runtime from this site. Both are cached for later visits. Everything runs on your device; nothing you type is sent anywhere.
Try this
- Find a query where keyword search wins and one where embedding search wins.
- Add a sentence that shares many words with a query but means something else. Which method is fooled?