View source: R/get_local_vocab.R
get_local_vocab | R Documentation |
Local vocab consists of the intersect between the set of pretrained embeddings and the collection of texts.
get_local_vocab(context, pre_trained)
context |
(character) vector of contexts (usually |
pre_trained |
(numeric) a F x D matrix corresponding to pretrained embeddings. F = number of features and D = embedding dimensions. rownames(pre_trained) = set of features for which there is a pre-trained embedding. |
(character) vector of words common to the texts and pretrained embeddings.
# find local vocab (use it to define the candidate of nearest neighbors) local_vocab <- get_local_vocab(cr_sample_corpus, pre_trained = cr_glove_subset)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.