用AI自动生成知识图谱的问答对和查询语句,提升数据可用性。
Q${}^2$Forge: Minting Competency Questions and SPARQL Queries for Question-Answering Over Knowledge Graphs
- 通过迭代式LLM生成并验证知识图谱的问答与SPARQL查询
- 支持任意知识图谱构建高质量参考查询集
- 模块化设计,可独立使用或替换组件
SPARQL是访问知识图谱的标准语言,但非专家用户难以编写,即使专家也耗时。最佳实践建议用能力问题和示例查询来说明知识图谱内容及其应用潜力,但实际中此类资源匮乏。大语言模型在对话系统中表现优异,可用于从自然语言问题生成目标编程语言代码。然而,训练高质量的自然语言到SPARQL转换模型需大量问题-查询对数据集。本文提出Q²Forge,用于为知识图谱自动生成能力问题及对应SPARQL查询,并通过人工反馈与LLM作为裁判进行迭代验证。该工具开源、通用、可扩展且模块化,各模块(能力问题生成、查询生成、查询优化)可独立使用或组合成完整流程。最终形成从问题定义到查询评估的端到端管道,支持为任意目标知识图谱创建参考查询集。
原文摘要 · Abstract (English)
The SPARQL query language is the standard method to access knowledge graphs (KGs). However, formulating SPARQL queries is a significant challenge for non-expert users, and remains time-consuming for the experienced ones. Best practices recommend to document KGs with competency questions and example queries to contextualise the knowledge they contain and illustrate their potential applications. In practice, however, this is either not the case or the examples are provided in limited numbers. Large Language Models (LLMs) are being used in conversational agents and are proving to be an attractive solution with a wide range of applications, from simple question-answering about common knowledge to generating code in a targeted programming language. However, training and testing these models to produce high quality SPARQL queries from natural language questions requires substantial datasets of question-query pairs. In this paper, we present Q${}^2$Forge that addresses the challenge of generating new competency questions for a KG and corresponding SPARQL queries. It iteratively validates those queries with human feedback and LLM as a judge. Q${}^2$Forge is open source, generic, extensible and modular, meaning that the different modules of the application (CQ generation, query generation and query refinement) can be used separately, as an integrated pipeline, or replaced by alternative services. The result is a complete pipeline from competency question formulation to query evaluation, supporting the creation of reference query sets for any target KG.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。