load_topic_models: Loads pre-generated LDA topic models of aRlegislation

Description Usage Arguments Value

View source: R/load_topic_models.R

Description

Returns Gibbs-type LDA models generated using the topicmodels::LDA function. These topic models were generated on the entire legislative dataset from 2001-2019. Because the generation is time-consuming, the individuals models have been saved for ease of reloading. The models take up ~15MB of space each, so they are saved individually. This function permits topics within a specified range to be loaded.

Usage

1
load_topic_models(datadir = NULL, topics = NULL)

Arguments

datadir

A directory containing topic models in nested dataframe format. If NULL, the inst/extdata and extdata directories are searched in the installation directory. The inst/extdata directory should be explicitly declared to use all files, as only a few models are provided in the installation.

topics

An integer, a vector of integers, or named vector in c(to = x, from = y) format. Defaults to first 10.

Value

A nested dataframe with a column named topic_models for each of the topics specified, along with scores calculated by the ldatuning package.


titaniumtroop/aRlegislation documentation built on May 4, 2020, 3:24 a.m.