perplexity: [experimental] Compute perplexity of a model

View source: R/utils.R

perplexityR Documentation

[experimental] Compute perplexity of a model

Description

Compute the perplexity of a trained word2vec model with data.

Usage

perplexity(x, targets, data, layer = c("words", "documents"))

Arguments

x

a trained textmodel_wordvector object.

data

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


wordvector documentation built on Sept. 12, 2026, 1:07 a.m.