Hierarchical Clustering on HDP Topics to build a Semantic Tree from Text

Jianfeng Si, Qing Li, Tieyun Qian, Xiaotie Deng

Abstract

Organizing large-scale unstructured text into coherent hierarchies remains a significant challenge in data analysis. Traditional flat topic models like Latent Dirichlet Allocation (LDA) fail to capture the nested relationships between concepts, while existing hierarchical models often suffer from high computational complexity and rigid document-path constraints. This paper introduces HDP-Clustering (HDP-C), a novel framework that leverages the Hierarchical Dirichlet Process (HDP) to automatically construct semantic trees. By treating the Dirichlet scale parameter as a "granularity knob," HDP-C generates topics at varying levels of abstraction and bridges them using efficient agglomerative clustering. Experimental results on JACM, Wikipedia, and DMOZ datasets demonstrate that HDP-C significantly outperforms traditional baselines like hLDA in both accuracy and semantic coherence.

Introduction

The ability to automatically generate a "table of contents" for massive text corpora is highly desirable. While flat topic models are widely used, they lack the structural depth necessary to represent how specific sub-topics (e.g., "Neural Networks") relate to broader domains (e.g., "Machine Learning"). Existing hierarchical models, such as Hierarchical Latent Dirichlet Allocation (hLDA), attempt to solve this but introduce two major drawbacks: extreme computational slowness due to simultaneous node learning and a restrictive "single-path" assumption that forces each document into a rigid branch.

HDP-C addresses these issues by decoupling the topic discovery from the tree construction. It uses a nonparametric Bayesian approach to find topics at different "altitudes" of abstraction and then organizes them into a flexible hierarchy.

Methodology: The Granularity Knob

The core of HDP-C is the strategic use of the Hierarchical Dirichlet Process (HDP). Unlike LDA, HDP automatically determines the number of topics. The authors identify the Dirichlet scale parameter ($\eta$) as the primary control for semantic granularity.

The relationship between the scale parameter $\eta$ and the number of topics discovered across various datasets.

As shown in Figure 4, a low $\eta$ (e.g., 0.1) encourages sparsity, leading the model to discover a large number of specific, narrow topics. Conversely, a high $\eta$ (e.g., 1.0) encourages density, resulting in a smaller set of broad, general topics.

The HDP-C Algorithm

The construction process follows four main steps:

  1. Multi-Level Learning: HDP is executed twice—once with a high $\eta$ to identify general "top-level" topics and once with a low $\eta$ for detailed "leaf-level" topics.
  2. Initial Mapping: Specific leaf topics are mapped to their most similar general parent based on word distribution similarity.
  3. Agglomerative Clustering: To build the intermediate layers, the algorithm uses bottom-up clustering to merge similar specific topics under general parents until a target branching factor is achieved.
  4. Root Integration: Top-level topics are finally unified under a single root node to complete the hierarchy.
An example of a semantic tree generated by HDP-C, showing the hierarchical relationship between general and specific topics.

Evaluation and Results

The model was evaluated against the "golden line" hierarchies of several datasets, including JACM abstracts, Wikipedia subsets (LSHTC3), and DMOZ (LSHTC2).

Key Findings

  • Performance Gains: HDP-C consistently outperformed hLDA. It achieved a 12.1% improvement in F-Score on Wikipedia datasets and a 25.3% improvement on DMOZ datasets.
  • Semantic Precision: The model demonstrated particularly high precision, indicating that the clustered topics are semantically more coherent than those produced by path-restricted models.
  • Metric Robustness: Testing various distance metrics for clustering revealed that Symmetric KL divergence provided the most stable and accurate results across different corpora.

Discussion and Future Work

HDP-C offers a more natural representation of text by breaking the path restriction of previous models, allowing the global distribution of topics to dictate the tree structure. However, some challenges remain. The choice of $\eta$ values is currently heuristic; future research could focus on automatically optimizing these parameters for unknown datasets. Additionally, while HDP-C is more efficient than fully generative hierarchical models, detailed benchmarking of wall-clock runtimes would further validate its practical advantages for massive datasets.

Summary updated

BibTeX
@inproceedings{si2012hierarchical,
  author = {Jianfeng Si and Qing Li and Tieyun Qian and Xiaotie Deng},
  title = {{Hierarchical Clustering on HDP Topics to build a Semantic Tree from Text}},
  booktitle = {VLDS},
  year = {2012},
}
Figure