用数据自动生成企业知识图谱的自然语言查询,提升准确率。
KG2Cypher: Data-Centric Pipeline for Building Enterprise Text-to-Cypher Systems

- 从图谱事实生成可执行查询,再用大模型生成对应问题。
- 在韩企场景下,查询准确率提升至95.2%,执行结果F1达0.964。
- 适合需要低成本构建企业级问答系统的团队使用。
企业知识图谱(KG)在内部搜索、分析和问答中应用日益广泛,但为私有企业图谱构建自然语言接口仍成本高昂。本文提出KG2Cypher,一种基于数据的流水线方法,用于从现有知识图谱构建文本到Cypher查询系统。该方法首先从图谱事实生成可执行的Cypher查询,再利用大模型生成对应的自然语言问题。生成的文本-Cypher对经由大模型评判与人工验证,转化为带候选信息的监督微调数据。训练后的生成器采用类别条件化模式提示、实体检索和基于LoRA的推理进行部署。我们在韩企场景下评估该方法,面对短查询和模式改写导致的语言对齐困难,LoRA微调使广播节目查询的执行结果F1从0.806提升至0.950,公司查询从0.70提升至0.92。在11类分类任务中,系统达到95.2%精确匹配、99.9%执行率和0.964的执行结果F1。
原文摘要 · Abstract (English)
Enterprise Knowledge Graphs (KGs) are increasingly used for internal search, analytics, and question answering, but building natural-language interfaces for private enterprise graphs remains costly. We present KG2Cypher, a data-centric pipeline for building enterprise text-to-Cypher systems from existing KGs. KG2Cypher first constructs an executable Cypher query from observed graph facts and then uses LLMs to generate its associated natural-language question. The resulting Text-Cypher pairs are validated with an LLM judge and human validation, and are converted into candidate-aware SFT data. The trained generator is served with class-conditioned schema prompting, entity retrieval, and LoRA-based inference. We evaluate KG2Cypher in Korean enterprise settings, where short search-style queries and schema paraphrases make language grounding difficult. LoRA SFT improves execution-result F1 from 0.806 to 0.950 on broadcast-program queries and from 0.70 to 0.92 on company queries. In an 11-class setting, KG2Cypher achieves 95.2% exact match, 99.9% execution rate, and 0.964 execution-result F1.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。