Enhancing Hierarchical Text Classification through Knowledge Graph Integration

Ye Liu, Kai Zhang, Zhenya Huang, Kehang Wang, Yanghai Zhang, Qi Liu, Enhong Chen

The Challenge of Hierarchical Text Classification

Hierarchical Text Classification (HTC) is the task of assigning documents to categories organized within a structured taxonomy, such as a tree or directed acyclic graph. While modern pre-trained language models like BERT have revolutionized natural language processing, they often struggle with the nuanced domain knowledge required for deep hierarchical structures. For instance, a document describing a journey through the Sahara might be misclassified if it mentions the USA for scale, unless the model "understands" the geographical relationship between the Sahara, Algiers, and Africa.

Motivation for integrating Knowledge Graphs into hierarchical classification.

To address this, researchers have introduced K-HTC, a framework that explicitly injects external domain knowledge from Knowledge Graphs (KGs) into the classification pipeline. By grounding text in a structured knowledge base, the model can resolve ambiguities that surface-level word embeddings might miss.

The K-HTC Framework

The K-HTC model enhances the classification process through three integrated components: the Knowledge-aware Text Encoder (KTE), Knowledge-aware Hierarchical Label Attention (KHLA), and Knowledge-aware Contrastive Learning (KCL).

The architecture of the K-HTC framework, featuring KTE, KHLA, and KCL modules.

1. Knowledge-aware Text Encoder (KTE)

KTE identifies concepts within the input text that correspond to nodes in a Knowledge Graph (e.g., ConceptNet). It utilizes GraphSAGE to aggregate information from neighboring nodes in the KG, fusing this contextual knowledge directly into the word representations. This allows the model to "consult" the KG to enrich its understanding of specific entities.

2. Knowledge-aware Hierarchical Label Attention (KHLA)

Labels in HTC are not merely indices; they possess semantic meaning. K-HTC treats label names as text and encodes them using the KTE. A Graph Convolutional Network (GCN) then propagates this information across the taxonomic hierarchy, ensuring that child labels (e.g., Machine Learning) inherit semantic features from their parent labels (e.g., Computer Science).

3. Knowledge-aware Contrastive Learning (KCL)

To further refine the latent space, K-HTC employs a dual-stream contrastive learning strategy. It pulls document representations closer if they share significant KG concepts (knowledge-driven) or share hierarchical labels (hierarchy-driven). This helps the model cluster semantically related documents even when they do not share identical keywords.

Experimental Results and Insights

The framework was evaluated on two major benchmarks: the BlurbGenreCollection-EN (BGC), featuring a complex 4-level hierarchy, and the Web-of-Science (WOS) dataset.

  • State-of-the-Art Performance: K-HTC achieved a Macro-F1 of 65.99 on BGC and 81.69 on WOS, outperforming previous leading models like HPT and HiMatch.
  • The Depth Advantage: A key finding is that KG integration becomes increasingly valuable as the taxonomy deepens. On the BGC dataset, the performance gap between K-HTC and standard baselines widened significantly at the 3rd and 4th levels of the hierarchy.
  • Ablation Success: Removing either the KTE or KHLA modules resulted in a marked decrease in performance, confirming that knowledge integration is critical at both the input (text) and output (label) stages.

Limitations and Future Directions

Despite its success, K-HTC faces challenges regarding "noisy knowledge." Currently, the model relies on string matching to link text to KG concepts, which can lead to incorrect associations (e.g., misidentifying a person named "Clark" as a reference to the "USA"). Additionally, the KHLA module depends on descriptive label names, which may not be available in all datasets.

Future work will focus on integrating sophisticated Entity Linking algorithms to reduce noise and exploring automated knowledge filtering to discard irrelevant information during inference.

Summary updated

BibTeX
@inproceedings{liu2023enhancing,
  author = {Ye Liu and Kai Zhang and Zhenya Huang and Kehang Wang and Yanghai Zhang and Qi Liu and Enhong Chen},
  title = {{Enhancing Hierarchical Text Classification through Knowledge Graph Integration}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.358},
}
Figure