Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2015;16 Suppl 13(Suppl 13):S8.
doi: 10.1186/1471-2105-16-S13-S8. Epub 2015 Sep 25.

A heuristic approach to determine an appropriate number of topics in topic modeling

A heuristic approach to determine an appropriate number of topics in topic modeling

Weizhong Zhao et al. BMC Bioinformatics. 2015.

Abstract

Background: Topic modelling is an active research field in machine learning. While mainly used to build models from unstructured textual data, it offers an effective means of data mining where samples represent documents, and different biological endpoints or omics data represent words. Latent Dirichlet Allocation (LDA) is the most commonly used topic modelling method across a wide number of technical fields. However, model development can be arduous and tedious, and requires burdensome and systematic sensitivity studies in order to find the best set of model parameters. Often, time-consuming subjective evaluations are needed to compare models. Currently, research has yielded no easy way to choose the proper number of topics in a model beyond a major iterative approach.

Methods and results: Based on analysis of variation of statistical perplexity during topic modelling, a heuristic approach is proposed in this study to estimate the most appropriate number of topics. Specifically, the rate of perplexity change (RPC) as a function of numbers of topics is proposed as a suitable selector. We test the stability and effectiveness of the proposed method for three markedly different types of grounded-truth datasets: Salmonella next generation sequencing, pharmacological side effects, and textual abstracts on computational biology and bioinformatics (TCBB) from PubMed.

Conclusion: The proposed RPC-based method is demonstrated to choose the best number of topics in three numerical experiments of widely different data types, and for databases of very different sizes. The work required was markedly less arduous than if full systematic sensitivity studies had been carried out with number of topics as a parameter. We understand that additional investigation is needed to substantiate the method's theoretical basis, and to establish its generalizability in terms of dataset characteristics.

PubMed Disclaimer

Figures

Figure 1
Figure 1
RPC values of LDA models with various testing topic numbers in each of three datasets. (a) Salmonella sequence dataset; (b) SIDER2 dataset; (c) TCBB dataset.
Figure 2
Figure 2
Comparison of frequencies of candidate topic numbers obtained by perplexity-based method and RPC-based method.
Figure 3
Figure 3
Eight example topics obtained by LDA modeling with 40 topics on TCBB dataset.
Figure 4
Figure 4
Two example topics from an LDA model with 20 topics derived from the TCBB dataset.
Figure 5
Figure 5
Four example topics derived by LDA modeling with 60 topics on TCBB dataset.
Figure 6
Figure 6
Two drawbacks of a perplexity-based method in selecting topic numbers.

References

    1. Deerwester S, Dumais ST, Furnas GW, Landauer TK, Harshman R. Indexing by Latent Semantic Analysis. J Am Soc Inform Sci. 1990;41(6):391–407. doi: 10.1002/(SICI)1097-4571(199009)41:6<391::AID-ASI1>3.0.CO;2-9. - DOI
    1. Hofmann T. Unsupervised learning by probabilistic latent semantic analysis. Machine Learning. 2001;42(1-2):177–196.
    1. Hofmann T. Probabilistic latent semantic indexing. Proceedings of the 22nd annual international ACM SIGIR conference on Research and development in information retrieval. 1999. pp. 50–57.
    1. Blei DM, Ng AY, Jordan MI. Latent Dirichlet Allocation. Journal of Machine Learning Research. 2003;3:993–1022.
    1. Griffiths TL, Steyvers M. Finding scientific topics. Proc Natl Acad Sci U S A. 2004;101(Suppl 1):5228–5235. - PMC - PubMed

Publication types

MeSH terms

LinkOut - more resources