topicModeling: Topic Modeling

Description Usage Arguments Details Examples

View source: R/textMining.R

Description

Topic Modeling based on Correlated Topic Model (Estimate a CTM model using for example the VEM algorithm.) and Latent Dirichlet Allocation (Estimate a LDA model using for example the VEM algorithm or Gibbs Sampling.)

Usage

1
topicModeling(corpus, k = 10)

Arguments

corpus

the words

k

number of topics

Details

LDA:
The C code for LDA from David M. Blei and co-authors is used to estimate and fit a latent dirichlet allocation model with the VEM algorithm. For Gibbs Sampling the C++ code from Xuan-Hieu Phan and co-authors is used.
When Gibbs sampling is used for fitting the model, seed words with their additional weights for the prior parameters can be specified in order to be able to fit seeded topic models.

CTM:
The C code for CTM from David M. Blei and co-authors is used to estimate and fit a correlated topic model.

Examples

1
2
3
4
5
setupTwitterConn()
tweets <- tweet_corpus(search = "audusd", n = 100, since = as.character(Sys.Date()-7), until = as.character(Sys.Date()))
tweets <- text_clean(tweets$v, rmDuplicates = FALSE, cores = 6, stems = NULL)
wordCloudVis(tweets$corpus)
topicModeling(tweets$corpus, k = 5)

ivanliu1989/RQuant documentation built on Sept. 13, 2019, 11:53 a.m.