Practical ยท feature-extraction ยท WASM
Once text is a vector, features become arithmetic. Here are two, running entirely on your device with mxbai: prompted semantic search (the retrieval-prompt convention, done right) and near-duplicate detection (collapse "same thing, different words"). Both are the backbone of real search and data-cleaning pipelines.
Everything below runs on these lines. Documents are embedded plain; only the query gets the retrieval prompt.
Rank every line by meaning against a query โ the query is embedded with the retrieval prompt, the documents plain.
Find every pair of lines whose cosine similarity is above the threshold โ the "same intent, different words" pairs a keyword match would miss. Drag the threshold to tighten or loosen what counts as a duplicate.