Knowledge question answering method, device, electronic device and readable storage medium

By constructing a calculation graph and calibrating node representation, the problem of high time complexity and incompleteness of answer detection of logical query statements in the knowledge graph is solved, and the accuracy and success rate of answer retrieval is improved.

CN115618011BActive Publication Date: 2024-12-06INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211193891.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2024-12-06
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

In the prior art, the subgraph matching algorithm is used to detect answers of logical query statements in the knowledge graph. There is a high time complexity and poor detection effect on incomplete knowledge graphs, resulting in many answers being unable to be retrieved.

Method used

By constructing a computing graph, the predicted node representation of the node is obtained, and calibration is performed based on the representation of the predecessor and successor nodes, and the target entity is finally determined as the answer to the logical query statement.

Benefits of technology

It improves the accuracy and success rate of answer detection of logical query statements in the knowledge graph, reduces the time complexity, and can better retrieve answers from incomplete knowledge graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115618011B_ABST
    Figure CN115618011B_ABST
Patent Text Reader

Abstract

The present invention provides a knowledge question and answer method, device, electronic device and readable storage medium, which relate to the field of computer technology. The method comprises: constructing a calculation graph based on an acquired logical query statement, and obtaining a predicted node representation of each node in the calculation graph; the calculation graph comprises node information of multiple nodes and the association relationship between adjacent nodes, and the node information comprises node depth; for each node in the calculation graph, calibrating the predicted node representation of the node based on the node representation of the predecessor node and the successor node of the node, and obtaining a calibrated node representation of the node; determining a target entity based on the calibrated node representation of the node in the calculation graph and the entity representation of each entity in a preset knowledge graph, and outputting the target entity as an answer to the logical query statement, thereby solving the technical problem of how to better detect the answer to the logical query statement from the knowledge graph in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a knowledge question answering method, device, electronic device and readable storage medium. Background Art

[0002] Knowledge base logic question answering is a basic research topic. Compared with general question answering, this task also needs to deal with first-order predicate logic, such as existential quantifiers. Conjunction (∧), disjunction (∨), and negation Knowledge base logical question answering can be used to answer precise user searches in search engines, recommend drugs in medical knowledge graphs, and analyze fault causes in fault diagnosis knowledge bases. Performing knowledge base logical question answering in large-scale and incomplete knowledge bases is a crucial basic task.

[0003] In the prior art, a subgraph matching algorithm is generally used to obtain answers to logical query statements. However, the time complexity of this algorithm is relatively high and is at an exponential level. In addition, when this algorithm is used to detect incomplete knowledge graphs, many answers cannot be retrieved due to the missing of a large number of edges in the knowledge graph.

[0004] Therefore, how to better detect the answers to logical query statements from the knowledge graph is a technical problem that needs to be urgently solved by technical personnel in related fields. Summary of the invention

[0005] The present invention provides a knowledge question answering method, device, electronic device and readable storage medium to solve the technical problem of how to better detect the answer to a logical query statement from a knowledge graph in the prior art, so as to achieve better knowledge question answering.

[0006] The present invention provides a knowledge question answering method, comprising:

[0007] Building a computation graph based on the acquired logical query statement, and acquiring a predicted node representation of each node in the computation graph; the computation graph includes node information of multiple nodes and association relationships between adjacent nodes, and the node information includes node depth;

[0008] For each node in the computation graph, calibrate the predicted node representation of the node based on the node representations of the predecessor node and the successor node of the node to obtain a calibrated node representation of the node;

[0009] The target entity is determined based on the calibrated node representation of the nodes in the computational graph and the entity representation of each entity in the preset knowledge graph, and the target entity is output as the answer to the logical query statement.

[0010] According to a knowledge question answering method provided by the present invention, constructing a computation graph based on the acquired logical query statement and obtaining a predicted node representation of each node in the computation graph includes:

[0011] The computation graph is generated based on the logical query statement and the topological sorting processing rule, wherein the multiple nodes in the computation graph are arranged in order of their node depths and are divided into a starting node, an intermediate node, and an ending node;

[0012] For each node in the computational graph, the association relationship between the node and its predecessor node and the predicted node representation of its predecessor node are input into a preset gated recurrent unit network to obtain the predicted node representation of the node.

[0013] According to a knowledge question answering method provided by the present invention, for each node in the computation graph, calibrating the predicted node representation of the node based on the node representations of the predecessor node and the successor node of the node to obtain the calibrated node representation of the node includes:

[0014] Executing a preliminary calibration process to perform preliminary calibration on the predicted node representation of each node in the computation graph in turn to obtain a preliminary calibrated node representation of each node; the preliminary calibrated node representation is obtained by calibrating the predicted node representation of the node based on a first calibrated node representation of a predecessor node corresponding to the node, the first calibrated node representation being a node representation obtained after preliminary calibration of the predecessor node;

[0015] Executing a target calibration process to perform target calibration on the preliminary calibrated node representation of each node in the computation graph to obtain a target calibrated node representation of each node; the target calibrated node representation is obtained by calibrating the preliminary calibrated node representation of the node based on a second calibrated node representation of a predecessor node and a successor node corresponding to the node, the second calibrated node representation including a node representation obtained after preliminary calibration or target calibration of the predecessor node and the successor node;

[0016] Based on the preliminary calibration node representation obtained by executing the preliminary calibration process and the target calibration node representation obtained by executing the target calibration process, a calibration node representation of each node in the computation graph is obtained, wherein the calibration node representation includes the preliminary calibration node representation and the target calibration node representation.

[0017] According to a knowledge question answering method provided by the present invention, the performing of the preliminary calibration process to sequentially perform preliminary calibration on the predicted node representation of each node in the computation graph to obtain a preliminary calibrated node representation of each node includes:

[0018] Performing the preliminary calibration process multiple times to preliminarily calibrate the predicted node representation of each node in the computation graph to obtain a preliminary calibrated node representation of each node;

[0019] The preliminary calibration process includes the following steps: obtaining a first preliminary calibration node representation of a current node in a previous preliminary calibration and a second preliminary calibration node representation of a predecessor node of the current node in a current preliminary calibration;

