xq
: A query vector (1d ndarray)index
: A set of vectors.np.ndarray
: The similarity between the query vector and the set of vectors.
sim
: A similarity matrix.top_k
: The number of top scores to get.Tuple[np.ndarray, np.ndarray]
: The top scores and indices.