% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/doc2vec.R, R/word2vec.R
\name{as.matrix.textmodel_doc2vec}
\alias{as.matrix.textmodel_doc2vec}
\alias{as.matrix.textmodel_word2vec}
\title{Extract word or document vectors}
\usage{
\method{as.matrix}{textmodel_doc2vec}(
  x,
  normalize = TRUE,
  layer = c("documents", "words"),
  group = FALSE,
  ...
)

\method{as.matrix}{textmodel_word2vec}(x, normalize = TRUE, layer = "words", padding = FALSE, ...)
}
\arguments{
\item{x}{a \code{textmodel_word2vec} or \code{textmodel_doc2vec} object.}

\item{normalize}{if \code{TRUE}, returns normalized vectors.}

\item{layer}{the layer from which the vectors are extracted.}

\item{group}{[experimental] average sentence or paragraph vectors from the same document.
Silently ignored when \code{layer = "words"}.}

\item{...}{not used.}

\item{padding}{if \code{TRUE}, add a row with zeros before the word vectors.}
}
\value{
a matrix that contain the word or document vectors in rows.
}
\description{
Extract word or document vectors from a \code{textmodel_word2vec} or \code{textmodel_doc2vec} object.
}
