I have been using Stanford Topic Modeling Toolbox (TMT) Version 0.4.0 for several days. It runs smoothly under java SE development kit 6u45. However, I find that the default number of topics is 30 in LDA analysis. I then re-read the official instruction carefully, and find that the number can be changed in Select parameters for training a LDA model. The code for this example is in example-2-lda-learn.scala.

// turn the text into a dataset ready to be used with LDA

val dataset = LDADataset(text);

// define the model parameters

val params = LDAModelParams(numTopics = 30, dataset = dataset);

You can change the number (30) of the last line of codes to whatever you what, so there will be the exact number of topics you will get in LDA analysis.

8条评论

  1. Good site you have got here.. It’s difficult to find high-quality writing like yours nowadays.
    I truly appreciate people like you! Take care!!

发表评论

你的电子邮件地址不会被公开 * 为必填字段

提交评论