How to run supervised LDA <p>I did topic modeling on my documents using topicmodels package. Now, I want to do supervised LDA. I used <a href="http://www.r-bloggers.com/a-link-between-topicmodels-lda-and-ldavis/" rel="nofollow">this function</a> to convert my topicmodels output to lda package output. But, now I don't know how to run slda and interpret the results.</p> <p>Here's the code I have so far:</p> <pre><code># A function that converts topicmodels output to lda output topicmodels_json_ldavis &lt;- function(fitted, corpus, doc_term){ # Required packages library(topicmodels) library(dplyr) library(stringi) library(tm) library(LDAvis) # Find required quantities phi &lt;- posterior(fitted)$terms %&gt;% as.matrix theta &lt;- posterior(fitted)$topics %&gt;% as.matrix vocab &lt;- colnames(phi) doc_length &lt;- vector() for (i in 1:length(corpus)) { temp &lt;- paste(corpus[[i]]$content, collapse = ' ') doc_length &lt;- c(doc_length, stri_count(temp, regex = '\\S+')) } temp_frequency &lt;- inspect(doc_term) freq_matrix &lt;- data.frame(ST = colnames(temp_frequency), Freq = colSums(temp_frequency)) rm(temp_frequency) # Convert to json json_lda &lt;- LDAvis::createJSON(phi = phi, theta = theta, vocab = vocab, doc.length = doc_length, term.frequency = freq_matrix$Freq) return(json_lda) } ## end of function docs &lt;- tm_map(docs, removePunctuation) docs &lt;- tm_map(docs, removeNumbers) docs &lt;- tm_map(docs, content_transformer(tolower)) docs &lt;- tm_map(docs, removeWords, stopwords("english")) library(SnowballC) docs &lt;- tm_map(docs, stemDocument) docs &lt;- tm_map(docs, stripWhitespace) tfm &lt;- DocumentTermMatrix(docs) # remove empty documents library(slam) tfm = tfm[row_sums(tfm)&gt;0,] # Use topicmodels package to conduct LDA analysis. library(topicmodels) results5 &lt;- LDA(tfm, k = 5, method = "Gibbs") ### converting topicmodels output to lda output ldaoutput = topicmodels_json_ldavis(lda,corpus, dtm) </code></pre> <p>Now I don't know how to run supervised lda and interpret it.</p> <p>I really appreciate your help.</p>