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.


翻译:我们提出了一种新方法,利用大语言模型从自然语言问题或关键词查询生成针对RDF知识图谱的SPARQL查询。该方法无需微调,而是通过策略性地执行SPARQL查询并搜索相关IRI和字面值,引导语言模型探索知识图谱。我们在多种基准测试(涵盖不同类型和规模的知识图谱)和语言模型(不同规模与类型的商业及开源模型)上评估了该方法,并与现有方法进行了比较。在Wikidata上,我们在多个基准测试中取得了零样本设置下的最优结果;在Freebase上,我们的结果接近最佳少样本方法;在其他较少被评估的知识图谱和基准测试中,该方法整体表现良好。我们还进行了多项附加研究,包括比较不同的图谱搜索方式、引入反馈机制以及利用少样本示例。

0
下载
关闭预览

相关内容

《用于代码弱点识别的 LLVM 中间表示》CMU
专知会员服务
14+阅读 · 2022年12月12日
UTC: 用于视觉对话的任务间对比学习的统一Transformer
专知会员服务
14+阅读 · 2022年5月4日
图机器学习 2.2-2.4 Properties of Networks, Random Graph
图与推荐
10+阅读 · 2020年3月28日
【NeurIPS2019】图变换网络:Graph Transformer Network
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员