arXiv:2505.05583cs.CL2025-05被引 4

用知识图谱增强大模型,实现零样本层次文本分类。

KG-HTC: Integrating Knowledge Graphs into LLMs for Effective Zero-shot Hierarchical Text Classification

  • 通过RAG从知识图谱检索相关子图,提供分层语义支持。
  • 在三个数据集上零样本测试中显著优于基线,深层标签提升明显。
  • 适合缺乏标注数据、标签层级复杂的应用场景。

层次文本分类(HTC)需将文档分配到具有层级结构的标签中。以往研究多依赖有监督方法,但在真实场景中常因缺乏标注数据而难以应用。此外,HTC还面临标签空间庞大和长尾分布问题。本文提出KG-HTC,通过将知识图谱与大语言模型结合,在分类时提供结构化语义上下文。该方法采用检索增强生成(RAG)从知识图谱中提取与输入文本相关的子图,帮助模型理解多层次标签语义。我们在WoS、DBpedia和Amazon三个开源数据集上评估,结果表明,KG-HTC在严格零样本设置下显著优于三个基线,尤其在层级较深的标签上表现突出。实验验证了引入结构化知识可有效缓解大标签空间与长尾分布带来的挑战。代码已公开于:https://github.com/QianboZang/KG-HTC。

原文摘要 · Abstract (English)

Hierarchical Text Classification (HTC) involves assigning documents to labels organized within a taxonomy. Most previous research on HTC has focused on supervised methods. However, in real-world scenarios, employing supervised HTC can be challenging due to a lack of annotated data. Moreover, HTC often faces issues with large label spaces and long-tail distributions. In this work, we present Knowledge Graphs for zero-shot Hierarchical Text Classification (KG-HTC), which aims to address these challenges of HTC in applications by integrating knowledge graphs with Large Language Models (LLMs) to provide structured semantic context during classification. Our method retrieves relevant subgraphs from knowledge graphs related to the input text using a Retrieval-Augmented Generation (RAG) approach. Our KG-HTC can enhance LLMs to understand label semantics at various hierarchy levels. We evaluate KG-HTC on three open-source HTC datasets: WoS, DBpedia, and Amazon. Our experimental results show that KG-HTC significantly outperforms three baselines in the strict zero-shot setting, particularly achieving substantial improvements at deeper levels of the hierarchy. This evaluation demonstrates the effectiveness of incorporating structured knowledge into LLMs to address HTC's challenges in large label spaces and long-tailed label distributions. Our code is available at: https://github.com/QianboZang/KG-HTC.

知识图谱零样本层次分类大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。