[0020] Based on the first preliminary calibration node representation and the second preliminary calibration node representation, obtaining first attention information of the current node in a current preliminary calibration;

[0021] Based on the first preliminary calibration node representation and the first attention information, obtain a third preliminary calibration node representation of the current node in a current preliminary calibration; repeat the above steps until every node in the computational graph is traversed.

[0022] According to a knowledge question answering method provided by the present invention, the target calibration process is executed to perform target calibration on the preliminary calibration node representation of each node in the computation graph to obtain the target calibration node representation of each node, including:

[0023] Executing the target calibration process multiple times to perform target calibration on the preliminary calibration node representation of each node in the computation graph to obtain a target calibration node representation of each node;

[0024] The target calibration process includes the following steps: respectively obtaining a first target calibration node representation, a second target calibration node representation, and a third target calibration node representation of a current node, a predecessor node, and a successor node of the current node in a previous target calibration;

[0025] Based on the first target calibration node representation, the second target calibration node representation, and the third target calibration node representation, obtaining second attention information of the current node in a previous target calibration;

[0026] Based on the first target calibration node representation and the second attention information, obtain the fourth target calibration node representation of the current node in the current target calibration; repeat the above steps until every node in the computational graph is traversed.

[0027] According to a knowledge question answering method provided by the present invention, the target entity is determined based on the calibration node representation of the node in the computation graph and the entity representation of each entity in the preset knowledge graph, including:

[0028] Obtaining a final query representation of the logical query statement based on a preliminary calibrated node representation of a termination node in the computation graph and a target calibrated node representation;

[0029] The similarity between the entity representation of each entity in the preset knowledge graph and the final query representation is obtained, and the entity with the highest similarity to the final query representation is determined as the target entity.

[0030] The present invention also provides a knowledge question-answering device, comprising:

[0031] A prediction module, used to construct a calculation graph based on the obtained logical query statement, and obtain a predicted node representation of each node in the calculation graph; the calculation graph includes node information of multiple nodes and association relationships between adjacent nodes, and the node information includes node depth;

[0032] A calibration module, configured to calibrate, for each node in the computation graph, a predicted node representation of the node based on node representations of a predecessor node and a successor node of the node, to obtain a calibrated node representation of the node;

[0033] The answering module is used to determine the target entity based on the calibrated node representation of the nodes in the computational graph and the entity representation of each entity in the preset knowledge graph, and output the target entity as the answer to the logical query statement.

