Description Usage Arguments Value
Returns the cosine similarity between 2 vectors
1 | cosine_similarity(query_vector, tfidf_matrix, tfidf_crossprod_mat)
|
query_vector |
A vector to compare to the tf-idf matrix. Length of vector is equal to number of columns of tf-idf matrix |
tfidf_matrix |
Sparse tf-idf matrix (computed from |
tfidf_crossprod_mat |
The cross-product matrix for the tf-idf matrix (computed with |
Cosine similarity between query vector and each *row* in tf-idf matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.