2
$\begingroup$

I hope this question isn't too general, but I'm looking for an unsupervised topic modelling algorithm that doesn't require the number of topics (k) to be defined prior to running the analysis of the documents.

I've had a look online but have so far drawn a blank. I mainly use R and Python, so a solution in either of those languages would be ideal.

Could anyone give me a steer in the right direction?

$\endgroup$
1
$\begingroup$

Hierarchal Dirichlet process topic models fit that description. Briefly, they're a nonparametric extension of topic models, like latent Dirichlet allocation, in which we fit the number of topics based on the data. This worked better in experiments:

For LDA we evaluated the perplexity for mixture component cardinalities ranging between 10 and 120. As seen in Figure 3 (Left), the hierarchical DP mixture approach—which integrates over the mixture component cardinalities—performs as well as the best LDA model, doing so without any form of model selection procedure. Moreover, as shown in Figure 3 (Right), the posterior over the number of topics obtained under the hierarchical DP mixture model is consistent with this range of the best-fitting LDA models.

Other, more elaborate models described in the paper account for groups the documents fall into. (In their experiments, the section of NIPS that papers were taken from.)

There's an implementation in c++; Python or R might be a bridge too far, but at least this will give you something to search for.

$\endgroup$
  • 1
    $\begingroup$ Many thanks, Sean. I've been meaning to get some work done in C++ so this might be just the opportunity to do so. $\endgroup$ – DanielH Mar 4 '17 at 19:33
  • $\begingroup$ Quite welcome. You may also find this of interest: It uses the HDP LDA model as an example. $\endgroup$ – Sean Easter Mar 4 '17 at 19:35
1
$\begingroup$

I think it is already implemented in Python. Visit Gensim website https://radimrehurek.com/gensim/models/hdpmodel.html

$\endgroup$
  • $\begingroup$ Thanks, Kevin - I'll check that out. I'm currently wrangling with the C++ implementation and not getting that far with it! $\endgroup$ – DanielH Mar 5 '17 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.