View source: R/cos_sim2_vectors.R
cos_sim2_vectors | R Documentation |
A wrapper for faster customized inspection of glove models fitted with text2vec package.
cos_sim2_vectors(v_add, v_substract = NULL, n = 10, word_vector_set)
v_add |
Names of word vectors to be added during calculation. |
v_substract |
Names of word vectors to be substracted during calculation. |
n |
Number of resulting vector entries to show, which provide information on the resulting terms, i.e, names of the items. |
word_vector_set |
The full set of word vectors to be used for calculation. |
The resulting cosine similarity vector whose names are terms.
#in the following just a syntax example without data (hence, cannot be run) #for details on fitting glove models please refer to documentation of text2vec # wv_main = glove$fit_transform(tcm,...) # wv_context = glove$components # word_vectors = wv_main + t(wv_context) # cos_sim2_vectors(c("renewable", "energy"), # v_substract = "large", # n = 20, word_vector_set = word_vectors)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.