[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the knowledge question and answer method as described above is implemented.

[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the knowledge question-answering methods described above.

[0036] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-described knowledge question-answering methods.

[0037] The knowledge question and answer method, device, electronic device and readable storage medium provided by the present invention construct a calculation graph based on a logical query statement and obtain the predicted node representation of each node in the calculation graph, so that the predicted node representation of the node in the calculation graph can be calibrated based on the node representation of the predecessor node and the successor node of the node, so as to improve the accuracy and information richness of the node representation of each node in the calculation graph, so that the answer to the logical query statement can be better detected from the knowledge graph based on the calibrated node representation, thereby improving the success rate and accuracy of knowledge question and answer, and solving the technical problem of how to better detect the answer to the logical query statement from the knowledge graph in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 This is one of the flow charts of the knowledge question answering method provided by the embodiment of the present invention;

[0040] Figure 2 This is the second flow chart of the knowledge question answering method provided by the embodiment of the present invention;

[0041] Figure 3 is a schematic diagram of the topological structure of a computational graph in an embodiment of the present invention;

[0042] Figure 4 This is the third flow chart of the knowledge question answering method provided by the embodiment of the present invention;

[0043] Figure 5 This is a fourth flow chart of the knowledge question answering method provided by an embodiment of the present invention;

[0044] Figure 6 is a schematic diagram of a preliminary calibration process in an embodiment of the present invention;

[0045] Figure 7 This is the fifth flow chart of the knowledge question answering method provided by the embodiment of the present invention;

[0046] Figure 8 is a schematic diagram of a target calibration process in an embodiment of the present invention;

[0047] Fig. 9 This is the sixth flow chart of the knowledge question answering method provided by the embodiment of the present invention;

[0048] Fig.10is a schematic diagram of a node representation calibration process in a specific embodiment of the present invention;

[0049] Fig.11 is a schematic diagram of the structure of a knowledge question-answering device provided by an embodiment of the present invention;

[0050] Fig.12 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] Combine the following Figure 1-Figure 6 The knowledge question answering method of the present invention is described. Figure 1 As shown, the present invention provides a knowledge question answering method, comprising:

[0053] Step S1, construct a calculation graph based on the obtained logical query statement, and obtain the predicted node representation of each node in the calculation graph; the calculation graph includes node information of multiple nodes and the association relationship between adjacent nodes, and the node information includes node depth.

[0054] Among them, the logical query statement can be expressed as q i The node information also includes the node name. The node depth is used to distinguish the order of multiple nodes. The higher the node depth of a node, the lower its order in the computation graph. The node information of some nodes in the computation graph also includes the specific entity corresponding to the node.

[0055] Step S2, for each node in the computation graph, calibrate the predicted node representation of the node based on the node representations of the predecessor node and the successor node of the node to obtain the calibrated node representation of the node.

[0056] The predecessor node represents the previous node of the node, and the successor node represents the next node of the node.

[0057] Step S3, determining the target entity based on the calibrated node representation of the nodes in the computation graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as the answer to the logical query statement.

[0058] Specifically, the calibrated node representation of the node in the computation graph is compared with the entity representation of each entity in the preset knowledge graph, and the target entity corresponding to the logical query statement is determined and output based on the comparison result.

[0059] The above steps S1 to S3, by constructing a calculation graph based on the logical query statement and obtaining the predicted node representation of each node in the calculation graph, can calibrate the predicted node representation of the node based on the node representation of the predecessor node and the successor node of the node in the calculation graph, so as to improve the accuracy and information richness of the node representation of each node in the calculation graph, so that the answer to the logical query statement can be better detected from the knowledge graph based on the calibrated node representation, thereby improving the success rate and accuracy of knowledge question and answering, and solving the technical problem of how to better detect the answer to the logical query statement from the knowledge graph in the prior art.

[0060] In one embodiment, Figure 2 As shown, the above step S1 includes steps S11 to S12, wherein:

[0061] Step S11, generating a computation graph based on the logical query statement and the topological sorting processing rules, wherein multiple nodes in the computation graph are arranged in order of their node depths and are divided into a start node, an intermediate node, and an end node.

[0062] Specifically, a computational graph in the form of a directed acyclic graph is generated based on the logical query statement and the topological sorting processing rules. The computational graph is used to characterize the computation order of multiple nodes and the association relationship between multiple nodes. The starting node can also be called an anchor node, and the ending node can also be called a target node.

[0063] Figure 3 An example of a topological structure of the computational graph in the present invention is provided, where the starting nodes include nodes a1 and a2, the intermediate nodes include nodes b1, b2 and b3, and the terminating node is node c. The association relationships include association relationships r1, r2 and r3. The node depth of the terminating node is the highest, the node depth of the intermediate node is the second highest, and the node depth of the starting node is the lowest. Among them, node a1, node a2, association relationship r1, association relationship r2 and association relationship r3 are determined based on the information in the logical query statement and are known. However, node b1, node b2, node b3 and the association relationships therebetween are unknown, and node c is the target node of the logical query statement, which is also unknown.

[0064] Step S12, for each node in the computation graph, the association relationship between the node and its predecessor node and the predicted node representation of its predecessor node are input into a preset gated recurrent unit network to obtain the predicted node representation of the node.

[0065] Specifically, the predicted node representation of a node can be calculated by the following formula (1):

[0066] h′=GRU(h,r) (1)

[0067] Among them, h′ represents the predicted node representation of the node, GRU represents the gated recurrent unit network, h represents the predicted node representation of the node's predecessor node, and r represents the association relationship between the node and its predecessor node.

[0068] In the above steps S11 to S12, a computational graph is generated based on a logical query statement and a topological sorting processing rule, so that multiple nodes in the computational graph are arranged in order of their node depths, and the node representations are predicted in sequence based on the arrangement order of the nodes, thereby obtaining a predicted node representation of each node.

[0069] In one embodiment, step S12 also includes: for a node having at least two predecessor nodes, obtaining the importance of each predecessor node of the node based on a multi-layer perceptron (MLP), and obtaining the predicted node representation of the node based on the predicted node representation and importance of each predecessor node of the node.

[0070] Specifically, the importance of each predecessor node of the node is obtained based on the multi-layer perceptron, and the weight corresponding to each predecessor node is obtained based on the importance of multiple predecessor nodes, wherein the weight corresponding to each predecessor node can be calculated by the following formula (2):

[0071]

[0072] Among them, α i represents the weight of the predecessor node i, MLP(p i ) represents the importance of the predecessor node i, MLP represents the multi-layer perceptron, ∑ j exp(MLP(p j )) represents the sum of the importance of multiple predecessor nodes.

[0073] Based on the predicted node representation and weight of each predecessor node of the node, the predicted node representation of the node is calculated, wherein the predicted node representation of the node can be calculated by the following formula (3):

[0074] p inter =∑ i α i ·p i (3)

[0075] Among them, p inter represents the predicted node representation of the node, p i Represents the predicted node representation of the predecessor node i of this node, α i Represents the weight of the predecessor node i of this node.

[0076] In one embodiment, the above formulas (2) to (3) can also be used to implement the conjunction operation of multiple sub-logical query statements, thereby obtaining a conjunction logical query statement, then α i represents the weight of the sub-logical query statement i, p t represents the query representation of the sub-logical query statement i, p inter A query representation that represents a conjunction logic query statement.

[0077] In one embodiment, Figure 4 As shown, the above step S2 includes steps S21 to S23, wherein:

[0078] Step S21, execute the preliminary calibration process to perform preliminary calibration on the predicted node representation of each node in the computation graph in turn to obtain the preliminary calibrated node representation of each node; the preliminary calibrated node representation is obtained by calibrating the predicted node representation of the node based on the first calibrated node representation of the predecessor node corresponding to the node, and the first calibrated node representation is the node representation obtained after the preliminary calibration of the predecessor node.

[0079] In one embodiment, when the total number of executions of the preliminary calibration process is once, the first calibrated node representation refers to the preliminary calibrated node representation of the predecessor node. Specifically, the predicted node representation corresponding to the first node is used as its preliminary calibrated node representation. The predicted node representation of the second node is preliminarily calibrated based on the preliminary calibrated node representation of the first node to obtain the preliminary calibrated node representation of the second node, and so on, until the preliminary calibrated node representation of the last node is obtained.

[0080] In one embodiment, when the total number of executions of the preliminary calibration process is multiple times, in the first preliminary calibration, the predicted node representation of the current node is calibrated based on the first calibrated node representation of the predecessor node to obtain the preliminary calibrated node representation of the current node in the first preliminary calibration. The first calibrated node representation refers to the preliminary calibrated node representation of the predecessor node obtained in the first preliminary calibration.

[0081] In the preliminary calibration after the first time, based on the first calibrated node representation of the predecessor node, the preliminary calibration node representation of the current node obtained in the previous preliminary calibration is further calibrated to obtain the preliminary calibration node representation of the current node in the current preliminary calibration. The first calibrated node representation refers to the preliminary calibration node representation of the predecessor node obtained in the current preliminary calibration.

[0082] Step S22, execute the target calibration process to perform target calibration on the preliminary calibration node representation of each node in the computation graph to obtain the target calibration node representation of each node; the target calibration node representation is obtained by calibrating the preliminary calibration node representation of the node based on the second calibrated node representation of the predecessor node and the successor node corresponding to the node, and the second calibrated node representation includes the node representation obtained after preliminary calibration or target calibration of the predecessor node and the successor node.

[0083] In one embodiment, when the total number of executions of the target calibration process is once, the second calibrated node representation refers to the preliminary calibration node representation finally obtained by the predecessor node or the successor node. Specifically, the preliminary calibration node representation corresponding to the first node is used as its target calibration node representation. The preliminary calibration node representation of the second node is further calibrated based on the preliminary calibration node representations of the first node and the third node to obtain the target calibration node representation of the second node, and so on, until the target calibration node representation of the last node is obtained.

[0084] In one embodiment, when the total number of executions of the target calibration process is multiple times, in the first target calibration, the second calibrated node representation refers to the preliminary calibration node representation finally obtained by the predecessor node or the successor node, and based on the preliminary calibration node representations of the predecessor node and the successor node, the preliminary calibration node representation of the current node is further calibrated to obtain the target calibration node representation of the current node in the first target calibration.

[0085] In the target calibration after the first time, the second calibrated node representation refers to the target calibration node representation of the predecessor node or the successor node obtained in the previous target calibration. Based on the second calibrated node representation of the predecessor node and the successor node, the target calibration node representation of the current node obtained in the previous target calibration is further calibrated to obtain the target calibration node representation of the current node in the current target calibration.

[0086] Step S23, based on the preliminary calibration node representation obtained by executing the preliminary calibration process and the target calibration node representation obtained by executing the target calibration process, obtain the calibration node representation of each node in the computation graph, the calibration node representation including the preliminary calibration node representation and the target calibration node representation.

[0087] In the above steps S21 to S23, a relatively accurate preliminary calibrated node representation is obtained by calibrating the predicted node representation of each node in the computation graph based on the preliminary calibration process, and the preliminary calibrated node representation of each node in the computation graph is further calibrated based on the target calibration process. This can further improve the accuracy of the node representation of each node in the computation graph, thereby being able to better detect the answer to the logical query statement from the knowledge graph based on the calibrated node representation, and further improve the success rate and accuracy of knowledge question and answering.

[0088] In one embodiment, Figure 5 As shown, the above step S21 includes steps S211 to S214, wherein:

[0089] Step S211, executing the preliminary calibration process multiple times to perform preliminary calibration on the predicted node representation of each node in the computation graph to obtain a preliminary calibrated node representation of each node.

[0090] Step S212, wherein the preliminary calibration process includes the following steps: obtaining a first preliminary calibration node representation of the current node in a previous preliminary calibration and a second preliminary calibration node representation of a predecessor node of the current node in a current preliminary calibration.

[0091] The current preliminary calibration may be expressed as the t+1th preliminary calibration, and the previous preliminary calibration may be expressed as the tth preliminary calibration.

[0092] Step S213: Based on the first preliminary calibration node representation and the second preliminary calibration node representation, obtain the first attention information of the current node in the current preliminary calibration.

[0093] Furthermore, the first attention information of the current node in the t+1th preliminary calibration can be expressed by the following formula (4):

[0094]

[0095] in, represents the first attention information of the current node j in the t+1th preliminary calibration, represents the predecessor node of the current node j, The second preliminary calibration node of the i-th predecessor node of the current node j in the t+1-th preliminary calibration is represented by, represents the first preliminary calibration node representation of the current node j in the tth preliminary calibration, and G represents the attention mechanism parameters.

[0096] Step S214, based on the first preliminary calibration node representation and the first attention information, obtain the third preliminary calibration node representation of the current node in the current preliminary calibration; repeat the above steps until every node in the computation graph is traversed.

[0097] Furthermore, the third preliminary calibration node representation of the current node in the t+1th preliminary calibration can be expressed by the following formula (5):

[0098]

[0099] in, represents the third preliminary calibration node of the current node j in the t+1th preliminary calibration, represents the first preliminary calibration node representation of the current node j in the tth preliminary calibration, represents the first attention information of the current node j in the t+1th preliminary calibration, and GRU represents the calibration parameters.

[0100] Specifically, Figure 6 As shown, Figure 6 The intermediate node j in is the current node, and the starting node i is the predecessor node of the intermediate node j, so as to further illustrate the above preliminary calibration process. The preliminary calibration process provided in this embodiment starts from the starting node i. Since the starting node i is determined based on the information in the logical query statement, the starting node i is the second preliminary calibration node in the t+1th preliminary calibration. The node representation is directly determined based on its preliminary calibration in the t+1th preliminary calibration.

[0101] Secondly, the second preliminary calibration node representation based on the starting node i in the t+1th preliminary calibration and the first preliminary calibration node of the intermediate node j in the tth preliminary calibration is represented by Get the first attention information The first attention information can also be expressed as Figure 6 m ij ). Then based on the first attention information and the first preliminary calibration node represents Get the third preliminary calibration node of intermediate node j in the t+1th preliminary calibration

