科研速览 · Science Skim继续刷下去 · Keep skimming →
◆ Decision Support Systems2025-10-06· Computer science

Prompting large language models based on semantic schema for text-to-Cypher transformation towards domain Q&A

Yuwei Wan, Zheyuan Chen, Ying Liu, Chong Chen, Michael Packianather

原始摘要(英文原文)· Original abstract
Translating natural language inquiries into executable Cypher queries (text-to-Cypher) is a persistent bottleneck for non-technical teams relying on knowledge graphs (KGs) in fast-changing industrial settings. Rule and template converters need frequent updates as schemas evolve, while supervised and fine-tuned parsers require recurring training. This study proposes a schema-guided prompting approach, namely text-to-Cypher with semantic schema (T2CSS), to align large language models (LLMs) with domain knowledge for producing accurate Cypher. T2CSS distils a domain ontology into a lightweight semantic schema and uses adaptive filtering to inject the relevant subgraph and essential Cypher rules into the prompt for constraining generation and reducing schema-agnostic errors. This design keeps the prompt focused and within context length limits while providing the necessary domain grounding. Comparative experiments demonstrate that T2CSS with GPT-4 outperformed baseline models and achieved 86 % accuracy in producing correct Cypher queries. In practice, this study reduces retraining and maintenance effort, shortens turnaround times, and broadens KG access for non-experts. • A T2CSS prompting approach that guides LLMs with the domain schema is proposed. • A systematic semantic schema to cover multifaceted concepts is designed. • An information filtering mechanism to select the relevant information is proposed. • Results achieve 86 % accuracy in translating user inquiries to Cypher statements.
读原文 · Read the paper ↗

AI 追问PRO

登录后使用 AI 追问

讨论区

登录后参与讨论

相关论文 · Related

Prompting large language models based on semantic schema for text-to-Cypher transformation towards domain Q&A — 科研速览 Science Skim