Learn R Programming

wordvector (version 0.6.0)

as.matrix.textmodel_doc2vec: Extract word or document vectors

Description

Extract word or document vectors from a textmodel_word2vec or textmodel_doc2vec object.

Usage

# S3 method for textmodel_doc2vec
as.matrix(x, normalize = TRUE, layer = c("documents", "words"), ...)

# S3 method for textmodel_word2vec as.matrix(x, normalize = TRUE, layer = "words", ...)

Value

a matrix that contain the word or document vectors in rows.

Arguments

x

a textmodel_word2vec or textmodel_doc2vec object.

normalize

if TRUE, returns normalized vectors.

layer

the layer from which the vectors are extracted.

...

not used.