[0102] In one embodiment, Figure 7 As shown, the above step S22 includes steps S221 to S224, wherein:

[0103] Step S221 , executing the target calibration process multiple times to perform target calibration on the preliminary calibration node representation of each node in the computation graph to obtain a target calibration node representation of each node.

[0104] The preliminary calibration node of each node represents the preliminary calibration node obtained by executing the preliminary calibration process for the last time.

[0105] Step S222, wherein the target calibration process includes the following steps: respectively obtaining the first target calibration node representation, the second target calibration node representation and the third target calibration node representation of the current node, the predecessor node and the successor node of the current node in the previous target calibration.

[0106] Step S223, based on the first target calibration node representation, the second target calibration node representation and the third target calibration node representation, obtain the second attention information of the current node in the previous target calibration, wherein the previous target calibration can be represented as the t-th target calibration.

[0107] Furthermore, the second attention information of the current node in the t-th target calibration can be expressed by the following formula (6):

[0108]

[0109] in, represents the second attention information of the current node j in the tth target calibration, represents the predecessor node of the current node j, S j Indicates the successor node of the current node j. i is the predecessor node In the case of represents the second target calibration node of the i-th predecessor node of the current node j in the t-th target calibration; i is the successor node S j In the case of Represents the third target calibration node representation of the i-th successor node of the current node j in the t-th target calibration. Represents the first target calibration node representation of the current node j in the tth target calibration.

[0110] Step S224, based on the first target calibration node representation and the second attention information, obtain the fourth target calibration node representation of the current node in the current target calibration; repeat the above steps until each node in the computation graph is traversed. The current target calibration can be represented as the t+1th target calibration.

