View source: R/get_similarity_matrix.R
get_similarity_matrix | R Documentation |
Create a matrix of pairwise similarities between each string in strings_A
and strings_B
.
get_similarity_matrix(embeddings, strings_A = NULL, strings_B = NULL)
embeddings |
A matrix of text embeddings |
strings_A |
A string vector |
strings_B |
A string vector |
A matrix of cosine similarities between the embeddings of strings_A and the embeddings of strings_B
## Not run:
embeddings <- get_embeddings(c('UPS', 'USPS', 'Postal Service'))
get_similarity_matrix(embeddings)
get_similarity_matrix(embeddings, 'Postal Service')
get_similarity_matrix(embeddings, 'Postal Service', c('UPS', 'USPS'))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.