Extract word or document vectors from a textmodel_word2vec or textmodel_doc2vec object.
# S3 method for textmodel_doc2vec
as.matrix(
x,
normalize = TRUE,
layer = c("documents", "words"),
group = FALSE,
...
)# S3 method for textmodel_word2vec
as.matrix(x, normalize = TRUE, layer = "words", ...)
a matrix that contain the word or document vectors in rows.
a textmodel_word2vec or textmodel_doc2vec object.
if TRUE, returns normalized vectors.
the layer from which the vectors are extracted.
[experimental] average sentence or paragraph vectors from the same document.
Silently ignored when layer = "words".
not used.