[0111] Furthermore, the fourth target calibration node representation of the current node in the t+1th target calibration can be expressed by the following formula (7):

[0112]

[0113] in, represents the fourth target calibration node of the current node j in the t+1th target calibration, represents the first target calibration node representation of the current node j in the tth target calibration, Represents the second attention information of the current node j in the tth target calibration.

[0114] Specifically, Figure 8 As shown, Figure 8 The intermediate node j in is the current node, the starting node i is the predecessor node of the intermediate node j, and the ending node k is the successor node of the intermediate node j, so as to further illustrate the above target calibration process. First, based on the second target calibration node representation of the starting node i in the tth target calibration and the first target calibration node of the intermediate node j in the tth target calibration is represented by Get attention information m ij Secondly, the third target calibration node in the tth target calibration based on the termination node k is represented as and the first target calibration node of the intermediate node j in the tth target calibration is represented by Get attention information m kj Then, the attention information m ij and attention information m kj Superimpose to obtain the second attention information Finally, based on the second attention information and the first target calibration node represents Get the fourth target calibration node representation of the intermediate node j in the t+1th target calibration

[0115] In one embodiment, Fig. 9 As shown, the above step S3 includes steps S31 to S32, wherein:

[0116] Step S31, based on the preliminary calibration node representation of the termination node in the computation graph and the target calibration node representation, a final query representation of the logical query statement is obtained.

[0117] Specifically, the preliminary calibrated node representation of the termination node and the target calibrated node representation are weighted averaged to obtain the final query representation of the logical query statement.

[0118] Step S32, obtaining the similarity between the entity representation of each entity in the preset knowledge graph and the final query representation, and determining the entity with the highest similarity to the final query representation as the target entity.

[0119] In the above steps S31 to S32, a more accurate final query representation can be obtained by weightedly averaging the preliminary calibration node representation based on the termination node in the computation graph and the target calibration node representation to eliminate the influence of the error of a single calibration node representation on the accuracy of the final query representation. Based on the relatively accurate final query representation, the target entity corresponding to the logical query statement can be better detected from the knowledge graph, thereby further improving the success rate and accuracy of knowledge question answering.

[0120] In one embodiment, the above step S31 specifically includes the following steps:

[0121] Step S311 , obtaining multiple preliminary calibration node representations of the termination node in multiple preliminary calibrations and a weight corresponding to each preliminary calibration node representation.

[0122] Step S312, obtaining multiple target calibration node representations obtained by the termination node in multiple target calibrations and a weight corresponding to each target calibration node representation.

[0123] Furthermore, the weight corresponding to the calibration node representation obtained by the termination node in the t-th calibration can be calculated by the following formula (8), wherein the t-th calibration is the preliminary calibration or the target calibration, and the calibration node representation is the preliminary calibration node representation or the target calibration node representation:

[0124]

[0125] in, represents the calibration node representation obtained by the terminal node f in the tth calibration, w t Represents the calibration node representation The corresponding weight. w is the query vector used to calculate the calibration node representation importance.

[0126] Step S313, based on each preliminary calibration node representation and its corresponding weight, each target calibration node representation and its corresponding weight, a final query representation of the logical query statement is obtained.

[0127] Furthermore, each preliminary calibration node representation is multiplied by its corresponding weight to obtain a plurality of first product terms, each target calibration node representation is multiplied by its corresponding weight to obtain a plurality of second product terms, and the plurality of first product terms and the plurality of second product terms are added together to obtain a final query representation of the logical query statement, wherein the final query representation can be expressed by the following formula (9):

[0128]

[0129] Among them, q represents the final query representation of the logical query statement, represents the calibration node representation obtained by the terminal node f in the tth calibration, w t Represents the calibration node representation The corresponding weight. L represents the total calibration times, which is the sum of the initial calibration times and the target calibration times.

[0130] In one embodiment, for the disjunction operation of a logical query statement, the logical query statement may be converted into a disjunctive normal form (DNF) so that the logical query statement is converted into a disjunction of n sub-logical query statements.

[0131] Furthermore, the above step S32 specifically includes the following steps:

[0132] Step S321, based on the final query q representation, a sub-query representation of each sub-logical query statement corresponding to the logical query statement is obtained to obtain multiple sub-query representations.

[0133] Step S322, for each entity in the preset knowledge graph, obtain the first similarity between the entity representation of the entity and each sub-query representation, and obtain the minimum first similarity as the second similarity between the entity and the logical query statement.

[0134] Furthermore, the second similarity between each entity and the logical query statement can be calculated by the following formula (10):

[0135] dist(q,e)=min({sim(q 1 ,e),…,sim(q n ,e)}) (10)

[0136] Among them, {q 1 ,…,q n} represents n sub-query representations, which are obtained based on the final query and the disjunctive normal form. sim represents a similarity function, such as a cosine function.

[0137] Step S323, based on the maximum second similarity among the second similarities corresponding to each entity in the preset knowledge graph and the logical query statement, the entity corresponding to the maximum second similarity is determined as the target entity.

[0138] In one embodiment, a graph neural network model is constructed based on the knowledge question and answer method provided by the present invention, a logical query statement input by a user is obtained, the logical query statement is input into the graph neural network model, the target entity output by the graph neural network model is obtained, and the target entity is fed back to the user as an answer to the logical query statement.

[0139] Furthermore, the above graph neural network model is trained based on the loss function shown in the following formula (11) to adjust the node representation parameter h, the association relationship parameter r, the attention mechanism parameter G, the calibration parameter GRU and the weight parameter w in the graph neural network model, so that the logical query statement input by the user is as similar as possible to the correct answer and as dissimilar as possible to the wrong answer:

[0140]

[0141] Among them, e j represents a randomly sampled negative sample, i.e., a wrong answer. γ represents a spacing constant. σ represents an activation function, such as a sigmoid function. q represents a logical query statement, and k represents the number of negative samples.

[0142] A specific embodiment is provided below to further illustrate the knowledge question answering method provided by the present invention. The knowledge question answering method provided by this specific embodiment comprises the following steps:

