Get the word vectors of a word2vec model
Get the word vectors of a word2vec model as a dense matrix.
## S3 method for class 'word2vec' as.matrix(x, encoding = "UTF-8", ...)
x |
a word2vec model as returned by |
encoding |
set the encoding of the row names to the specified encoding. Defaults to 'UTF-8'. |
... |
not used |
a matrix with the word vectors where the rownames are the words from the model vocabulary
path <- system.file(package = "word2vec", "models", "example.bin") model <- read.word2vec(path) embedding <- as.matrix(model)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.