Learn R Programming

wordvector (version 0.6.0)

perplexity: Compute perplexity of a model

Description

Compute the perplexity of a trained word2vec model with data.

Usage

perplexity(x, targets, data)

Arguments

x

a trained textmodel_wordvector object.

targets

words for which probabilities are computed.

data

a quanteda::tokens or quanteda::dfm; the probabilities of words are tested against occurrences of words in it.