Description Usage Arguments Details Value Author(s) Examples

View source: R/Personal_Functions.R

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.

1 | ```
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

1 2 3 4 5 | ```
# 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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.