Graph question answering method and system based on context semantic retrieval and computer readable medium

By performing error correction and semantic retrieval on user-input questions, and combining a multi-layer sliding window screening algorithm, questions and answers that meet the format requirements are generated. This solves the problem of limited effectiveness in fast question answering in existing technologies and achieves efficient knowledge graph question answering.

CN116521837BActive Publication Date: 2026-06-26南京云问网络技术有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
南京云问网络技术有限公司
Filing Date
2023-04-07
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies lack training data when quickly experiencing question-answering effects, making them unsuitable for knowledge graph question-answering systems. Furthermore, existing methods require long-term training of deep neural networks and a large amount of labeled data.

Method used

By correcting user-input questions, performing semantic retrieval using a pre-trained model, and combining a multi-layer sliding window filtering algorithm and a graph query statement generation module, answers to questions that meet the format requirements are generated, avoiding the need for large amounts of labeled data and long-term training.

Benefits of technology

It improves the parsing accuracy of knowledge graph question answering systems, simplifies question type judgment, and achieves fast and efficient question answering results, making it suitable for scenarios lacking training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116521837B_ABST
    Figure CN116521837B_ABST
Patent Text Reader

Abstract

The application provides a graph question answering method and system based on context semantic retrieval and a computer readable medium, comprising: performing error correction processing on a question input by a user to generate a question sentence conforming to a format requirement; constructing a pre-training model based on context semantic retrieval to perform semantic retrieval on the question sentence to obtain candidate S, P and O; performing fine screening on the candidate S, P and O in combination with a multi-layer sliding window fine screening algorithm to obtain target S, P and O; judging a question type of the target S, P and O, generating a graph query statement corresponding to the question type through a graph query statement generation module; executing the graph query statement on a graph database and analyzing a query result to generate a question answer conforming to a format requirement to feed back to the user. The method solves the demand for a large amount of labeled data and model training to adapt to a scene in which an existing knowledge graph system needs to quickly experience a question answering effect and lacks training data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing (NPL) technology, and more specifically to a graph question-answering method, system, and computer-readable medium based on contextual semantic retrieval. Background Technology

[0002] Currently, question answering based on standard tables (providing intelligent question answers for queries and inferences related to a given table) is becoming increasingly important. Existing technologies typically parse questions into corresponding SQL statements to achieve question answering. However, converting standard table data into triples to construct a graph and performing question answering on the graph, using a knowledge graph question answering system to complete the question answering task, is a common table question answering solution.

[0003] In existing technologies, standard table-based question answering tasks are defined as knowledge graph-based question answering tasks. This involves semantically parsing the user's input query (question) to generate a structured query statement, and selecting several entities or attribute values ​​from a given knowledge base as the answer to the question. This is the existing knowledge graph question answering system. It usually requires long-term training with deep neural networks and a large amount of labeled data during training. This approach is not suitable for scenarios where a quick experience of question answering effects is needed but training data is lacking. Summary of the Invention

[0004] According to a first aspect of the present invention, a graph question-answering method based on contextual semantic retrieval is provided, comprising:

[0005] Step 1: Correct the user's input and generate a question that meets the format requirements;

[0006] Step 2: Construct a pre-trained model based on contextual semantic retrieval, perform semantic retrieval on the question, and obtain candidate S, P, and O;

[0007] Step 3: Use a multi-layer sliding window fine screening algorithm to finely screen the candidate S, P, and O to obtain the target S, P, and O;

[0008] Step 4: Determine the problem type of the target S, P, and O, and generate a graph query statement corresponding to the problem type through the graph query statement generation module;

[0009] Step 5: Execute the graph query statement on the graph database and parse the query results to generate a question answer that meets the format requirements and provide feedback to the user.

[0010] Furthermore, in step 1 above, the user-input question is corrected to generate a question that meets the format requirements, including:

[0011] Determine if the user's input contains typos or incorrect pinyin;

[0012] If the user's input question contains typos, the Query error correction module will correct the typos, replace the typos with the correct Chinese characters, and generate a question that meets the format requirements.

[0013] If the user's input question contains incorrect pinyin, the Query error correction module will correct the incorrect pinyin, replace the incorrect pinyin with the correct Chinese characters, and generate a question that meets the format requirements.

[0014] If the user's input question does not contain any typos or incorrect pinyin, a question that meets the format requirements will be generated directly.

