Peer-Label Assisted Hierarchical Text Classification

Junru Song, Feifei Wang, Yang Yang

Abstract

Hierarchical text classification (HTC) is a challenging task, in which the labels of texts can be organized into a category hierarchy. To deal with the HTC problem, many existing works focus on utilizing the parent-child relationships that are explicitly shown in the hierarchy. However, texts with a category hierarchy also have some latent relevancy among labels in the same level of the hierarchy. We refer to these labels as peer labels, from which the peer effects are originally utilized in our work to improve the classification performance. To fully explore the peer-label relationship, we develop a PeerHTC method. This method innovatively measures the latent relevancy of peer labels through several metrics and then encodes the relevancy with a Graph Convolutional Neural Network. We also propose a sample importance learning method to ameliorate the side effects raised by modelling the peer label relevancy. Our experiments on several standard datasets demonstrate the evidence of peer labels and the superiority of PeerHTC over other state-of-the-art HTC methods in terms of classification accuracy.

Introduction

Hierarchical Text Classification (HTC) involves assigning documents to categories organized in a taxonomy, typically a tree or a directed acyclic graph. Traditionally, research has focused on the explicit "vertical" structure: if a document is about "Quantum Physics," it must inherently also be about "Physics." While these parent-child links are crucial, they ignore the "horizontal" relationships between categories at the same level of the hierarchy.

The authors introduce the concept of "peer labels"—categories that sit under different parent nodes but share significant thematic overlap. For instance, in a library taxonomy, "World History" and "Travel: Asia" might be distinct branches, yet they share latent relevancy. Standard models miss these peer effects. The challenge is to capture these horizontal relationships to improve feature sharing without making similar labels so indistinguishable that the model suffers from label confusion.

Methodology

The proposed PeerHTC framework integrates both explicit hierarchy and implicit peer relationships through a sophisticated two-stage training process.

The two-stage training architecture of PeerHTC, illustrating the transition from warm-up to second-round training.

Peer-Label Learning and Adjacency

PeerHTC uses a Graph Convolutional Network (GCN) to encode relationships between labels. Unlike static models, PeerHTC employs a data-driven approach to initialize the GCN's adjacency matrix. During a "Warm-up" stage, the model harvests initial label probabilities and embeddings. It then calculates similarity using either the Spearman Rank Correlation of estimated probabilities or the cosine similarity of label embeddings to define the peer connections.

Sample Importance Learning

Modeling peer relationships can lead to "label confusion," where the model struggles to distinguish between highly similar categories. To mitigate this, PeerHTC introduces a sample importance weighting mechanism. Training samples that are particularly effective at distinguishing between confusing label pairs are assigned higher weights in the loss function during the second round of training.

Two-Stage Training Workflow

  1. Stage 1 (Warm-up): The model is trained with a random adjacency matrix to generate initial data for evaluating label confusion and latent relevancy.
  2. Stage 2 (Second-round): The model is re-initialized with the refined adjacency matrix and re-trained using the calculated sample weights to produce the final classifier.

Experimental Setup

The model was evaluated on three distinct datasets to test its versatility:

  • WOS (Web of Science): Academic abstracts with 141 categories across 2 levels.
  • BGC (BlurbGenreCollection): Book descriptions with 146 categories across 4 levels, supporting multi-path labels.
  • Goods: A new dataset consisting of 14,969 product names from a Chinese retailer, organized into a 3-level hierarchy with 225 categories.

Key Insights and Results

The core innovation of PeerHTC is the "Peer Effect." By allowing labels at the same level to share features via a GCN, the model learns more robust representations, which is particularly beneficial for categories with limited training data.

Heatmaps showing the learned latent relevancy (peer effects) between labels in the BGC and WOS datasets.

PeerHTC consistently outperformed existing state-of-the-art (SOTA) models like HMCN, HARNN, and HiAGM:

  • BGC Dataset: Achieved a Micro-F1 of 77.47, surpassing the previous best (HTCInfoMax) at 76.66.
  • WOS Dataset: Achieved a Micro-F1 of 74.24, compared to 73.90 for the nearest competitor.

Ablation studies confirmed that both the peer-label modeling and the sample importance weighting are critical. While replacing traditional encoders with BERT raises the performance floor for all methods, PeerHTC provides a consistent marginal gain over other BERT-enhanced SOTA models.

Conclusion

PeerHTC demonstrates that "looking sideways" at peer labels is as important as looking up and down the hierarchy. While the two-stage process increases computational overhead, the gains in accuracy—especially in balancing similarity and distinction—mark a significant step forward in HTC. Future work may involve incorporating external knowledge bases like WordNet to further refine the initialization of peer relationships.

Summary updated

BibTeX
@inproceedings{song2023peer,
  author = {Junru Song and Feifei Wang and Yang Yang},
  title = {{Peer-Label Assisted Hierarchical Text Classification}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  url = {https://openreview.net/forum?id=Z8iVoGb04d},
}
Figure