Learn R Programming

wordvector (version 0.5.1)

probability: Compute probability of words

Description

Compute the probability of words given other words.

Usage

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

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.

Arguments

x

a textmodel_wordvector object fitted with normalize = FALSE.

words

words for which probability is computed.

mode

specify the type of resulting object.

See Also

similarity()