Description Usage Arguments Details Note
View source: R/word_embeddings.R
This function trains a word2vec model to create custom word embeddings from the training data set.
1 | prepare_w2v_embeddings(texts, embedding_dim, tokenizer)
|
texts |
Character vector of raw text from training data. |
embedding_dim |
Dimensionality of word embeddings. Options are 25, 50, 100, 200. |
tokenizer |
Pre-fit keras text tokenizer. |
For a good introduction to word2vec model see Distributed Representations of Words and Phrases and their Compositionality (Mikolov et al., 2013)
Embeddings are saved as Rdata to a folder called embeddings with the file format "tweet_wv2_{embedding_dim}.rda"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.