[0143] (1) Generate a computational graph based on logical query statements and topological sorting processing rules. The computational graph includes node information of multiple nodes and the association relationship between adjacent nodes. The node information includes node depth. Multiple nodes in the computational graph are arranged in order of their node depths and are divided into starting nodes, intermediate nodes, and terminal nodes, such as Fig.10 As shown, the starting nodes include node a1 and node a2, and the ending node is node c. The association relationships include association relationship r1, association relationship r2, and association relationship r3.

[0144] (2) For each node in the computational graph, the association relationship between the node and its predecessor node and the predicted node representation of its predecessor node are input into a preset gated recurrent unit network to obtain the predicted node representation of the node.

[0145] (3) Execute the preliminary calibration process multiple times to perform preliminary calibration on the predicted node representation of each node in the computational graph in turn to obtain a preliminary calibrated node representation of each node; the preliminary calibrated node representation is obtained by calibrating the predicted node representation of the node based on the first calibrated node representation of the predecessor node corresponding to the node, and the first calibrated node representation is the node representation obtained after the preliminary calibration of the predecessor node.

[0146] (4) Execute the target calibration process multiple times to perform target calibration on the preliminary calibration node representation of each node in the computational graph to obtain a target calibration node representation of each node; the target calibration node representation is obtained by calibrating the preliminary calibration node representation of the node based on the second calibrated node representation of the predecessor node and the successor node corresponding to the node, and the second calibrated node representation includes the node representation obtained after preliminary calibration or target calibration of the predecessor node and the successor node.

[0147] Fig.10 An example is provided of a schematic diagram of a node representation calibration process, which can be used to represent a schematic diagram of executing a preliminary calibration process or executing a target calibration process, wherein each layer of the computational graph represents a computational graph for executing a preliminary calibration or executing a target calibration, and the calibration node representation in each layer of the computational graph includes a preliminary calibration node representation obtained by executing a preliminary calibration and a target calibration node representation obtained by executing a target calibration.

[0148] (5) Based on the preliminary calibration node representation obtained by executing the preliminary calibration process multiple times and the target calibration node representation obtained by executing the target calibration process multiple times, a calibration node representation of each node in the computational graph is obtained, and the calibration node representation includes multiple preliminary calibration node representations and multiple target calibration node representations.

[0149] (6) Obtain multiple preliminary calibration node representations of the termination node in multiple preliminary calibrations and the weight corresponding to each preliminary calibration node representation. Obtain multiple target calibration node representations of the termination node obtained in multiple target calibrations and the weight corresponding to each target calibration node representation. Based on each preliminary calibration node representation and its corresponding weight, each target calibration node representation and its corresponding weight, obtain the final query representation of the logical query statement.

[0150] (7) Obtain the similarity between the entity representation of each entity in the preset knowledge graph and the final query representation, determine the entity with the highest similarity to the final query representation as the target entity, and output the target entity as the answer to the logical query statement.

[0151] Below, this specific embodiment is further explained by taking the user input logical query statement "Nationality(V,China)∧BornIn(V,Shanghai)∧PlaysForNBATeam(V,T)" as an example. The logical query statement means: querying "a Chinese born in Shanghai played for the NBA team" from the sports knowledge graph, it can be determined that the starting node is V, node a1 is China, node a2 is Shanghai, and the end node is T. The association r1 is Nationality, the association r2 is BornIn, and the association r3 is PlaysForNBATeam, so that the calculation graph of the logical query statement can be obtained, and the preliminary calibration node representation and target calibration node representation of each node in the calculation graph are obtained. Finally, the final query representation of the logical query statement is calculated based on the preliminary calibration node representation and the target calibration node representation of the end node T. The sports knowledge graph includes the first entity Houston Rockets, the second entity Los Angeles Lakers, and the third entity Chicago Bulls. The similarity between the final query representation of the logical query statement and the entity representations of the above three entities is obtained, wherein the similarity corresponding to the first entity Houston Rockets is 0.95, the similarity corresponding to the second entity Los Angeles Lakers is 0.3, and the similarity corresponding to the third entity Chicago Bulls is 0.1. Therefore, the target entity corresponding to the logical query statement is the first entity Houston Rockets, and "Houston Rockets" is output as the answer to the logical query statement. The knowledge question and answer device provided by the present invention is described below, and the knowledge question and answer device described below and the knowledge question and answer method described above can be referred to each other.

[0152] like Fig.11 As shown, the present invention provides a knowledge question answering device 100, which includes:

[0153] The prediction module 10 is used to construct a calculation graph based on the acquired logical query statement and obtain the predicted node representation of each node in the calculation graph; the calculation graph includes node information of multiple nodes and the association relationship between adjacent nodes, and the node information includes node depth.

[0154] The calibration module 20 is used to calibrate the predicted node representation of each node in the computation graph based on the node representations of the predecessor node and the successor node of the node to obtain the calibrated node representation of the node.

[0155] The answering module 30 is used to determine the target entity based on the calibrated node representation of the nodes in the computation graph and the entity representation of each entity in the preset knowledge graph, and output the target entity as the answer to the logical query statement.

[0156] In one embodiment, the prediction module 10 includes a computation graph generation unit and a node representation prediction unit, wherein:

[0157] The computation graph generation unit is used to generate a computation graph based on a logical query statement and a topological sorting processing rule. Multiple nodes in the computation graph are arranged in order of their node depths and are divided into a starting node, an intermediate node, and an ending node.

[0158] The node representation prediction unit is used to input the association relationship between the node and its predecessor node and the predicted node representation of its predecessor node into a preset gated recurrent unit network for each node in the computation graph to obtain the predicted node representation of the node.

[0159] In one embodiment, the calibration module 20 includes a preliminary node calibration unit, a target node calibration unit and a node representation acquisition unit, wherein:

[0160] A preliminary node calibration unit is used to execute a preliminary calibration process to perform preliminary calibration on the predicted node representation of each node in the computational graph in turn to obtain a preliminary calibrated node representation of each node; the preliminary calibrated node representation is obtained by calibrating the predicted node representation of the node based on the first calibrated node representation of the predecessor node corresponding to the node, and the first calibrated node representation is the node representation obtained after preliminary calibration of the predecessor node.