[0015] Furthermore, in step 2 above, a pre-trained model is constructed based on contextual semantic retrieval, trained by optimizing the negative log-likelihood function, and represented in the form of a loss function, as follows:

[0016]

[0017] Where q represents the question, c represents the candidate vector table, and s(q,c) represents the matching similarity of the standard vectors of the entire statement.

[0018] Furthermore, in step 2 above, semantic retrieval is performed on the question to obtain candidate S, P, and O, including:

[0019] The token encoding of the question and the candidate vector table is set as the context vector and input into the pre-trained model to find the subject through the pointer network;

[0020] By concatenating the subject with the context vector, all predicates involved by the subject in the question text can be obtained;

[0021] Find the object corresponding to each predicate in the question text using a pointer network;

[0022] Output the found subject, predicate, and object to obtain candidate S, P, and O.

[0023] Furthermore, in step 3 above, the candidate S, P, and O are further refined using a multi-layer sliding window screening algorithm to obtain the target S, P, and O, including:

[0024] The candidate strings S, P, and O are stored using a hash set, and the hash set is used as a sliding window;

[0025] By sliding the S-character index through the sliding window, the longest substring is removed;

[0026] Slide the window again to remove substrings of other lengths, keeping only substrings of average length;

[0027] Select the characters corresponding to the retained substring to obtain the target S;

[0028] Then, by sliding the P and O character indices through the sliding window, the longest substring is removed synchronously.

[0029] Slide the window again to simultaneously remove substrings of other lengths, keeping only substrings of average length;

[0030] Select the characters corresponding to the substrings to be retained, and obtain the target P and O.

[0031] Further, the problem types of the targets S, P, and O are determined, including:

[0032] The query type determination module determines the question type of the indexes generated for the target S, P, and O.

[0033] If the index generated by the targets S, P, and O is OPS, then the problem type is a reverse lookup problem.

[0034] If the index generated by the targets S, P, and O is SOP, then the problem type is a relational problem.

[0035] If the index generated by the targets S, P, and O is SPO, then the problem type is a direct lookup problem.

[0036] Furthermore, in step 4 above, the graph query statement generation module generates a graph query statement corresponding to the question type, including:

[0037] If it is a reverse lookup problem, then the graph query statement is generated through the reverse lookup graph query statement generation module;

[0038] If it is a relational problem, a graph query statement is generated through the relational graph query statement generation module;

[0039] If the question is a direct query question, a graph query statement is generated through the direct query graph query statement generation module. According to a second aspect of the present invention, a graph question-answering system based on contextual semantic retrieval is provided, comprising:

[0040] One or more processors;

[0041] The memory stores operable instructions that, when executed by the one or more processors, cause the one or more processors to perform operations, including flows such as those of a graph question-answering method based on contextual semantic retrieval.

[0042] According to a third aspect of the present invention, a computer-readable medium for storing software is provided, the software including instructions executable by one or more computers, the instructions causing the one or more computers to perform operations, the operations including a process such as a graph question-answering method based on context semantic retrieval.

[0043] Compared with existing technologies, the technical effects achieved by this invention are as follows: The method of this invention improves the accuracy of question parsing in knowledge graph question answering systems by performing error correction on the question sentences. Simultaneously, it performs semantic matching operations on question words using a contextual vocabulary matching scoring function and BERT's CLS representation method, judging the target SPO based on the overall standard vector similarity of the entire sentence, thus improving the accuracy of vocabulary matching. Furthermore, this invention achieves accurate judgment of the target SPO through a multi-layer sliding window fine screening algorithm, providing accurate assurance for subsequent question type determination, avoiding the need for large amounts of labeled data and model training. This makes it suitable for scenarios in existing knowledge graph systems where rapid question answering performance is required but training data is lacking.

[0044] It should be understood that all combinations of the foregoing concepts and the additional concepts described in more detail below may be considered part of the inventive subject matter of this disclosure, provided that such concepts do not contradict each other. Furthermore, all combinations of the claimed subject matter are considered part of the inventive subject matter of this disclosure.

[0045] The foregoing and other aspects, embodiments, and features of the teachings of the present invention will be more fully understood from the following description in conjunction with the accompanying drawings. Other additional aspects of the invention, such as features and / or beneficial effects of exemplary embodiments, will become apparent from the following description or may be learned through practice of specific embodiments according to the teachings of the present invention. Attached Figure Description

