Firstly, which language are you using R, Python or java?
I recently learned to perform the same task in R.
In R, I am using 'topicmodels' package, using LDA function you can create a LDA model, you can check the documentation here: [https://cran.r-project.org/web/packages/topicmodels/topicmodels.pdf]
Now, Just create a new corpus consisting new documents to be analysed. To predict the new documents using the existing model, inside the LDA method, you can edit a control list in the argument which looks like this :
R> control_LDA_VEM <- list(
- estimate.alpha = TRUE, alpha = 50/k, estimate.beta = TRUE,
- verbose = 0, prefix = tempfile(), save = 0, keep = 0,
- seed = as.integer(Sys.time()), nstart = 1, best = TRUE,
- var = list(iter.max = 500, tol = 10^-6),
- em = list(iter.max = 1000, tol = 10^-4),
- initialize = "random")
as, you only need to predict the document-topic matrix while keeping the Topic-Word matrix same, for prediction purposes, just modify the control list as:
predict.lda <- LDA(new.dtm, 5, control = list(estimate.beta= FALSE, seed= 13, initialize= "model"), model = fitted.lda)
estimate.beta; is a logical argument, through which you can calculate the topic distribution per document, if you already have the term distribution per topic
seed; is just used to make the code reproduciable
initialize; taking in three things, 'random', 'seeded' and 'model', I have used model because I already have a fitted model which I want to use,
You can play with this more as per your requirement, I recommend reading the "topicmodels: An R Package for Fitting Topic Models" from "Journal of Statistical Software" which gives a more elaborate review and explanation of the above.
Hope this helped!