View source: R/Personal_Functions.R
Vector_Puller | R Documentation |
Function for extacting word vectors from embeddings. This function is an internal function for 'Sentence_Puller'. It averages the word vectors and returns the average of these vectors.
Vector_Puller(words, emb_matrix, dimension)
words |
The word to be extracted. |
emb_matrix |
The embeddings matrix. It must be a data frame. |
dimension |
The Dimension of the embeddings to extract. They do not have to match that of the matrix, but they cannot exceed its maximum column count. |
This is a simple and fast internal function.
The vector that corresponds to the average of the word vectors.
Travis Barton
# This is an example emb_matrix emb = data.frame(matrix(c(1, 2, 3, 4, 5, 5, 4, 3, 2, 1), nrow = 2), row.names = c('cow', 'moo')) Vector_Puller(c('cow', 'moo'), emb, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.