[0046] The accompanying drawings are not intended to be drawn to scale. In the drawings, each identical or nearly identical component shown in the various figures may be denoted by the same reference numeral. For clarity, not every component is labeled in each figure. Embodiments of various aspects of the invention will now be described by way of example and with reference to the accompanying drawings, wherein:

[0047] Figure 1 This is a flowchart illustrating a graph question-answering method based on contextual semantic retrieval, as shown in an embodiment of the present invention.

[0048] Figure 2 This is a schematic diagram of an error correction process according to an embodiment of the present invention;

[0049] Figure 3 This is a schematic diagram of the SPO identification process according to an embodiment of the present invention;

[0050] Figure 4 This is a schematic diagram of the problem type determination process according to an embodiment of the present invention;

[0051] Figure 5 This is a schematic diagram of the graph query statement generation process according to an embodiment of the present invention. Detailed Implementation

[0052] To better understand the technical content of the present invention, specific embodiments are described below in conjunction with the accompanying drawings.

[0053] Various aspects of the invention are described in this disclosure with reference to the accompanying drawings, which illustrate numerous illustrative embodiments. The embodiments of this disclosure are not necessarily intended to encompass all aspects of the invention. It should be understood that the various concepts and embodiments described above, as well as those described in more detail below, can be implemented in any of many ways, because the concepts and embodiments disclosed herein are not limited to any particular implementation. Furthermore, some aspects of the invention disclosed may be used alone or in any suitable combination with other aspects of the invention disclosed.

[0054] According to an embodiment of the present invention, in combination Figure 1 The flowchart shown illustrates a graph-based question-answering method based on contextual semantic retrieval, comprising the following steps:

[0055] Step 1: Correct the user's input and generate a question that meets the format requirements;

[0056] Step 2: Construct a pre-trained model based on contextual semantic retrieval, perform semantic retrieval on the question, and obtain candidate S, P, and O;

[0057] Step 3: Combine the multi-layer sliding window fine screening algorithm to finely screen the candidate S, P, and O to obtain the target S, P, and O;

[0058] Step 4: Determine the problem type of the target S, P, and O, and generate the corresponding graph query statement through the graph query statement generation module;

[0059] Step 5: Execute the graph query statement on the graph database and parse the query results to generate answers to questions that meet the required format and provide feedback to the user.

[0060] The following is combined with Figures 2-5 The flowchart shown, along with some preferred or optional examples of the present invention, more specifically describes the implementation process and / or effects of certain embodiments of the present invention.

[0061] [Error Correction]

[0062] Combination Figure 2In step 1 above, the user-input question is corrected to generate a question that meets the format requirements, including:

[0063] Users enter the questions they want to know the answers to on the knowledge graph question-and-answer system's display interface;

[0064] The question-and-answer system calls the Query error correction module to determine whether there are typos or incorrect pinyin in the user's input question;

[0065] If the user's input question contains a typo, the Query error correction module will retrieve a thesaurus to correct the typo, replace the typo with the correct Chinese character, and generate a question that meets the format requirements.

[0066] If the user's input question contains incorrect pinyin, the Query error correction module will retrieve the thesaurus to correct the incorrect pinyin, replace the incorrect pinyin with the correct Chinese characters, and generate a question that meets the format requirements.

[0067] If the user's input question does not contain any typos or incorrect pinyin, a question that meets the format requirements will be generated directly.

[0068] The generated questions that meet the format requirements are input into the pre-trained model for semantic retrieval.

[0069] It should be noted that when users input questions, there may be typos or some words may be in pinyin. If typos or pinyin are not corrected in time, and questions without pinyin or typos are generated, the accuracy of the question content recognition will be affected, resulting in the inability to generate an answer or the generated answer being inaccurate.

[0070] Preferably, the Query correction module proposed in this embodiment improves the accuracy of semantic parsing of the question by judging the misspellings and pinyin errors of the user input question (Query) and replacing them with correct Chinese characters. This provides an accurate reference benchmark for subsequent word character similarity matching and question type judgment, avoiding the need for annotation training on a large amount of data, so as to achieve a simple and efficient application scenario.

[0071] [Candidates for S, P, and O have been obtained]

[0072] Combination Figure 3 In step 2 above, a pre-trained model is constructed based on contextual semantic retrieval to perform semantic retrieval on the question, obtaining candidate S, P, and O, including:

