CN115618011A - Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium - Google Patents

Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115618011A
CN115618011A CN202211193891.8A CN202211193891A CN115618011A CN 115618011 A CN115618011 A CN 115618011A CN 202211193891 A CN202211193891 A CN 202211193891A CN 115618011 A CN115618011 A CN 115618011A
Authority
CN
China
Prior art keywords
node
representation
calibration
target
preliminary
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211193891.8A
Other languages
Chinese (zh)
Inventor
何世柱
刘康
赵军
徐遥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Automation of Chinese Academy of Science
Original Assignee
Institute of Automation of Chinese Academy of Science
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Automation of Chinese Academy of Science filed Critical Institute of Automation of Chinese Academy of Science
Priority to CN202211193891.8A priority Critical patent/CN115618011A/en
Publication of CN115618011A publication Critical patent/CN115618011A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation
    • G06N5/027Frames

Abstract

The invention provides a knowledge question-answering method, a knowledge question-answering device, electronic equipment and a readable storage medium, which relate to the technical field of computers, and the method comprises the following steps: constructing a computational graph based on the obtained logic query statement, and obtaining a prediction node representation of each node in the computational graph; the calculation graph comprises node information of a plurality of nodes and incidence relation between adjacent nodes, and the node information comprises node depth; aiming at each node in the calculation 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 a calibrated node representation of the node; the target entity is determined based on the calibration 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 of the logic query statement, so that the technical problem of how to better detect the answer of the logic query statement from the knowledge graph in the prior art is solved.

