load_doc_topics: Load model elements into a model object

load_doc_topicsR Documentation

Load model elements into a model object

Description

To ensure doc-topic or topic-word matrices are not recalculated every time you access them, you can use these functions. R's functional design makes memoizing a little cumbersome (or requires another package).

Usage

load_doc_topics(m)

load_topic_words(m)

load_top_words(m, n = NULL, weighting = NULL)

Arguments

m

mallet_model object

Value

a copy of m with the data element in question loaded. In principle the (list) copy is "shallow" and should not be expensive in time or memory.

Examples

## Not run: 
m <- load_doc_topics(m)  # precalculate doc-topics matrix
doc_topics(m)            # will return stored values

## End(Not run)


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