semantic_router.linear.similarity_matrix#
- semantic_router.linear.similarity_matrix(xq, index)#
Compute the similarity scores between a query vector and a set of vectors.
- Return type:
ndarray
- Args:
xq: A query vector (1d ndarray) index: A set of vectors.
- Returns:
The similarity between the query vector and the set of vectors.