无需微调,用大模型零样本生成跨知识图谱的SPARQL查询。
GRASP: Generic Reasoning And SPARQL Generation across Knowledge Graphs
- 利用大模型主动执行查询探索图谱,寻找相关实体与属性。
- 在Wikidata上达到顶尖性能,Freebase接近最佳有监督方法。
- 支持多种模型和知识图谱,适合跨领域问答系统开发。
我们提出一种新方法,通过大语言模型从自然语言问题或关键词查询生成RDF知识图谱上的SPARQL查询,无需微调。该方法利用语言模型策略性地执行SPARQL查询,探索知识图谱并搜索相关IRI和字面量。我们在多种基准(涵盖不同种类和规模的知识图谱)及语言模型(不同规模与类型,包括商用与开源)上评估该方法,并与现有方法对比。在Wikidata上,尽管处于零样本设置,仍达到当前最优结果;在Freebase上接近最佳的少样本方法;在其他较少被评估的知识图谱和基准上也表现良好。我们还进行了多项额外研究,如比较不同的图谱搜索方式、引入反馈机制,以及利用少量示例。
原文摘要 · Abstract (English)
We propose a new approach for generating SPARQL queries on RDF knowledge graphs from natural language questions or keyword queries, using a large language model. Our approach does not require fine-tuning. Instead, it uses the language model to explore the knowledge graph by strategically executing SPARQL queries and searching for relevant IRIs and literals. We evaluate our approach on a variety of benchmarks (for knowledge graphs of different kinds and sizes) and language models (of different scales and types, commercial as well as open-source) and compare it with existing approaches. On Wikidata we reach state-of-the-art results on multiple benchmarks, despite the zero-shot setting. On Freebase we come close to the best few-shot methods. On other, less commonly evaluated knowledge graphs and benchmarks our approach also performs well overall. We conduct several additional studies, like comparing different ways of searching the graphs, incorporating a feedback mechanism, or making use of few-shot examples.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。