semantic_router.linear.similarity_matrix#

semantic_router.linear.similarity_matrix(xq: ndarray, index: ndarray) ndarray#

Compute the similarity scores between a query vector and a set of vectors.

Args:

xq: A query vector (1d ndarray) index: A set of vectors.

Returns:

The similarity between the query vector and the set of vectors.