Description

Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a knowledge question answering method, a knowledge question answering device, electronic equipment and a readable storage medium.
Background
Knowledge base logic question answering is basic research content, and compared with general question answering, the task needs to process first-order predicate logic such as quantifier existence
Figure BDA0003870061050000011
Combination (^) and extraction ([ V ]) and non-operation
Figure BDA0003870061050000012
The knowledge base logical question-answering can be used for answering accurate search of users in a search engine, recommending drugs in a medical knowledge map and analyzing fault causes in a fault diagnosis knowledge base. The logical question-answering of a knowledge base in a large-scale and incomplete knowledge base is a crucial basic task.
In the prior art, answers of logical query statements are generally obtained by adopting a subgraph matching algorithm, however, the time complexity of the algorithm is high and is in an exponential level, and in addition, when an incomplete knowledge graph is detected by adopting the algorithm, a plurality of answers cannot be searched out due to the loss of a large number of edges in the knowledge graph.
Therefore, how to better detect the answer of the logical query statement from the knowledge graph is a technical problem to be solved urgently by those skilled in the relevant field.
Disclosure of Invention
The invention provides a knowledge question-answering method, a knowledge question-answering device, electronic equipment and a readable storage medium, which are used for solving the technical problem of how to better detect answers of logic query sentences from a knowledge graph in the prior art and realizing better knowledge question-answering.
The invention provides a knowledge question-answering method, which comprises the following steps:
constructing a computational graph based on the obtained logic query statement, and obtaining a prediction node representation of each node in the computational graph; the computational graph comprises node information of a plurality of nodes and incidence relation between adjacent nodes, wherein the node information comprises node depth;
for each node in the computational graph, calibrating the predicted node representation of the node based on the node representations of the predecessor node and successor node of the node to obtain a calibrated node representation of the node;
and determining a target entity based on the calibration node representation of the node in the computational graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as an answer of the logic query statement.
According to the knowledge question-answering method provided by the invention, the method for constructing the computational graph based on the obtained logic query statement and obtaining the predicted node representation of each node in the computational graph comprises the following steps:
generating the computational graph based on the logic query statement and a topological sorting processing rule, wherein a plurality of nodes in the computational graph are arranged according to the node depth sequence and are divided into a starting node, an intermediate node and a terminating node;
and inputting the incidence relation between the node and the precursor node thereof and the predicted node representation of the precursor node thereof into a preset gate control cycle unit network aiming at each node in the calculation graph to obtain the predicted node representation of the node.
According to a knowledge question-answering method provided by the present invention, for each node in the computational graph, calibrating 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, includes:
executing a preliminary calibration process to perform preliminary calibration on the predicted node representation of each node in the calculation graph in sequence to obtain a preliminary calibration node representation of each node; the preliminary calibration node represents a first calibrated node representation of a precursor node corresponding to the node, and the first calibrated node representation is obtained by calibrating a predicted node representation of the node and is a node representation obtained by preliminarily calibrating the precursor node;
executing a target calibration flow to perform target calibration on the preliminary calibration node representation of each node in the calculation graph to obtain a target calibration node representation of each node; the target calibration node represents that the preliminary calibration node representation of the node is calibrated based on the second calibrated node representation of the precursor node and the subsequent node corresponding to the node, and the second calibrated node representation comprises the node representation obtained after the preliminary calibration or the target calibration is carried out on the precursor node and the subsequent node;
and acquiring a calibration node representation of each node in the computational graph based on a preliminary calibration node representation obtained by executing a preliminary calibration process and a target calibration node representation obtained by executing a target calibration process, wherein the calibration node representation comprises the preliminary calibration node representation and the target calibration node representation.
According to the method for question answering, the preliminary calibration process is executed to carry out preliminary calibration on the predicted node representation of each node in the computational graph in sequence to obtain the preliminary calibration node representation of each node, and the method comprises the following steps:
executing a preliminary calibration process for multiple times to preliminarily calibrate the predicted node representation of each node in the calculation graph to obtain a preliminary calibration node representation of each node;
wherein, the preliminary calibration process comprises the following steps: acquiring a first preliminary calibration node representation of a current node in previous preliminary calibration and a second preliminary calibration node representation of a precursor node of the current node in current preliminary calibration;
acquiring first attention information of the current node in the current primary calibration based on the first primary calibration node representation and the second primary calibration node representation;
acquiring a third preliminary calibration node representation of the current node in the current preliminary calibration based on the first preliminary calibration node representation and the first attention information; and repeatedly executing the steps until each node in the computational graph is traversed.
According to the question-answering method provided by the invention, the executing of the target calibration process to perform target calibration on the preliminary calibration node representation of each node in the computational graph to obtain the target calibration node representation of each node comprises the following steps:
executing the target calibration process for 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;
wherein, the target calibration process comprises the following steps: respectively acquiring a current node, a first target calibration node representation, a second target calibration node representation and a third target calibration node representation of a predecessor node and a successor node of the current node in previous target calibration;
acquiring second attention information of the current node in previous target calibration based on the first target calibration node representation, the second target calibration node representation and the third target calibration node representation;
acquiring a fourth target calibration node representation of the current node in the current target calibration based on the first target calibration node representation and the second attention information; and repeatedly executing the steps until each node in the computational graph is traversed.
According to the method for question answering, the target entity is determined based on the calibration node representation of the nodes in the computational graph and the entity representation of each entity in the preset knowledge graph, and the method comprises the following steps:
obtaining a final query representation of the logical query statement based on a preliminary calibration node representation of a termination node and a target calibration node representation in the computational graph;
and acquiring 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.
The invention also provides a knowledge question answering device, comprising:
the prediction module is used for constructing a computational graph based on the obtained logic query statement and obtaining the prediction node representation of each node in the computational graph; the computational graph comprises node information of a plurality of nodes and incidence relation between adjacent nodes, wherein the node information comprises node depth;
a calibration module, configured to calibrate, for each node in the computational 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;
and the answering module is used for determining a target entity based on the calibration node representation of the node in the computational graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as an answer of the logic query statement.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and operable on the processor, wherein the processor implements the question-answering method as described in any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of question and answer, as described in any of the above.
The present invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the method of knowledge question answering as defined in any one of the above.
According to the knowledge question-answering method, the knowledge question-answering device, the electronic equipment and the readable storage medium, the computational graph is constructed based on the logic query sentences, and the prediction node representation of each node in the computational graph is obtained, so that the prediction node representation of each node can be calibrated based on the node representations of the nodes in the computational graph, the accuracy and the information richness of the node representation of each node in the computational graph are improved, the answers of the logic query sentences can be better detected from the knowledge graph spectrum based on the calibrated node representations, the success rate and the accuracy of the knowledge question-answering are improved, and the technical problem that how to better detect the answers of the logic query sentences from the knowledge graph spectrum in the prior art is solved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a knowledge question answering method according to an embodiment of the present invention;
FIG. 2 is a second schematic flow chart of a knowledge question answering method according to an embodiment of the present invention;
FIG. 3 is a schematic of the topology of a computation graph in an embodiment of the invention;
FIG. 4 is a third schematic flow chart of a knowledge question answering method according to an embodiment of the present invention;
FIG. 5 is a fourth flowchart illustrating a knowledge question answering method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a preliminary calibration process according to an embodiment of the present invention;
FIG. 7 is a fifth flowchart illustrating a knowledge question answering method according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a target calibration flow in an embodiment of the present invention;
FIG. 9 is a sixth schematic flow chart of a knowledge question answering method according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of a node representative calibration flow in an embodiment of the present invention;
FIG. 11 is a schematic structural diagram of a knowledge question answering apparatus according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The knowledge question answering method of the present invention is described below with reference to fig. 1-6. As shown in fig. 1, the present invention provides a knowledge question answering method, comprising:
s1, constructing a computational graph based on the obtained logic query statement, and obtaining a prediction node representation of each node in the computational graph; the calculation graph comprises node information of a plurality of nodes and incidence relations between adjacent nodes, and the node information comprises node depth.
Where a logical query statement may be represented as q i . The node information also includes a node name. The node depth is used for distinguishing the arrangement sequence of a plurality of nodes, and the higher the node depth of the node is, the later the arrangement sequence of the node in the calculation graph is. The node information of part of the nodes in the calculation graph further comprises specific entities corresponding to the nodes.
And S2, aiming at each node in the calculation 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.
Wherein the predecessor node represents a node preceding the node and the successor node represents a node succeeding the node.
And S3, determining a target entity based on the calibration node representation of the nodes in the computational graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as an answer of the logic query statement.
Specifically, the calibration 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 logic query statement is determined and output based on the comparison result.
In the steps S1 to S3, the calculation graph is constructed based on the logic query statement and the predicted node representation of each node in the calculation graph is obtained, so that the predicted node representation of the node can be calibrated based on the node representations of the predecessor node and successor node of the node in the calculation graph, the accuracy and the information richness of the node representation of each node in the calculation graph are improved, the answer of the logic query statement can be better detected from the knowledge graph spectrum based on the calibrated node representation, the success rate and the accuracy of the knowledge query statement are improved, and the technical problem of how to better detect the answer of the logic query statement from the knowledge graph spectrum in the prior art is solved.
In one embodiment, as shown in fig. 2, the step S1 includes steps S11 to S12, wherein:
and S11, generating a calculation graph based on the logic query statement and the topological sorting processing rule, wherein a plurality of nodes in the calculation graph are arranged according to the node depth sequence and are divided into a starting node, an intermediate node and a terminating node.
Specifically, a computation graph in the form of a directed acyclic graph is generated based on the logic query statement and the topological sorting processing rule, and the computation graph is used for representing the computation sequence of a plurality of nodes and the incidence relation among the plurality of nodes. The originating node may also be referred to as an anchor node and the terminating node may also be referred to as a target node.
Fig. 3 illustrates a topology of the computational graph according to the present invention, where the start node includes a node a1 and a node a2, the intermediate node includes a node b1, a node b2, and a node b3, and the end node is a node c. The association relationship includes an association relationship r1, an association relationship r2, and an association relationship r3. The node depth of the termination node is the highest, the node depth of the intermediate node is the second, and the node depth of the start node is the lowest. The node a1, the node a2, the association r1, the association r2, and the association r3 are determined based on information in the logical query statement and are known. While the node b1, the node b2, the node b3 and the association relationship therebetween are unknown, and the node c is a target node of the logical query statement and is also unknown.
And S12, inputting the incidence relation between the nodes and the precursor nodes thereof and the predicted node representation of the precursor nodes thereof into a preset gate control cycle unit network aiming at each node in the calculation graph to obtain the predicted node representation of the node.
Specifically, the predicted node representation of the node may be calculated by the following equation (1):
h′=GRU(h,r) (1)
wherein h' represents a predicted node representation of a node, GRU represents a gated-loop unit network, h represents a predicted node representation of a predecessor node of a node, and r represents an association relationship between a node and its predecessor node.
In the steps S11 to S12, the computation graph is generated based on the logic query statement and the topology ranking processing rule, so that the nodes in the computation graph are arranged according to the node depth order, and the prediction of the node representation is sequentially performed based on the arrangement order of the nodes, thereby obtaining the predicted node representation of each node.
In one embodiment, step S12 further comprises: for a node having at least two predecessor nodes, an importance level of each of the predecessor nodes of the node is obtained based on a multi-layer perceptron (MLP), and a predicted node representation of the node is obtained based on a predicted node representation of each of the predecessor nodes of the node and the importance levels.
Specifically, the importance degree of each precursor node of the node is obtained based on a multilayer perceptron, and the weight corresponding to each precursor node is obtained based on the importance degrees of a plurality of precursor nodes, wherein the weight corresponding to each precursor node can be calculated by the following formula (2):
Figure BDA0003870061050000091
wherein alpha is i Denotes the weight of the predecessor node i, MLP (p) i ) Representing the importance of the predecessor node i, MLP representing the multi-level perceptron, Σ j exp(MLP(p j ) Represents a plurality of frontThe sum of the importance of the drive nodes.
Calculating a predicted node representation for the node based on the predicted node representation for each predecessor node of the node and the weights, wherein the predicted node representation for the node may be calculated from equation (3) below:
p inter =∑ i α i ·p i (3)
wherein p is inter A predicted node representation, p, representing the node i A predicted node representation, α, of a predecessor node i representing the node i Representing the weight of the node's predecessor i.
In one embodiment, the above formulas (2) to (3) can also be used to implement a conjunction operation of multiple sub-logical query statements, so as to obtain a conjunction logical query statement, then α i Weight, p, representing sub-logical query statement i t Query representation, p, representing a sub-logical query statement i inter A query representation representing a conjunction logical query statement.
In one embodiment, as shown in fig. 4, the step S2 includes steps S21 to S23, wherein:
step S21, executing a preliminary calibration process to carry out preliminary calibration on the predicted node representation of each node in the calculation graph in sequence to obtain a preliminary calibration node representation of each node; the preliminary calibration node represents that the predicted node representation of the node is calibrated based on a first calibrated node representation of the precursor node corresponding to the node, and the first calibrated node representation is a node representation obtained after preliminary calibration is performed on the precursor node.
In one embodiment, the first calibrated node representation refers to a preliminary calibration node representation of a predecessor node, in the case where the total number of executions of the preliminary calibration flow is one. Specifically, the predicted node representation corresponding to the first node is taken as its preliminary calibration node representation. And performing preliminary calibration on the predicted node representation of the second node based on the preliminary calibration node representation of the first node to obtain a preliminary calibration node representation of the second node, and so on until obtaining a preliminary calibration node representation of the last node.
In one embodiment, in the case that the total number of times of performing 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, so as to obtain a preliminary calibration node representation of the current node in the first preliminary calibration. The first calibrated node representation refers to a preliminary calibrated node representation obtained by the predecessor node in the first preliminary calibration.
In the preliminary calibration after the first time, based on the first calibrated node representation of the predecessor node, the preliminary calibration node representation obtained by the current node 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 a preliminary calibrated node representation obtained by the predecessor node in the current preliminary calibration.
Step S22, executing a target calibration process to perform target calibration on the preliminary calibration node representation of each node in the calculation graph to obtain a target calibration node representation of each node; the target calibration node represents that the preliminary calibration node representation of the node is calibrated based on the second calibrated node representation of the precursor node and the subsequent node corresponding to the node, and the second calibrated node representation comprises the node representation obtained after the preliminary calibration or the target calibration is carried out on the precursor node and the subsequent node.
In one embodiment, in a case that the total execution times of the target calibration procedure is one time, the second calibrated node representation refers to a preliminary calibration node representation finally obtained by a predecessor node or a successor node. Specifically, the preliminary calibration node representation corresponding to the first node is taken as its target calibration node representation. And the preliminary calibration node representation based on the first node and the third node is used for further calibrating the preliminary calibration node representation of the second node to obtain the target calibration node representation of the second node, and the like until the target calibration node representation of the last node is obtained.
In one embodiment, when the total execution times of the target calibration process is multiple times, in the first target calibration, the second calibrated node representation refers to a preliminary calibration node representation finally obtained by a predecessor node or a 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 a target calibration node representation of the current node in the first target calibration.
In the target calibration after the first time, the second calibrated node representation refers to a target calibration node representation obtained in the previous target calibration by the predecessor node or the successor node. And further calibrating the target calibration node representation obtained by the current node in the previous target calibration based on the second calibrated node representations of the predecessor node and the successor node to obtain the target calibration node representation of the current node in the current target calibration.
Step S23, acquiring a calibration node representation of each node in the computational 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, where the calibration node representation includes the preliminary calibration node representation and the target calibration node representation.
In the steps S21 to S23, the predicted node representation of each node in the computational graph is calibrated based on the preliminary calibration process to obtain a relatively accurate preliminary calibration node representation, and the preliminary calibration node representation of each node in the computational graph is further calibrated based on the target calibration process, so that the accuracy of the node representation of each node in the computational graph can be further improved, and thus, the answer of the logic query statement can be better detected from the knowledge graph spectrum based on the calibrated node representation, and the success rate and the accuracy of the knowledge query are further improved.
In one embodiment, as shown in fig. 5, the step S21 includes steps S211 to S214, wherein:
step S211, performing the preliminary calibration process multiple times to perform preliminary calibration on the predicted node representation of each node in the computational graph, so as to obtain a preliminary calibration node representation of each node.
Step S212, wherein the preliminary calibration process includes the following steps: and acquiring a first preliminary calibration node representation of the current node in the previous preliminary calibration and a second preliminary calibration node representation of a precursor node of the current node in the current preliminary calibration.
The current preliminary calibration may be denoted as the t +1 th preliminary calibration, and the previous preliminary calibration may be denoted as the t-th preliminary calibration.
Step S213, obtaining first attention information of the current node in the current preliminary calibration based on the first preliminary calibration node representation and the second preliminary calibration node representation.
Further, the first attention information of the current node in the t +1 th preliminary calibration may be represented by the following formula (4):
Figure BDA0003870061050000121
wherein the content of the first and second substances,
Figure BDA0003870061050000122
indicating the first attention information of the current node j in the t +1 th preliminary calibration,
Figure BDA0003870061050000123
a predecessor node representing the current node j,
Figure BDA0003870061050000124
the ith predecessor node representing current node j represents the second preliminary calibration node in the t +1 th preliminary calibration,
Figure BDA0003870061050000125
the first preliminary calibration node representation of the current node j in the tth preliminary calibration is shown, and G represents the attention mechanism parameter.
Step S214, acquiring a third preliminary calibration node representation of the current node in the current preliminary calibration based on the first preliminary calibration node representation and the first attention information; and repeatedly executing the steps until each node in the computational graph is traversed.
Further, a third preliminary calibration node representation of the current node in the t +1 th preliminary calibration may be represented by the following formula (5):
Figure BDA0003870061050000126
wherein the content of the first and second substances,
Figure BDA0003870061050000127
represents the third preliminary calibration node of the current node j in the t +1 th preliminary calibration,
Figure BDA0003870061050000128
representing the first preliminary calibration node representation of the current node j in the t-th preliminary calibration,
Figure BDA0003870061050000129
the first attention information of the current node j in the t +1 th preliminary calibration is represented, and the GRU represents the calibration parameter.
Specifically, as shown in fig. 6, the intermediate node j in fig. 6 is taken as the current node, and the start node i is taken as the predecessor node of the intermediate node j, so as to further explain the preliminary calibration process. The preliminary calibration process provided by this embodiment starts from the start node i, and since the start node i is determined based on the information in the logical query statement, the second preliminary calibration node of the start node i in the t +1 th preliminary calibration represents
Figure BDA0003870061050000131
The preliminary calibration node representation in the t +1 th preliminary calibration is directly determined based on it.
Second, a second preliminary calibration node representation in the t +1 st preliminary calibration based on the start node i
Figure BDA0003870061050000132
And a first preliminary calibration node table of the intermediate node j in the t-th preliminary calibrationShowing device
Figure BDA0003870061050000133
Obtaining first attention information
Figure BDA0003870061050000134
The first attention information may also be represented as m in fig. 6 ij ). And then based on the first attention information
Figure BDA0003870061050000135
And a first preliminary calibration node representation
Figure BDA0003870061050000136
Obtaining a third preliminary calibration node of the intermediate node j in the t +1 th preliminary calibration
Figure BDA0003870061050000137
In one embodiment, as shown in fig. 7, the step S22 includes steps S221 to S224, wherein:
step S221, a target calibration process is executed multiple times to perform target calibration on the preliminary calibration node representation of each node in the computational graph, so as to obtain a target calibration node representation of each node.
And the preliminary calibration node of each node represents a preliminary calibration node obtained by executing a preliminary calibration process for the last time.
Step S222, wherein the target calibration process includes the following steps: respectively acquiring a current node, a precursor node of the current node and a successor node of the current node, and a first target calibration node representation, a second target calibration node representation and a third target calibration node representation in the previous target calibration.
Step S223, based on the first target calibration node representation, the second target calibration node representation, and the third target calibration node representation, acquiring second attention information of the current node in the previous target calibration. Wherein, the previous target calibration can be expressed as the tth target calibration.
Further, the second attention information of the current node in the t-th target calibration can be represented by the following formula (6):
Figure BDA0003870061050000138
wherein the content of the first and second substances,
Figure BDA0003870061050000141
indicating the second attention information of the current node j in the t-th target calibration,
Figure BDA0003870061050000142
predecessor node, S, representing current node j j Representing the successor of the current node j. At i as a predecessor node
Figure BDA0003870061050000143
In the case of (a) in (b),
Figure BDA0003870061050000144
a second target calibration node representation of an ith predecessor node representing a current node j in a t-th target calibration; i is the successor node S j In the case of (a) the (b),
Figure BDA0003870061050000145
a third target calibration node representation of the ith successor node representing the current node j in the t-th target calibration.
Figure BDA0003870061050000146
Representing the first target calibration node representation of the current node j in the t-th target calibration.
Step S224, based on the first target calibration node representation and the second attention information, obtaining a fourth target calibration node representation of the current node in the current target calibration; and repeatedly executing the steps until each node in the calculation graph is traversed. The current target calibration may be denoted as the t +1 th target calibration.
Further, a fourth target calibration node representation of the current node in the t +1 th target calibration may be represented by the following formula (7):
Figure BDA0003870061050000147
wherein the content of the first and second substances,
Figure BDA0003870061050000148
represents the fourth target calibration node representation of the current node j in the t +1 th target calibration,
Figure BDA0003870061050000149
representing the first target calibration node representation of the current node j in the t-th target calibration,
Figure BDA00038700610500001410
and representing the second attention information of the current node j in the t-th target calibration.
Specifically, as shown in fig. 8, the intermediate node j in fig. 8 is taken as the current node, the start node i is taken as the predecessor node of the intermediate node j, and the end node k is taken as the successor node of the intermediate node j, so as to further explain the above target calibration process. First, a second target calibration node representation in the t-th target calibration based on the start node i
Figure BDA00038700610500001411
And the first target calibration node representation of the intermediate node j in the t-th target calibration
Figure BDA00038700610500001412
Obtaining attention information m ij . Second, a third target calibration node representation in the t-th target calibration based on the termination node k
Figure BDA0003870061050000151
And the first target calibration node representation of the intermediate node j in the t-th target calibration
Figure BDA0003870061050000152
Obtaining attention information m kj . Then, attention information m is added ij And attention information m kj The second attention information is obtained by superposition
Figure BDA0003870061050000153
Finally, based on the second attention information
Figure BDA0003870061050000154
And a first target calibration node representation
Figure BDA0003870061050000155
Obtaining a fourth target calibration node representation of the intermediate node j in the t +1 th target calibration
Figure BDA0003870061050000156
In one embodiment, as shown in fig. 9, the step S3 includes steps S31 to S32, wherein:
step S31, a final query representation of the logical query statement is obtained based on the preliminary calibration node representation and the target calibration node representation of the termination node in the computation graph.
Specifically, the preliminary calibration node representation and the target calibration node representation of the termination node are weighted and averaged to obtain a final query representation of the logical query statement.
And step S32, acquiring 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 a target entity.
In the steps S31 to S32, the preliminary calibration node representation and the target calibration node representation based on the termination node in the computational graph are weighted and averaged to eliminate the influence of the error represented by a single calibration node on the accuracy of the final query representation, so that a more accurate final query representation can be obtained, and further, the target entity corresponding to the logic query statement can be better detected from the knowledge graph based on the more accurate final query representation, thereby further improving the success rate and accuracy of the knowledge question-answering.
In an embodiment, the step S31 specifically includes the following steps:
in step S311, a plurality of preliminary calibration node representations of the termination node in the plurality of preliminary calibrations and a weight corresponding to each of the preliminary calibration node representations are obtained.
In step S312, a plurality of target calibration node representations obtained by the termination node in a plurality of target calibrations and a weight corresponding to each target calibration node representation are obtained.
Further, the weight corresponding to the calibration node representation obtained by the termination node in the tth calibration may be calculated by the following formula (8), where the tth calibration is a preliminary calibration or a target calibration, and the calibration node is represented by the preliminary calibration node representation or the target calibration node representation:
Figure BDA0003870061050000161
wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0003870061050000162
indicating the calibration node representation, w, of the termination node f obtained in the t-th calibration t Representing calibration node representations
Figure BDA0003870061050000163
The corresponding weight. q. q of w For computing a calibration node representation for a query vector
Figure BDA0003870061050000164
The degree of importance of.
Step S313, based on each preliminary calibration node representation and its corresponding weight, and each target calibration node representation and its corresponding weight, a final query representation of the logical query statement is obtained.
Further, multiplying each preliminary calibration node representation by its corresponding weight to obtain a plurality of first product terms, multiplying each target calibration node representation by its corresponding weight to obtain a plurality of second product terms, and adding the plurality of first product terms and the plurality of second product terms to obtain a final query representation of the logical query statement, where the final query representation may be represented by the following equation (9):
Figure BDA0003870061050000165
wherein q represents a final query representation of the logical query statement,
Figure BDA0003870061050000166
indicating the calibration node representation, w, of the termination node f obtained in the t-th calibration t Representing calibration node representations
Figure BDA0003870061050000167
The corresponding weight. L denotes the total number of calibrations, which is the sum of the number of preliminary calibrations and the number of target calibrations.
In one embodiment, for a disjunction operation of a logical query statement, the logical query statement may be converted into a Disjunction Normal Form (DNF) of n sub-logical query statements by converting the logical query statement into a Disjunction Normal Form (DNF).
Further, the step S32 specifically includes the following steps:
step S321, obtaining a sub-query expression of each sub-logic query statement corresponding to the logic query statement based on the final query q expression, and obtaining a plurality of sub-query expressions.
Step S322, for each entity in the preset knowledge graph, obtaining a first similarity corresponding to the entity representation of the entity and each sub-query representation, and obtaining a minimum first similarity as a second similarity corresponding to the entity and the logical query statement.
Further, the second similarity of each entity corresponding to the logical query statement may be calculated by the following formula (10):
dist(q,e)=min({sim(q 1 ,e),…,sim(q n ,e)}) (10)
wherein, { q 1 ,…,q n Denotes n sub-query representations, which are derived based on the final query and the disjunctive normal form. sim represents a similarity function, such as a cosine function.
Step S323, based on the maximum second similarity among the second similarities, corresponding to the logical query statement, of each entity in the preset knowledge graph, and determining the entity corresponding to the maximum second similarity as the target entity.
In one embodiment, a graph neural network model is constructed based on the knowledge question-answering method provided by the invention, a logic query statement input by a user is obtained, the logic query statement is input into the graph neural network model, a target entity output by the graph neural network model is obtained, and the target entity is fed back to the user as an answer of the logic query statement.
Further, the 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 relation 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 incorrect answer:
Figure BDA0003870061050000171
wherein e is j Representing a randomly sampled negative sample, i.e., a false answer. γ represents a pitch constant. σ denotes an activation function, such as a sigmoid function. q denotes a logical query statement, and k denotes the number of negative samples.
The following provides a specific example to further illustrate the knowledge question-answering method provided by the present invention. The knowledge question-answering method provided by the specific embodiment comprises the following steps:
(1) Generating a computational graph based on the logic query statement and the topological sorting processing rule, wherein the computational graph comprises node information of a plurality of nodes and association relations between adjacent nodes, and the node information comprises node depth; the plurality of nodes in the computational graph are arranged according to the node depth order and are divided into a start node, an intermediate node, and a stop node, as shown in fig. 10, the start node includes a node a1 and a node a2, and the stop node is a node c. The association relationship includes an association relationship r1, an association relationship r2, and an association relationship r3.
(2) And aiming at each node in the calculation graph, inputting the incidence relation between the node and the precursor node thereof and the predicted node representation of the precursor node thereof into a preset gated cycle unit network to obtain the predicted node representation of the node.
(3) Performing the preliminary calibration process for multiple times to sequentially perform preliminary calibration on the predicted node representation of each node in the calculation graph to obtain a preliminary calibration node representation of each node; the preliminary calibration node represents that the predicted node representation of the node is calibrated based on a first calibrated node representation of the precursor node corresponding to the node, and the first calibrated node representation is a node representation obtained after preliminary calibration is performed on the precursor node.
(4) Executing the target calibration process for multiple times to perform target calibration on the preliminary calibration node representation of each node in the calculation graph to obtain a target calibration node representation of each node; the target calibration node represents that the preliminary calibration node representation of the node is calibrated based on the second calibrated node representation of the precursor node and the subsequent node corresponding to the node, and the second calibrated node representation comprises the node representation obtained after the preliminary calibration or the target calibration is carried out on the precursor node and the subsequent node.
Fig. 10 illustrates a schematic diagram of a node representation calibration flow, which may be used to represent a schematic diagram for performing a preliminary calibration flow or performing a target calibration flow, where each layer of the computation graph represents a computation graph for performing a preliminary calibration or performing a target calibration, and the calibration node representation in each layer of the computation graph includes a preliminary calibration node representation obtained by performing a preliminary calibration and a target calibration node representation obtained by performing a target calibration.
(5) And acquiring a calibration node representation of each node in the computational graph based on the preliminary calibration node representation obtained by executing the preliminary calibration process for multiple times and the target calibration node representation obtained by executing the target calibration process for multiple times, wherein the calibration node representation comprises a plurality of preliminary calibration node representations and a plurality of target calibration node representations.
(6) A plurality of preliminary calibration node representations of the termination node in a plurality of preliminary calibrations and a corresponding weight for each of the preliminary calibration node representations are obtained. And acquiring a plurality of target calibration node representations obtained by the termination node in a plurality of target calibrations and corresponding weights of each target calibration node representation. And obtaining a final query expression of the logic query statement based on each preliminary calibration node expression and the corresponding weight thereof, and each target calibration node expression and the corresponding weight thereof.
(7) And acquiring the similarity between the entity representation of each entity in the preset knowledge graph and the final query representation, determining the entity with the highest similarity with the final query representation as a target entity, and outputting the target entity as an answer of the logic query statement.
In the following, the present embodiment is further explained by taking the logical query sentence "national (V, china) ^ born in (V, shanghai) ^ playsformbaream (V, T)" inputted by the user as an example, and the logical query sentence shows: when "a team with NBA efficacy of chinese living in Shanghai" is queried from the sports knowledge map, it can be determined that the start node is V, the node a1 is China, the node a2 is Shanghai, and the end node is T. The incidence relation r1 is national, the incidence relation r2 is BornIn, and the incidence relation r3 is PlaysForNBATeam, so that a computational graph of the logic query statement can be obtained, and a preliminary calibration node representation and a target calibration node representation of each node in the computational graph are obtained. A final query representation of the logical query statement is finally computed based on the preliminary calibration node representation and the target calibration node representation of the termination node T. The sports knowledge graph comprises a first entity Houston Rockets, a second entity Los Angeles Lakers and a third entity Chicago Bulls, and similarity between the final query representation of the logic query statement and the entity representations of the three entities is obtained, wherein the similarity corresponding to the Houston Rockets of the first entity is 0.95, the similarity corresponding to the Los Angeles Lakers of the second entity is 0.3, and the similarity corresponding to the Chicago Bulls of the third entity is 0.1, so that the target entity corresponding to the logic query statement is the first entity Houston Rockets, and the Houston team is used as an answer to the logic query statement to be output. The following describes the knowledge question-answering device provided by the present invention, and the knowledge question-answering device described below and the knowledge question-answering method described above can be referred to in correspondence to each other.
As shown in fig. 11, the present invention provides a question-answering apparatus 100, the question-answering apparatus 100 including:
the prediction module 10 is configured to construct a computational graph based on the obtained logic query statement, and obtain a prediction node representation of each node in the computational graph; the calculation graph comprises node information of a plurality of nodes and incidence relations between adjacent nodes, and the node information comprises node depth.
A calibration module 20, configured to calibrate, for each node in the computational graph, the predicted node representation of the node based on the node representations of the predecessor node and successor node of the node, so as to obtain a calibrated node representation of the node.
And the response module 30 is used for determining a target entity based on the calibration node representation of the node in the computational graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as an answer of the logic query statement.
In one embodiment, prediction module 10 includes a computational graph generation unit and a node representation prediction unit, wherein:
and the computational graph generating unit is used for generating a computational graph based on the logic query statement and the topology sorting processing rule, and a plurality of nodes in the computational graph are arranged according to the node depth sequence and are divided into a starting node, an intermediate node and a terminating node.
And the node representation prediction unit is used for inputting the incidence relation between the node and the precursor node thereof and the prediction node representation of the precursor node thereof into a preset gate control cycle unit network aiming at each node in the calculation graph to obtain the prediction node representation of the node.
In one embodiment, the calibration module 20 comprises a preliminary node calibration unit, a target node calibration unit, and a node representation acquisition unit, wherein:
the preliminary node calibration unit is used for executing a preliminary calibration process so as to carry out preliminary calibration on the predicted node representation of each node in the calculation graph in sequence to obtain a preliminary calibration node representation of each node; the preliminary calibration node represents that the predicted node representation of the node is calibrated based on a first calibrated node representation of the precursor node corresponding to the node, and the first calibrated node representation is a node representation obtained after the preliminary calibration is performed on the precursor node.
The target node calibration unit is used for executing a target calibration process so as to perform target calibration on the preliminary calibration node representation of each node in the calculation graph to obtain a target calibration node representation of each node; the target calibration node represents that the preliminary calibration node representation of the node is calibrated based on the second calibrated node representation of the precursor node and the successor node corresponding to the node, and the second calibrated node representation comprises the node representation obtained by preliminarily calibrating the precursor node and the successor node or by target calibration.
And a node representation acquisition unit, configured to acquire a calibration node representation of each node in the computational graph based on a preliminary calibration node representation obtained by performing the preliminary calibration procedure and a target calibration node representation obtained by performing the target calibration procedure, where the calibration node representation includes the preliminary calibration node representation and the target calibration node representation.
In an embodiment, the preliminary node calibration unit is further configured to perform the preliminary calibration process multiple times to perform preliminary calibration on the predicted node representation of each node in the computation graph, so as to obtain a preliminary calibration node representation of each node; wherein, the preliminary calibration process comprises the following steps: acquiring a first preliminary calibration node representation of a current node in previous preliminary calibration and a second preliminary calibration node representation of a precursor node of the current node in current preliminary calibration; acquiring first attention information of a current node in the current primary calibration based on the first primary calibration node representation and the second primary calibration node representation; acquiring a third preliminary calibration node representation of the current node in the current preliminary calibration based on the first preliminary calibration node representation and the first attention information; and repeatedly executing the steps until each node in the calculation graph is traversed.
In an embodiment, the target node calibration unit is further configured to execute the target calibration procedure multiple times, so as to perform target calibration on the preliminary calibration node representation of each node in the computational graph, and obtain a target calibration node representation of each node; the target calibration process comprises the following steps: respectively acquiring a current node, a predecessor node of the current node and a successor node of the current node, and a first target calibration node representation, a second target calibration node representation and a third target calibration node representation in previous target calibration; acquiring second attention information of the current node in previous target calibration based on the first target calibration node representation, the second target calibration node representation and the third target calibration node representation; acquiring a fourth target calibration node representation of the current node in the current target calibration based on the first target calibration node representation and the second attention information; and repeatedly executing the steps until each node in the computational graph is traversed.
In one embodiment, the answering module 30 includes a query representation obtaining unit and a target entity determining unit, wherein:
and the query representation acquisition unit is used for acquiring a final query representation of the logic query statement based on the preliminary calibration node representation of the termination node and the target calibration node representation in the computational graph.
And the target entity determining unit is used for acquiring 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.
Fig. 12 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 12: a processor (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 via the communication bus 840. Processor 810 may invoke logic instructions in memory 830 to perform a method of question-answering, the method comprising: constructing a computational graph based on the obtained logic query statement, and obtaining a prediction node representation of each node in the computational graph; the calculation graph comprises node information of a plurality of nodes and incidence relation between adjacent nodes, and the node information comprises node depth; aiming at each node in the calculation 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 a calibrated node representation of the node; and determining a target entity based on the calibration node representation of the nodes in the computational graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as an answer of the logic query statement.
In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is capable of executing the question answering method provided by the above methods, and the method includes: constructing a computational graph based on the obtained logic query statement, and obtaining a prediction node representation of each node in the computational graph; the calculation graph comprises node information of a plurality of nodes and incidence relation between adjacent nodes, and the node information comprises node depth; aiming at each node in the calculation 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 a calibrated node representation of the node; and determining a target entity based on the calibration node representation of the node in the computational graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as an answer of the logic query statement.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the question answering method provided by the above methods, the method including: constructing a computational graph based on the obtained logic query statement, and obtaining a prediction node representation of each node in the computational graph; the calculation graph comprises node information of a plurality of nodes and incidence relation between adjacent nodes, and the node information comprises node depth; aiming at each node in the calculation 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 a calibrated node representation of the node; and determining a target entity based on the calibration node representation of the node in the computational graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as an answer of the logic query statement.
The above-described embodiments of the apparatus are merely illustrative, and units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or 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 solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of question answering, comprising:
constructing a computational graph based on the obtained logic query statement, and obtaining a prediction node representation of each node in the computational graph; the computational graph comprises node information of a plurality of nodes and incidence relation between adjacent nodes, wherein the node information comprises node depth;
for each node in the computational graph, calibrating the predicted node representation of the node based on the node representations of the predecessor node and successor node of the node to obtain a calibrated node representation of the node;
and determining a target entity based on the calibration node representation of the node in the computational graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as an answer of the logic query statement.
2. The method of claim 1, wherein constructing a computational graph based on the obtained logical query statements and obtaining a predicted node representation for each node in the computational graph comprises:
generating the computational graph based on the logic query statement and a topological sorting processing rule, wherein a plurality of nodes in the computational graph are arranged according to the node depth sequence and are divided into a starting node, an intermediate node and a terminating node;
and for each node in the calculation graph, inputting the incidence relation between the node and the precursor node thereof and the predicted node representation of the precursor node thereof into a preset gated cycle unit network to obtain the predicted node representation of the node.
3. The question-answering method according to claim 2, wherein the calibrating, for each node in the computational graph, the predicted node representation of the node based on the node representations of the predecessor and successor nodes of the node to obtain a calibrated node representation of the node comprises:
executing a preliminary calibration process to perform preliminary calibration on the predicted node representation of each node in the calculation graph in sequence to obtain a preliminary calibration node representation of each node; the preliminary calibration node represents a predicted node representation of the node calibrated based on a first calibrated node representation of a precursor node corresponding to the node, and the first calibrated node representation is a node representation obtained after preliminary calibration of the precursor node;
executing a target calibration flow to perform target calibration on the preliminary calibration node representation of each node in the calculation graph to obtain a target calibration node representation of each node; the target calibration node represents that the preliminary calibration node representation of the node is calibrated based on the second calibrated node representation of the precursor node and the subsequent node corresponding to the node, and the second calibrated node representation comprises the node representation obtained after the preliminary calibration or the target calibration is carried out on the precursor node and the subsequent node;
and acquiring a calibration node representation of each node in the computational graph based on a preliminary calibration node representation obtained by executing a preliminary calibration process and a target calibration node representation obtained by executing a target calibration process, wherein the calibration node representation comprises the preliminary calibration node representation and the target calibration node representation.
4. The method of claim 3, wherein the performing a preliminary calibration procedure to preliminarily calibrate the predicted node representation of each node in the computational graph in turn to obtain a preliminary calibrated node representation of each node comprises:
executing a preliminary calibration process for multiple times to preliminarily calibrate the predicted node representation of each node in the calculation graph to obtain a preliminary calibration node representation of each node;
wherein, the preliminary calibration process comprises the following steps: acquiring a first preliminary calibration node representation of a current node in previous preliminary calibration and a second preliminary calibration node representation of a precursor node of the current node in current preliminary calibration;
acquiring first attention information of the current node in the current primary calibration based on the first primary calibration node representation and the second primary calibration node representation;
acquiring a third preliminary calibration node representation of the current node in the current preliminary calibration based on the first preliminary calibration node representation and the first attention information; and repeatedly executing the steps until each node in the computational graph is traversed.
5. The method of claim 3, wherein performing a target calibration procedure to perform a target calibration on the preliminary calibration node representation for each node in the computational graph to obtain a target calibration node representation for each node comprises:
executing a target calibration process for multiple times to perform target calibration on the preliminary calibration node representation of each node in the calculation graph to obtain a target calibration node representation of each node;
wherein the target calibration procedure comprises the steps of: respectively acquiring a current node, a first target calibration node representation, a second target calibration node representation and a third target calibration node representation of a predecessor node and a successor node of the current node in previous target calibration;
acquiring second attention information of the current node in previous target calibration based on the first target calibration node representation, the second target calibration node representation and the third target calibration node representation;
acquiring a fourth target calibration node representation of the current node in the current target calibration based on the first target calibration node representation and the second attention information; and repeatedly executing the steps until each node in the computational graph is traversed.
6. The question-answering method according to any one of claims 3 to 5, wherein the determining of the target entity based on the calibration node representation of the nodes in the computational graph and the entity representation of each entity in the preset knowledge-graph comprises:
obtaining a final query representation of the logical query statement based on a preliminary calibration node representation and a target calibration node representation of a termination node in the computational graph;
and acquiring 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.
7. A knowledge base question answering apparatus, comprising:
the prediction module is used for constructing a computational graph based on the obtained logic query statement and obtaining the prediction node representation of each node in the computational graph; the computational graph comprises node information of a plurality of nodes and incidence relation between adjacent nodes, wherein the node information comprises node depth;
a calibration module, configured to calibrate, for each node in the computational 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;
and the answer module is used for determining a target entity based on the calibration node representation of the node in the computational graph and the entity representation of each entity in the preset knowledge graph, and outputting the target entity as an answer of the logic query statement.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of knowledge question answering according to any one of claims 1 to 6 when executing the program.
9. A non-transitory computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the question answering method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method of knowledge question answering according to any one of claims 1 to 6.
CN202211193891.8A 2022-09-28 2022-09-28 Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium Pending CN115618011A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211193891.8A CN115618011A (en) 2022-09-28 2022-09-28 Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211193891.8A CN115618011A (en) 2022-09-28 2022-09-28 Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115618011A true CN115618011A (en) 2023-01-17

Family

ID=84861043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211193891.8A Pending CN115618011A (en) 2022-09-28 2022-09-28 Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115618011A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116756052A (en) * 2023-08-18 2023-09-15 建信金融科技有限责任公司 Data processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116756052A (en) * 2023-08-18 2023-09-15 建信金融科技有限责任公司 Data processing method and device
CN116756052B (en) * 2023-08-18 2023-11-14 建信金融科技有限责任公司 Data processing method and device

Similar Documents

Publication Publication Date Title
Hodges Some algebra and geometry for hierarchical models, applied to diagnostics
CN106844368B (en) Method for man-machine conversation, neural network system and user equipment
Jain Question answering over knowledge base using factual memory networks
CN111382255B (en) Method, apparatus, device and medium for question-answering processing
US20200387574A1 (en) Linguistically rich cross-lingual text event embeddings
Chollampatt et al. Neural quality estimation of grammatical error correction
US11861308B2 (en) Mapping natural language utterances to operations over a knowledge graph
Huang et al. A novel framework for robustness analysis of visual qa models
US20210406687A1 (en) Method for predicting attribute of target object based on machine learning and related device
Chen et al. Ls-tree: Model interpretation when the data are linguistic
CN115017294A (en) Code searching method
CN115618011A (en) Knowledge question answering method, knowledge question answering device, electronic equipment and readable storage medium
CN114996423A (en) Water conservancy knowledge graph complex question-answering method based on subproblem pruning
Paydar et al. A semi-automated approach to adapt activity diagrams for new use cases
US11544281B2 (en) Query-oriented approximate query processing based on machine learning techniques
CN114492451A (en) Text matching method and device, electronic equipment and computer readable storage medium
KR20220066554A (en) Method, apparatus and computer program for buildding knowledge graph using qa model
US11822544B1 (en) Retrieval of frequency asked questions using attentive matching
CN113779190A (en) Event cause and effect relationship identification method and device, electronic equipment and storage medium
Zamanzadeh et al. Autopopulus: a novel framework for autoencoder imputation on large clinical datasets
Li et al. Causal Reinforcement Learning for Knowledge Graph Reasoning
WO2022219741A1 (en) Learning device, inference device, program, learning method, and inference method
CN114297357B (en) Question-answer model construction method and device based on quantum computation and electronic equipment
JP6915818B1 (en) Pathway generator, pathway generation method and pathway generation program
Rashid Indexed Negative Sampling and Scalable Knowledge Graph Embedding Models

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination