probability: Compute probability of words

View source: R/utils.R

probabilityR Documentation

Compute probability of words

Description

Compute the probability of words given other words.

Usage

probability(x, words, mode = c("words", "values"))

Arguments

x

a textmodel_wordvector object fitted with normalize = FALSE.

words

words for which probability is computed.

mode

specify the type of resulting object.

Value

a matrix of probability scores when mode = "values" or of words sorted in descending order by the probability scores when mode = "words". When words is a named numeric vector, probability scores are weighted by the values.

See Also

similarity()


wordvector documentation built on April 12, 2025, 2:23 a.m.