Skip to contents

Calculate highest probability words and values for a topic

Usage

prob_topic(beta, vocab, topic = 1, top_n = NULL)

Arguments

beta

A numeric matrix of dimension (topics x words) representing the probability distribution of words within each topic. Each row should sum to 1. Beta must be on the probability scale (not log scale).

vocab

a character vector of vocabulary terms corresponding to the columns of beta.

topic

the topic index that we want to calculate, the default is 1.

top_n

the number of top words to return, the default is to return all words.

Value

a data frame with ranks, words, and the probabilities of the words