lmcinnes / pynndescent

A Python nearest neighbor descent for approximate nearest neighbors
BSD 2-Clause "Simplified" License
899 stars 105 forks source link

Sample identifiers for semantic search #212

Open j-adamczyk opened 1 year ago

j-adamczyk commented 1 year ago

I need to perform semantic search with ANN for images, something similar to Google Lens. For this, I need nearest neighbors from my dataset, calculated on image embeddings. However, I also need an image identifier, to actually go from nearest neighbors to the images they represent. How can I do this?

A similar issue was closed by the author with no solution.

j-adamczyk commented 1 year ago

I found it - query() method returns indices of nearest neighbors. It would be nice to have a semantic search example on the docs, though. I couls make a PR for this, if maintainers agree this would be valuable.

lmcinnes commented 1 year ago

I would love a sematic search example for the docs; I don't have time right now to get it done, so a PR would be greatly appreciated.