The invention relates to the field of
natural language processing and
graph database query, in particular to a Cypher generation method and
system based on a directional
control mode, comprising three parts of data preprocessing, directional
control mode design and
graph database query. According to the method, the problem of the uncertainty of the Cypher generated by the LLM is effectively solved through the design of the directional
control mode; the Schema is dynamically generated according to the
user input, so that the data scale is reasonably controlled on the premise of ensuring the accuracy of the generated Cypher, and the performance reduction caused by
processing excessive data is avoided; various advanced optimization means are comprehensively applied, including but not limited to lexical and syntactic analysis, de-noising
processing, standardized conversion and the like on text data, the processing capacity of the
system on various complex text data is effectively improved through the means, and the processing capacity of the
system on various complex text data is effectively improved regardless of academic literatures with strict structures and web texts with various styles. And the system can accurately respond, and the adaptability is obviously enhanced.