buildModel: Build a topic model

Description Usage Arguments Value Description Examples

View source: R/buildModel.R

Description

Run mallet over a tei2r collection.

Usage

1
buildModel(dl, tnum, train = 100, maximize = 10, listLength = 100)

Arguments

dl

A docList object, representing your collection (must include a stopwords file and must have imported texts).

tnum

The number of topics you want mallet to search for.

train

The number of times mallet will iterate over your collection.

maximize

A few extra iterations meant to pick the best topic for each word.

listLength

The number of words from each topic you'd like to see displayed.

Value

dmod The completed docModel object for viewing and simple analysis.

Description

Trains a basic topic model using the 'mallet' package and saves the output into a single docModel object. For easy viewing, the resulting object contains a data frame of each topic's top words and each document's most prevalent topics.

Examples

1
2
3
dmod = buildModel(dl = dl, tnum = 50)
View(dmod@topics) # To view a table showing the words of each topic
View(dmod@frequencies) # To view the frequency of the topics in each document

michaelgavin/tei2r documentation built on May 22, 2019, 9:50 p.m.