arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.09048cs.CLcs.AIcs.IRcs.LGcs.SE
收藏

CodeKGC:用于生成式知识图谱构建的代码语言模型

CodeKGC: Code Language Model for Generative Knowledge Graph Construction

Zhejiang University(浙江大学);Zhejiang University - Ant Group Joint Laboratory of Knowledge Graph(浙江大学-蚂蚁集团知识图谱联合实验室);Alibaba Group(阿里巴巴集团)

Zhen Bi, Jing Chen, Yinuo Jiang, Feiyu Xiong, Wei Guo, Huajun Chen, Ningyu Zhang

AI总结:

本文提出 CodeKGC,将知识图谱三元组生成转化为代码补全任务,结合模式感知提示与理由增强生成,在基准数据集上优于基线方法。

摘要:

当前的生成式知识图谱构建方法通常只是将自然语言平铺为序列化文本或某种规范语言,因而难以捕捉结构性知识。然而,在代码等结构化数据上训练的大型生成式语言模型,已经在结构预测和推理任务中展现出令人瞩目的自然语言理解能力。基于这一直觉,我们利用代码语言模型来处理生成式知识图谱构建任务:给定代码格式的自然语言输入,目标是生成可表示为代码补全任务的三元组。具体而言,我们设计了模式感知提示,以有效利用知识图谱内部的语义结构。由于代码本身具有类和函数定义等结构,它可作为有用的先验语义结构知识模型。此外,我们采用理由增强的生成方法来提升性能;理由提供中间步骤,从而增强知识抽取能力。实验结果表明,与基线方法相比,所提方法能够在基准数据集上取得更好的性能。代码和数据集可在 https://github.com/zjunlp/DeepKE/tree/main/example/llm 获取。

英文摘要:

Current generative knowledge graph construction approaches usually fail to capture structural knowledge by simply flattening natural language into serialized texts or a specification language. However, large generative language model trained on structured data such as code has demonstrated impressive capability in understanding natural language for structural prediction and reasoning tasks. Intuitively, we address the task of generative knowledge graph construction with code language model: given a code-format natural language input, the target is to generate triples which can be represented as code completion tasks. Specifically, we develop schema-aware prompts that effectively utilize the semantic structure within the knowledge graph. As code inherently possesses structure, such as class and function definitions, it serves as a useful model for prior semantic structural knowledge. Furthermore, we employ a rationale-enhanced generation method to boost the performance. Rationales provide intermediate steps, thereby improving knowledge extraction abilities. Experimental results indicate that the proposed approach can obtain better performance on benchmark datasets compared with baselines. Code and datasets are available in https://github.com/zjunlp/DeepKE/tree/main/example/llm.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