[0161] A target node calibration unit is used to execute a target calibration process to perform target calibration on the preliminary calibration node representation of each node in the computational graph to obtain a target calibration node representation of each node; the target calibration node representation is obtained by calibrating the preliminary calibration node representation of the node based on the second calibrated node representation of the predecessor node and the successor node corresponding to the node, and the second calibrated node representation includes the node representation obtained after preliminary calibration or target calibration of the predecessor node and the successor node.

[0162] The node representation acquisition unit is used to obtain the calibration node representation of each node in the calculation graph based on the preliminary calibration node representation obtained by executing the preliminary calibration process and the target calibration node representation obtained by executing the target calibration process. The calibration node representation includes the preliminary calibration node representation and the target calibration node representation.

[0163] In one embodiment, the preliminary node calibration unit is also used to execute the preliminary calibration process multiple times to perform preliminary calibration on the predicted node representation of each node in the computation graph to obtain a preliminary calibrated node representation of each node; wherein the preliminary calibration process includes the following steps: obtaining the first preliminary calibration node representation of the current node in the previous preliminary calibration and the second preliminary calibration node representation of the predecessor node of the current node in the current preliminary calibration; based on the first preliminary calibration node representation and the second preliminary calibration node representation, obtaining the first attention information of the current node in the current preliminary calibration; based on the first preliminary calibration node representation and the first attention information, obtaining the third preliminary calibration node representation of the current node in the current preliminary calibration; repeating the above steps until every node in the computation graph is traversed.

[0164] In one embodiment, the target node calibration unit is also used to execute the target calibration process multiple times to perform target calibration on the preliminary calibration node representation of each node in the computation graph to obtain the target calibration node representation of each node; wherein the target calibration process includes the following steps: respectively obtaining the first target calibration node representation, the second target calibration node representation and the third target calibration node representation of the current node, the predecessor node and the successor node of the current node in the previous target calibration; based on the first target calibration node representation, the second target calibration node representation and the third target calibration node representation, obtaining the second attention information of the current node in the previous target calibration; based on the first target calibration node representation and the second attention information, obtaining the fourth target calibration node representation of the current node in the current target calibration; repeating the above steps until every node in the computation graph is traversed.

[0165] In one embodiment, the answering module 30 includes a query representation acquisition unit and a target entity determination unit, wherein:

[0166] The query representation acquisition unit is used to acquire a final query representation of the logical query statement based on a preliminary calibrated node representation of a terminal node in the computation graph and a target calibrated node representation.

[0167] The target entity determination unit is used to obtain the similarity between the entity representation of each entity in the preset knowledge graph and the final query representation, and determine the entity with the highest similarity to the final query representation as the target entity.

[0168] Fig.12 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.12As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the knowledge question answering method, which includes: constructing a calculation graph based on the acquired logical query statement, and obtaining the predicted node representation of each node in the calculation graph; the calculation graph includes node information of multiple nodes and the association relationship between adjacent nodes, and the node information includes node depth; for each node in the calculation graph, calibrating the predicted node representation of the node based on the node representation of the predecessor node and the successor node of the node to obtain the calibrated node representation of the node; determining the target entity based on the calibrated node representation of the node in the calculation graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as the answer to the logical query statement.

[0169] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[0170] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the knowledge question and answer method provided by the above methods, which includes: constructing a calculation graph based on the acquired logical query statement, and obtaining the predicted node representation of each node in the calculation graph; the calculation graph includes node information of multiple nodes and the association relationship between adjacent nodes, and the node information includes node depth; for each node in the calculation graph, the predicted node representation of the node is calibrated based on the node representation of the predecessor node and the successor node of the node to obtain the calibrated node representation of the node; the target entity is determined based on the calibrated node representation of the node in the calculation graph and the entity representation of each entity in the preset knowledge graph, and the target entity is output as the answer to the logical query statement.

[0171] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the knowledge question and answer method provided by the above-mentioned methods, the method comprising: constructing a calculation graph based on the acquired logical query statement, and obtaining a predicted node representation of each node in the calculation graph; the calculation graph comprises node information of multiple nodes and the association relationship between adjacent nodes, and the node information comprises node depth; for each node in the calculation graph, calibrating the predicted node representation of the node based on the node representation of the predecessor node and the successor node of the node to obtain a calibrated node representation of the node; determining a target entity based on the calibrated node representation of the node in the calculation graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as the answer to the logical query statement.

[0172] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0173] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A knowledge question answering method, characterized in that: include: Building a computation graph based on the acquired logical query statement, and obtaining a predicted node representation of each node in the computation graph; The computation graph includes node information of multiple nodes and association relationships between adjacent nodes, and the node information includes node depth; For each node in the computation graph, calibrate the predicted node representation of the node based on the node representations of the predecessor node and the successor node of the node to obtain a calibrated node representation of the node; Determine a target entity based on the calibrated node representation of the node in the computation graph and the entity representation of each entity in the preset knowledge graph, and output the target entity as an answer to the logical query statement; The step of calibrating the predicted node representation of each node in the computation graph based on the node representations of the predecessor node and the successor node of the node to obtain the calibrated node representation of the node includes: Executing a preliminary calibration process to perform preliminary calibration on the predicted node representation of each node in the computation graph in turn to obtain a preliminary calibrated node representation of each node; the preliminary calibrated node representation is obtained by calibrating the predicted node representation of the node based on a first calibrated node representation of a predecessor node corresponding to the node, the first calibrated node representation being a node representation obtained after preliminary calibration of the predecessor node; Executing a target calibration process to perform target calibration on the preliminary calibrated node representation of each node in the computation graph to obtain a target calibrated node representation of each node; the target calibrated node representation is obtained by calibrating the preliminary calibrated node representation of the node based on a second calibrated node representation of a predecessor node and a successor node corresponding to the node, the second calibrated node representation including a node representation obtained after preliminary calibration or target calibration of the predecessor node and the successor node; Based on the preliminary calibration node representation obtained by executing the preliminary calibration process and the target calibration node representation obtained by executing the target calibration process, obtaining a calibration node representation of each node in the computation graph, wherein the calibration node representation includes the preliminary calibration node representation and the target calibration node representation; The preliminary calibration process includes the following steps: obtaining a first preliminary calibration node representation of a current node in a previous preliminary calibration and a second preliminary calibration node representation of a predecessor node of the current node in a current preliminary calibration; Based on the first preliminary calibration node representation and the second preliminary calibration node representation, obtaining first attention information of the current node in a current preliminary calibration; Based on the first preliminary calibration node representation and the first attention information, obtaining a third preliminary calibration node representation of the current node in the current preliminary calibration; repeating the above steps until each node in the computation graph is traversed; The target calibration process includes the following steps: respectively obtaining a first target calibration node representation, a second target calibration node representation, and a third target calibration node representation of a current node, a predecessor node, and a successor node of the current node in a previous target calibration; Based on the first target calibration node representation, the second target calibration node representation, and the third target calibration node representation, obtaining second attention information of the current node in a previous target calibration; Based on the first target calibration node representation and the second attention information, obtain the fourth target calibration node representation of the current node in the current target calibration; repeat the above steps until every node in the computational graph is traversed.

