as.textmodel_doc2vec: Create a doc2vec model

View source: R/as.doc2vec.R

as.textmodel_doc2vecR Documentation

Create a doc2vec model

Description

Create a doc2vec model as weighted word vectors.

Usage

as.textmodel_doc2vec(x, model, compound = TRUE, group_data = FALSE, ...)

Arguments

x

a quanteda::tokens or quanteda::dfm object.

model

a textmodel_wordvector object.

compound

if TRUE, compound multi-word expressions in x based on model internally. Only applies when x is a quanteda::tokens object.

group_data

if TRUE, apply dfm_group(x) before creating document vectors.

...

additional arguments passed to the underlying function.

Details

For Japanese or Chinese texts, model$concatenator must be empty (""). The value is inherited from the tokens object on which the model was trained. It triggers tokenization of words in model and compounding of characters in x before creating document vectors.

Value

Returns a textmodel_doc2vec object with the following elements:

values

a list of matrices for word and document vectors.

dim

the size of the document vectors.

concatenator

the concatenator in x.

docvars

document variables copied from x.

call

the command used to execute the function.

version

the version of the wordvector package.


wordvector documentation built on Oct. 8, 2026, 9:11 a.m.