[0073] A pre-trained model is built based on contextual semantic retrieval. It is trained by optimizing the negative log-likelihood function and represented by the loss function, as follows:

[0074]

[0075] Where q represents the question, c represents the candidate vector table, and s(q,c) represents the matching similarity of the standard vectors of the entire sentence.

[0076] The token encoding of the generated questions and candidate vector tables that meet the format requirements is set as the context vector and input into the pre-trained model to find the subject through the pointer network;

[0077] The mathematical formula for setting the context vector is expressed as follows:

[0078]

[0079]

[0080] Where q represents the question, c represents the candidate vector table, and b represents the offset. Vector representation of a question. W represents the vector representation of the candidate vector table. tok LM() is the function that outputs n from the model. lm Mapping a 1-dimensional vector to a lower-dimensional n t dimensional vector;

[0081] Furthermore, the pointer network, based on the attention mechanism, uses the subject attention as a pointer to the context vector to output the subject element of the discrete token in the pre-trained model, thus obtaining the subject.

[0082] By connecting the subject with the context vector, all predicates involved by the subject in the question text can be obtained;

[0083] Specifically, the subject and context vector are connected by using the CLS representation of the BERT model (a natural language processing model). This involves adding CLS symbols to the BERT model and using the corresponding output as the semantic representation of the text. The input sentence is then segmented using SEP symbols to complete the classification. The resulting standard vector represents the entire question. The mathematical formula for this is as follows:

[0084]

[0085]

[0086]

[0087] in, and S represents the overall standard vector of the entire question. tok (q,c) represents the similarity of words in the context;

[0088] The matching similarity score of the overall standard vector of the question is calculated using a scoring function based on contextual lexical similarity. Combined with the overall standard vector of the entire question, semantic lexical matching information is provided to match the predicate. The mathematical expression is as follows:

[0089]

[0090] in, S represents the dot product of two vectors. full (q,c) represents the matching similarity score;

[0091] The pointer network finds the object corresponding to each predicate in the question text. That is, the pointer network is based on the attention mechanism, and uses the object attention as a pointer to the context vector to output the object element in the overall standard vector of the input question, thus obtaining the object.

[0092] Output the found subject, predicate, and object to obtain candidate S, P, and O;

[0093] Where S represents the subject, P represents the predicate, and O represents the object;

[0094] The candidate S, P, and O are then imported into a multi-layer sliding window fine screening algorithm for fine screening.

[0095] It should be noted that this embodiment classifies the question words using the CLS representation method of the BERT model, and calculates the matching similarity score of the text vectors by combining the scoring function of context word matching. It provides high-level semantic matching information based on the similarity between the standard vectors of the entire question, solves the problem of word mismatch in the semantic retrieval process, and avoids the need for annotation of a large amount of data.

[0096] [Achieve the target S, P, O]

[0097] In step 3 above, the candidate S, P, and O are refined using a multi-layer sliding window screening algorithm to obtain the target S, P, and O, including:

[0098] The obtained candidate S, P, and O are imported into the multi-layer sliding window fine screening algorithm. The hash set is used to store the strings of candidate S, P, and O, and the hash set is used as the sliding window.

[0099] First, slide the S character index through a sliding window to remove the longest substring;

[0100] Slide the window again to remove substrings of other lengths, keeping only substrings of average length;

[0101] Select the characters corresponding to the retained substring to obtain the target S;

[0102] Then, the P and O character indices are slid synchronously through a sliding window, and the longest substring is removed;

[0103] Slide the window again to simultaneously remove substrings of other lengths, keeping only substrings of average length;

[0104] Select the characters corresponding to the substrings to be retained, and obtain the target P and O.

[0105] This embodiment uses "What is the land area of ​​China?" as an example to explain in detail the multi-layer sliding window screening algorithm described above. Specifically, the obtained candidate S, P, and O are imported into the multi-layer sliding window screening algorithm. A hash set is used to store the strings of candidate S, P, and O (with a length of 7). The hash set is used as a sliding window to slide through the stored strings to obtain multiple windows. A window is randomly selected, for example, window 7. The longest substring in window 7 is removed. The first screening is performed based on the matching similarity between the first 7 characters (window 7 is the character index, so selecting window 7 means selecting the first 7 characters) and all candidate S, P, and O. The first three characters with the same matching similarity as candidate S are retained. The second screening is then performed. The sliding window is used to select the substring with the average length in window 3 (i.e., the index of the first three characters obtained in the first screening). This results in S (China). After obtaining S (China), the screening of candidate P and O is performed synchronously according to the above steps to obtain P (area) and O (how much). Therefore, the obtained target S, P, and O are S (China), P (area), and O (how much).