2. The knowledge question answering method according to claim 1, characterized in that: The step of constructing a computation graph based on the acquired logical query statement and obtaining a predicted node representation of each node in the computation graph includes: The computation graph is generated based on the logical query statement and the topological sorting processing rule, wherein the multiple nodes in the computation graph are arranged in order of their node depths and are divided into a starting node, an intermediate node, and an ending node; For each node in the computational graph, the association relationship between the node and its predecessor node and the predicted node representation of its predecessor node are input into a preset gated recurrent unit network to obtain the predicted node representation of the node.

3. The knowledge question answering method according to claim 1, characterized in that: The performing of the preliminary calibration process to sequentially perform preliminary calibration on the predicted node representation of each node in the computation graph to obtain a preliminary calibrated node representation of each node includes: The preliminary calibration process is performed multiple times to preliminarily calibrate the predicted node representation of each node in the computation graph to obtain a preliminary calibrated node representation of each node.

4. The knowledge question answering method according to claim 1, characterized in that: The target calibration process is executed to perform target calibration on the preliminary calibration node representation of each node in the computation graph to obtain the target calibration node representation of each node, including: The target calibration process is executed multiple times to perform target calibration on the preliminary calibration node representation of each node in the computation graph to obtain a target calibration node representation of each node.

5. The knowledge question answering method according to any one of claims 3 to 4, characterized in that: The determining the target entity based on the calibration node representation of the node in the computation graph and the entity representation of each entity in the preset knowledge graph includes: Obtaining a final query representation of the logical query statement based on a preliminary calibrated node representation of a termination node in the computation graph and a target calibrated node representation; The similarity between the entity representation of each entity in the preset knowledge graph and the final query representation is obtained, and the entity with the highest similarity to the final query representation is determined as the target entity.

6. A knowledge base question-answering device, characterized in that: include: A prediction module, used to construct a computation graph based on the acquired logical query statement, and obtain a prediction node representation of each node in the computation graph; The computation graph includes node information of multiple nodes and association relationships between adjacent nodes, and the node information includes node depth; A calibration module, configured to calibrate, for each node in the computation graph, a predicted node representation of the node based on node representations of a predecessor node and a successor node of the node, to obtain a calibrated node representation of the node; An answering module, used to determine a target entity based on a calibrated node representation of a node in the computational graph and an entity representation of each entity in a preset knowledge graph, and output the target entity as an answer to the logical query statement; The calibration module includes a preliminary node calibration unit, a target node calibration unit and a node representation acquisition unit, wherein: A preliminary node calibration unit is used to execute a preliminary calibration process to perform preliminary calibration on the predicted node representation of each node in the computation graph in turn to obtain a preliminary calibrated node representation of each node; the preliminary calibrated node representation is obtained by calibrating the predicted node representation of the node based on a first calibrated node representation of a predecessor node corresponding to the node, and the first calibrated node representation is a node representation obtained after preliminary calibration of the predecessor node; A target node calibration unit is used to execute a target calibration process to perform target calibration on the preliminary calibration node representation of each node in the computation graph to obtain a target calibration node representation of each node; the target calibration node representation is obtained by calibrating the preliminary calibration node representation of the node based on the second calibrated node representation of the predecessor node and the successor node corresponding to the node, and the second calibrated node representation includes the node representation obtained after preliminary calibration or target calibration of the predecessor node and the successor node; A node representation acquisition unit, configured to acquire a calibration node representation of each node in the computation graph based on a preliminary calibration node representation obtained by executing the preliminary calibration process and a target calibration node representation obtained by executing the target calibration process, wherein the calibration node representation includes a preliminary calibration node representation and a target calibration node representation; The preliminary calibration process includes the following steps: obtaining a first preliminary calibration node representation of a current node in a previous preliminary calibration and a second preliminary calibration node representation of a predecessor node of the current node in a current preliminary calibration; Based on the first preliminary calibration node representation and the second preliminary calibration node representation, obtaining first attention information of the current node in a current preliminary calibration; Based on the first preliminary calibration node representation and the first attention information, obtaining a third preliminary calibration node representation of the current node in the current preliminary calibration; repeating the above steps until each node in the computation graph is traversed; The target calibration process includes the following steps: respectively obtaining a first target calibration node representation, a second target calibration node representation, and a third target calibration node representation of a current node, a predecessor node, and a successor node of the current node in a previous target calibration; Based on the first target calibration node representation, the second target calibration node representation, and the third target calibration node representation, obtaining second attention information of the current node in a previous target calibration; Based on the first target calibration node representation and the second attention information, obtain the fourth target calibration node representation of the current node in the current target calibration; repeat the above steps until every node in the computational graph is traversed.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the knowledge question and answer method as described in any one of claims 1 to 5 is implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the knowledge question and answer method as described in any one of claims 1 to 5 is implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the knowledge question and answer method as described in any one of claims 1 to 5 is implemented.