words_top_topics: Top-ranked topics for documents

words_top_topicsR Documentation

Top-ranked topics for documents

Description

This function extracts the most salient topics for all words in the topic- word matrix (which must be available).

Usage

words_top_topics(m, n, weighting = tw_smooth_normalize(m))

Arguments

m

mallet_model object

n

number of top topics to extract

weighting

a function to transform the topic-word matrix. By default, the topic proportions are used (same rank as raw weights)

Details

Here as elsewhere "saliency" can be variously defined: the easiest choice is to choose the topic which captures the largest proportion of a word's usage, and that is the default. TODO: actually implement the alternative weighting.

Value

a data frame with three columns, word, topic, , and weight, the weight used in ranking (topic proportion, by default)

a dataframe with n rows and two columns, topic and weight.

See Also

topic_words


agoldst/dfrtopics documentation built on July 15, 2022, 4:13 p.m.