[0106] Preferably, this embodiment does not require long-term training using deep neural networks. Instead, it uses a multi-layer sliding window fine screening algorithm to finely screen candidate S, P, and O, obtaining target S, P, and O in a simplified screening manner. This provides accurate reference for subsequent question type judgment and saves time for rapid modeling and experience of knowledge graph question answering, achieving a simple and efficient application experience.

[0107] [Identify the problem type related to the target S, P, and O]

[0108] Combination Figure 4 In step 4 above, determining the problem type of targets S, P, and O includes:

[0109] An index is adaptively generated based on the obtained target S, P, and O;

[0110] The query type determination module determines the question type for generating indexes for the target S, P, and O;

[0111] If the index generated by the targets S, P, and O is OPS, then the problem type is a reverse lookup problem.

[0112] If the index generated by the targets S, P, and O is SOP, then the problem type is a relational problem.

[0113] If the index generated by the targets S, P, and O is SPO, then the problem type is a direct lookup problem.

[0114] Furthermore, the Query type determination module transmits the determination results of the target S, P, O problem types to the graph query statement generation module for storage, so as to generate graph query statements.

[0115] Taking "What is the land area of ​​China?" as an example, combining the target S (China), P (area), and O (how much) obtained from the above steps, the adaptively generated index is SPO. The question type is a direct query question, which is then transmitted to the direct query graph query statement generation module to generate the corresponding graph query statement.

[0116] [Generate graph query statement]

[0117] Combination Figure 5 In step 4 above, the graph query statement generation module generates a graph query statement corresponding to the question type, including:

[0118] The graph query statement generation module receives the query type judgment result of the query type judgment module on the target S, P, O question type, and calls the corresponding graph query statement generation submodule to generate the graph query statement according to the different judgment results.

[0119] If it is a reverse lookup problem, then the graph query statement is generated through the reverse lookup graph query statement generation module;

[0120] If it is a relational problem, a graph query statement is generated through the relational graph query statement generation module;

[0121] If it is a direct query problem, then the graph query statement is generated through the direct query class graph query statement generation module;

[0122] The graph query statement generation submodule includes a reverse lookup class graph query statement generation module, a relational class graph query statement generation module, and a direct lookup class graph query statement generation module.

[0123] Furthermore, the question-and-answer system retrieves the graph database to parse the generated graph query statement, generates a question answer that meets the output format requirements based on the parsing results, and outputs it to the display interface of the question-and-answer system to provide feedback to the user, thereby achieving fast and efficient graph question-and-answer.

[0124] Preferably, the Graph Question Answering (TableQA) method based on contextual semantic retrieval provided in this embodiment is applicable to reverse lookup, direct lookup, and relational questions. It uses a semantic pre-trained model based on contextual semantic retrieval to recall S, P, and O (i.e., candidate S, P, and O) of the query. A multi-layer sliding window fine screening algorithm is used to identify the target S, P, and O to complete the query parsing. With the help of a downstream parsing algorithm, a graph query statement is generated based on the query parsing result, and the query statement is executed on the graph to obtain the question answer.

[0125] Preferably, for simple question-and-answer scenarios that require rapid modeling for experience, the method provided in this embodiment does not require a large amount of data annotation or long-term model training. The method provided in this embodiment effectively transforms the standard table question-and-answer task into a graph question-and-answer task involving single entity direct lookup, reverse lookup, and relationship query, thus achieving graph question-and-answer in a simple and efficient manner.

[0126] The aforementioned methods for word and sentence representation and matching calculation of text vectors can be carried out using existing technologies and methods, and will not be elaborated further in this example.

[0127] Based on the teachings of the above embodiments, other aspects of the present invention also propose a graph question-answering system based on contextual semantic retrieval, comprising: one or more processors and a memory.

[0128] The memory is used to store operable instructions that, when executed by the one or more processors, cause the one or more processors to perform operations, including the flow of the context-based semantic retrieval graph question-answering method of the foregoing embodiments, especially... Figure 1 The flowchart of the method is shown.

