In example 06.1 (Question matching), the sim_model calculates the similarity between two embeddings - those of the title and those of the body. If I'd like to predict the closest matching body given a title, is there a better way to do this other than loop over every possible combination of [title, body], extract the corresponding similarity, then output the body corresponding to the highest similarity? For large datasets such an approach would be far too slow.
You should be able to get this done similarly to how the inverse image search works using Postgres or you can use Scikit-Learn's k-nearest neighbors if you want to do this in memory.
Hello,
In example 06.1 (Question matching), the sim_model calculates the similarity between two embeddings - those of the title and those of the body. If I'd like to predict the closest matching body given a title, is there a better way to do this other than loop over every possible combination of [title, body], extract the corresponding similarity, then output the body corresponding to the highest similarity? For large datasets such an approach would be far too slow.