arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2512.14277cs.IRcs.AIcs.CL
收藏

SPARQL-LLM: 从自然语言问题实时生成SPARQL查询

SPARQL-LLM: Real-Time SPARQL Query Generation from Natural Language Questions

SIB Swiss Institute of Bioinformatics(瑞士生物信息学研究所);University of Zurich(苏黎世大学)

Panayiotis Smeros, Vincent Emonet, Ruijie Wang, Ana-Claudia Sima, Tarcisio Mendes de Farias

AI总结:

SPARQL-LLM通过轻量级元数据方法,实现了从自然语言到SPARQL查询的高效生成,提升了准确性和效率,适用于实时低成本应用。

摘要:

大型语言模型的出现推动了新型方法的出现,这些方法有望更好地解决从自然语言生成结构化查询(如SPARQL查询)的挑战。然而,这些新方法大多只关注单一数据源的响应准确性,而忽略了其他评估标准,如在分布式数据存储上执行联合查询的能力,以及生成SPARQL查询的运行时间和成本。因此,它们通常不适用于生产环境或在(可能为联合的)知识图谱上部署。为缓解这些问题,本文扩展了我们之前的工作,描述并系统评估了SPARQL-LLM,一种开源且不依赖三元组存储的轻量级元数据方法,能够从自然语言文本生成SPARQL查询。首先,我们描述了其架构,包括专门用于元数据索引、提示构建和查询生成与执行的组件。然后,我们基于最先进的挑战(包含多语言问题)和三个最流行的生物信息学知识图谱中的问题集进行了评估。我们的结果表明,在最先进的挑战中,F1分数提高了24%,能够适应英语和西班牙等高资源语言,以及能够生成复杂的联合生物信息学查询。此外,我们还展示了SPARQL-LLM的速度比挑战中其他系统快36倍,且每个问题的成本最高仅为0.01美元,使其适合实时、低成本的文本到SPARQL应用。一个部署在真实世界去中心化知识图谱上的应用示例可以在https://www.expasy.org/chat上找到。

英文摘要:

The advent of large language models is contributing to the emergence of novel approaches that promise to better tackle the challenge of generating structured queries, such as SPARQL queries, from natural language. However, these new approaches mostly focus on response accuracy while ignoring other evaluation criteria, such as runtime and cost to generate SPARQL queries. Consequently, they are often not production-ready or easy to deploy over real-world knowledge graphs with good accuracy. To mitigate these issues, in this paper, we describe and systematically evaluate SPARQL-LLM, an open-source and triplestore-agnostic approach, powered by lightweight metadata, that generates SPARQL queries from natural language text. First, we describe its architecture, which consists of dedicated components for metadata indexing, prompt building, and query generation and execution. Then, we evaluate it based on a state-of-the-art challenge with multilingual questions, and a collection of questions from three of the most prevalent knowledge graphs within the field of bioinformatics. Our results demonstrate a substantial improvement of up to 59% in F1 score over the second-best system participating in the challenge, adaptability to high-resource languages such as English, Spanish, and German, as well as ability to form complex bioinformatics queries. Furthermore, our results show that our system is up to 27x faster than the second-best system participating in the challenge, while costing a maximum of $0.01 per question, making it suitable for real-time, low-cost text-to-SPARQL applications. SPARQL-LLM is publicly released as an open-source project at https://github.com/sib-swiss/sparql-llm and is currently deployed over real-world decentralized knowledge graphs at https://www.expasy.org/chat.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