arXiv:2412.10064cs.LG2024-12被引 59

将自然语言转为图数据库查询语句,让普通人也能轻松用知识图谱。

Text2Cypher: Bridging Natural Language and Graph Databases

  • 用清洗整合的4.4万条数据微调大模型,提升自然语言转查询的准确性。
  • 微调后模型在谷歌BLEU和精确匹配上显著优于基线,最高提升超15%。
  • 适合想用知识图谱但不懂编程的科研人员、产品经理等非技术用户。

知识图谱通过节点、关系和属性表示复杂数据,存储在图数据库中时,可通过Cypher查询语言高效建模与查询。然而,使用Cypher需专业技能,对非专家用户构成挑战。本文提出Text2Cypher,旨在将自然语言查询翻译为Cypher语句,拓展知识图谱的应用范围。尽管大语言模型(LLMs)可用于此任务,但常因难以捕捉复杂语义而输出不完整或错误。微调领域特定数据集是更优方案,但高质量公开的Text2Cypher数据集稀缺。为此,我们整合并清洗多个公开数据集,构建了包含44,387个实例的高质量数据集,支持有效微调与评估。在该数据集上微调的模型在Google-BLEU和精确匹配指标上显著优于基线,验证了高质量数据与微调对提升性能的关键作用。

原文摘要 · Abstract (English)

Knowledge graphs use nodes, relationships, and properties to represent arbitrarily complex data. When stored in a graph database, the Cypher query language enables efficient modeling and querying of knowledge graphs. However, using Cypher requires specialized knowledge, which can present a challenge for non-expert users. Our work Text2Cypher aims to bridge this gap by translating natural language queries into Cypher query language and extending the utility of knowledge graphs to non-technical expert users. While large language models (LLMs) can be used for this purpose, they often struggle to capture complex nuances, resulting in incomplete or incorrect outputs. Fine-tuning LLMs on domain-specific datasets has proven to be a more promising approach, but the limited availability of high-quality, publicly available Text2Cypher datasets makes this challenging. In this work, we show how we combined, cleaned and organized several publicly available datasets into a total of 44,387 instances, enabling effective fine-tuning and evaluation. Models fine-tuned on this dataset showed significant performance gains, with improvements in Google-BLEU and Exact Match scores over baseline models, highlighting the importance of high-quality datasets and fine-tuning in improving Text2Cypher performance.

知识图谱自然语言图数据库大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。