FastArun2010: Fast Implementation of Arun 2014

FastArun2010R Documentation

Fast Implementation of Arun 2014

Description

Fast Implementation of Arun 2014

Usage

FastArun2010(x, ...)

## S4 method for signature 'TopicModel'
FastArun2010(x, doclengths)

## S4 method for signature 'matrix'
FastArun2010(x, gamma, doclengths)

## S4 method for signature 'jobjRef'
FastArun2010(x)

Arguments

x

A topic model.

...

Further arguments

doclengths

Integer vector.

gamma

The gamma matrix.

Examples

## Not run: 
if (!mallet_is_installed()) mallet_install()
library(polmineR)
use("polmineR")
speeches <- corpus("GERMAPARLMINI") %>%
  as.speeches(s_attribute_name = "speaker", s_attribute_date = "date")
instance_list <- as.instance_list(speeches)
lda <- BigTopicModel(n_topics = 25L, alpha_sum = 5.1, beta = 0.1)
lda$addInstances(instance_list)
lda$setNumThreads(1L)
lda$setNumIterations(150L)
lda$estimate()
lda2 <- as_LDA(lda)
FastArun2010(lda2, doclengths = summary(speeches)[["size"]])

## End(Not run)
if (!mallet_is_installed()) mallet_install()
fname <- system.file(package = "biglda", "extdata", "mallet", "lda_mallet.bin")
lda <- mallet_load_topicmodel(fname)
FastArun2010(lda)

PolMine/biglda documentation built on Feb. 25, 2023, 11:24 p.m.