CodeKGC: Code Language Model for Generative Knowledge Graph Construction

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Bi, Zhen, Chen, Jing, Jiang, Yinuo, Xiong, Feiyu, Guo, Wei, Chen, Huajun, Zhang, Ningyu
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914644477607936
author Bi, Zhen
Chen, Jing
Jiang, Yinuo
Xiong, Feiyu
Guo, Wei
Chen, Huajun
Zhang, Ningyu
author_facet Bi, Zhen
Chen, Jing
Jiang, Yinuo
Xiong, Feiyu
Guo, Wei
Chen, Huajun
Zhang, Ningyu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2304_09048
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle CodeKGC: Code Language Model for Generative Knowledge Graph Construction
Bi, Zhen
Chen, Jing
Jiang, Yinuo
Xiong, Feiyu
Guo, Wei
Chen, Huajun
Zhang, Ningyu
Computation and Language
Artificial Intelligence
Information Retrieval
Machine Learning
Software Engineering
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.
title CodeKGC: Code Language Model for Generative Knowledge Graph Construction
topic Computation and Language
Artificial Intelligence
Information Retrieval
Machine Learning
Software Engineering
url https://arxiv.org/abs/2304.09048