[0129] Other aspects disclosed in the embodiments of the present invention also propose a computer-readable medium for storing software including instructions executable by one or more computers, which, upon execution, cause the one or more computers to perform operations including the flow of the graph question-answering method based on context semantic retrieval of the foregoing embodiments, particularly... Figure 1 The flowchart of the method is shown.

[0130] While the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the invention. Those skilled in the art can make various modifications and refinements without departing from the spirit and scope of the invention. Therefore, the scope of protection of the present invention shall be determined by the claims.

Claims

1. A graph question-answering method based on contextual semantic retrieval, characterized in that, include: Step 1: Correct the user's input and generate a question that meets the format requirements; Step 2: Construct a pre-trained model based on contextual semantic retrieval, perform semantic retrieval on the question, and obtain candidate S, P, and O; Step 3: Use a multi-layer sliding window fine screening algorithm to finely screen the candidate S, P, and O to obtain the target S, P, and O; Step 4: Determine the problem type of the target S, P, and O, and generate a graph query statement corresponding to the problem type through the graph query statement generation module; Step 5: Execute the graph query statement on the graph database and parse the query results to generate a question answer that meets the format requirements and provide feedback to the user; In step 2 above, semantic retrieval is performed on the question to obtain candidate S, P, and O, including: The token encoding of the question and the candidate vector table is set as the context vector and input into the pre-trained model to find the subject through the pointer network; By concatenating the subject with the context vector, all predicates involved by the subject in the question text can be obtained; Find the object corresponding to each predicate in the question text using a pointer network; Output the found subject, predicate, and object to obtain candidate S, P, and O; In step 3 above, the candidate S, P, and O are refined using a multi-layer sliding window screening algorithm to obtain the target S, P, and O, including: The candidate strings S, P, and O are stored using a hash set, and the hash set is used as a sliding window; By sliding the S-character index through the sliding window, the longest substring is removed; Slide the window again to remove substrings of other lengths, keeping only substrings of average length; Select the characters corresponding to the retained substring to obtain the target S; Then, by sliding the P and O character indices through the sliding window, the longest substring is removed synchronously. Slide the window again to simultaneously remove substrings of other lengths, keeping only substrings of average length; Select the characters corresponding to the substrings to be retained, and obtain the target P and O.

2. The graph question-answering method based on contextual semantic retrieval according to claim 1, characterized in that, In step 1 above, the user-input question is corrected to generate a question that meets the format requirements, including: Determine if the user's input contains typos or incorrect pinyin; If the user's input question contains typos, the Query error correction module will correct the typos, replace the typos with the correct Chinese characters, and generate a question that meets the format requirements. If the user's input question contains incorrect pinyin, the Query error correction module will correct the incorrect pinyin, replace the incorrect pinyin with the correct Chinese characters, and generate a question that meets the format requirements. If the user's input question does not contain any typos or incorrect pinyin, a question that meets the format requirements will be generated directly.

3. The graph question-answering method based on contextual semantic retrieval according to claim 1 or 2, characterized in that, In step 4 above, determining the problem type of the targets S, P, and O includes: The query type determination module determines the question type of the indexes generated for the target S, P, and O. If the index generated by the targets S, P, and O is OPS, then the problem type is a reverse lookup problem. If the index generated by the targets S, P, and O is SOP, then the problem type is a relational problem. If the index generated by the targets S, P, and O is SPO, then the problem type is a direct lookup problem.

4. The graph question-answering method based on contextual semantic retrieval according to claim 3, characterized in that, In step 4 above, the graph query statement generation module generates a graph query statement corresponding to the question type, including: If it is a reverse lookup problem, then the graph query statement is generated through the reverse lookup graph query statement generation module; If it is a relational problem, a graph query statement is generated through the relational graph query statement generation module; If it is a direct query problem, a graph query statement is generated through the direct query class graph query statement generation module.

5. A graph question-answering system based on contextual semantic retrieval, characterized in that, include: One or more processors; The memory stores operable instructions that, when executed by the one or more processors, cause the one or more processors to perform operations, including the flow of the graph question answering method based on contextual semantic retrieval as described in any one of claims 1 to 4.

6. A computer-readable medium for storing software, characterized in that: The software includes instructions executable by one or more computers, which, through execution, cause the one or more computers to perform operations, including the flow of the graph question-answering method based on contextual semantic retrieval as described in any one of claims 1 to 4.