topic_docs_word: The topic-document matrix for a specific word

topic_docs_wordR Documentation

The topic-document matrix for a specific word

Description

Extracts a matrix of counts of a word's weight in each topic within each document from the model's final Gibbs sampling state. (The matrix is quite sparse.)

Usage

topic_docs_word(m, word)

Arguments

m

a mallet_model object with the sampling state loaded read_sampling_state. Operated on using mwhich.

Details

This is useful for studying a word's distribution over topics conditional on some metadata covariate. It is important to realize that the model does not distribute the word among topics uniformly across the corpus.

Value

a sparseMatrix of within-document word weights for word (columns are in doc_ids(m) order)

See Also

tdm_topic, read_sampling_state, mallet_model, load_sampling_state, top_n_row, sum_col_groups


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