Enhancing Graph Query Generation for Medical Text by Aligning Domain Knowledge Graph with Large Language Models

Despite the growing interest in Natural Language to Cypher (NL2Cypher) for querying graph databases, driven by advances in Large Language Models (LLMs), research in this area remains limited. However, there are still challenges to be overcome, including the lack of domain‐specific knowledge constraints and the inconsistent generation of graph query language. This paper proposed a solution to these challenges by improving the LLM's ability to generate Cypher through the creation of a specialized dataset and subsequent fine‐tuning of the LLM. Our method involved three key steps: we constructed a medical NL2Cypher dataset that included both single‐hop and multi‐hop question types. Subsequently, we conducted named entity recognition on the queries and classified the recognized entities to provide contextually relevant entity information to LLM. By incorporating code‐structure graph schema details into the fine‐tuning input, we aligned the domain‐specific knowledge graph with the LLM, ensuring that the generated output adhered to the predefined Cypher structure. Finally, we utilized this prepared dataset for supervised fine‐tuning on the LLM. The experimental results showed that the accuracy of Cypher execution for single‐hop and multi‐hop questions is 95.65% and 96.69%, respectively. These outcomes were achieved with a smaller training set, indicating the effectiveness of the approach. © 2026 Institute of Electrical Engineers of Japan and Wiley Periodicals LLC.

Authors

Institutions

Publication Details

Journal
IEEJ Transactions on Electrical and Electronic Engineering
Published
2026-04-27
DOI
https://doi.org/10.1002/tee.70313
Primary Topic
Advanced Graph Neural Networks
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Enhancing Graph Query Generation for Medical Text by Aligning Domain Knowledge Graph with Large Language Models

Wei Liao, Lei Wang, Yang Liu, Zhen Xu
IEEJ Transactions on Electrical and Electronic Engineering
Advanced Graph Neural Networks
article

Enhancing Graph Query Generation for Medical Text by Aligning Domain Knowledge Graph with Large Language Models

Wei Liao, Lei Wang, Yang Liu, Zhen Xu
article en

Abstract

Despite the growing interest in Natural Language to Cypher (NL2Cypher) for querying graph databases, driven by advances in Large Language Models (LLMs), research in this area remains limited. However, there are still challenges to be overcome, including the lack of domain‐specific knowledge constraints and the inconsistent generation of graph query language. This paper proposed a solution to these challenges by improving the LLM's ability to generate Cypher through the creation of a specialized dataset and subsequent fine‐tuning of the LLM. Our method involved three key steps: we constructed a medical NL2Cypher dataset that included both single‐hop and multi‐hop question types. Subsequently, we conducted named entity recognition on the queries and classified the recognized entities to provide contextually relevant entity information to LLM. By incorporating code‐structure graph schema details into the fine‐tuning input, we aligned the domain‐specific knowledge graph with the LLM, ensuring that the generated output adhered to the predefined Cypher structure. Finally, we utilized this prepared dataset for supervised fine‐tuning on the LLM. The experimental results showed that the accuracy of Cypher execution for single‐hop and multi‐hop questions is 95.65% and 96.69%, respectively. These outcomes were achieved with a smaller training set, indicating the effectiveness of the approach. © 2026 Institute of Electrical Engineers of Japan and Wiley Periodicals LLC.

IEEJ Transactions on Electrical and Electronic Engineering
Shanghai University of Engineering Science (CN)
Quality Education
Openalex Percentile: Top 4%
Advanced Graph Neural Networks
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.