CN113360604A - Knowledge graph multi-hop question-answering method and model based on cognitive inference - Google Patents
Knowledge graph multi-hop question-answering method and model based on cognitive inference Download PDFInfo
- Publication number
- CN113360604A CN113360604A CN202110697004.XA CN202110697004A CN113360604A CN 113360604 A CN113360604 A CN 113360604A CN 202110697004 A CN202110697004 A CN 202110697004A CN 113360604 A CN113360604 A CN 113360604A
- Authority
- CN
- China
- Prior art keywords
- module
- question
- inference
- knowledge graph
- output
- 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.)
- Granted
Links
- 230000001149 cognitive effect Effects 0.000 title claims abstract description 85
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000012549 training Methods 0.000 claims abstract description 23
- 238000012545 processing Methods 0.000 claims abstract description 16
- 230000006870 function Effects 0.000 claims abstract description 11
- 238000012360 testing method Methods 0.000 claims abstract description 9
- 238000013528 artificial neural network Methods 0.000 claims abstract description 6
- 208000003443 Unconsciousness Diseases 0.000 claims description 67
- 239000000126 substance Substances 0.000 claims description 10
- 238000006243 chemical reaction Methods 0.000 claims description 5
- 238000010845 search algorithm Methods 0.000 claims description 5
- 150000001875 compounds Chemical class 0.000 claims description 4
- 238000004364 calculation method Methods 0.000 claims description 3
- 241000282414 Homo sapiens Species 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000002679 ablation Methods 0.000 description 2
- 230000009977 dual effect Effects 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 125000002015 acyclic group Chemical group 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000004800 variational method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3346—Query execution using probabilistic model
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/216—Parsing using statistical methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/02—Knowledge representation; Symbolic representation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/04—Inference or reasoning models
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N7/00—Computing arrangements based on specific mathematical models
- G06N7/01—Probabilistic graphical models, e.g. probabilistic networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Artificial Intelligence (AREA)
- Mathematical Physics (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- Probability & Statistics with Applications (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Animal Behavior & Ethology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Human Computer Interaction (AREA)
- Algebra (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a knowledge graph multi-hop question-answering method and a knowledge graph multi-hop question-answering model based on cognitive inference, wherein the method comprises the following steps: step 1, randomly selecting multiple batches of data from given question-answer pair data as a training set; step 2, training parameters of the deep cognitive inference network model by taking the training set as input, and optimizing the deep cognitive inference network model by using a neural network optimizer to minimize the loss function value in the training process to obtain an optimized network model; and 3, processing the questions in the test set through the optimized network model, and scoring each candidate answer entity, wherein the candidate answer entity with the highest score is the answer of the given natural language question. By simulating a human cognitive inference mechanism, knowledge inference is carried out from different angles by a hierarchical network model, the information of node levels and edge levels in the knowledge graph is effectively utilized and modeled, and the multi-hop question-answering of the knowledge graph is remarkably improved.
Description
Technical Field
The invention relates to the field of natural language processing based on a knowledge graph, in particular to a knowledge graph multi-hop question-answering method and a knowledge graph multi-hop question-answering model based on cognitive reasoning.
Background
The knowledge-graph stores human knowledge in the form of a multi-relationship directed graph, wherein each node in the graph represents an entity, each edge represents a relationship between two entities, and the direction of the edge represents the directivity of the direction. Each Fact (Fact) in the knowledge-graph is typically stored in the form of a triplet of head, relationship, tail entities, such as: the Yaoming, the radix rehmanniae and the Shanghai are a triad.
The knowledge-graph question-answer aims at answering a given natural language question based on a knowledge graph, the knowledge-graph multi-hop question-answer aims at obtaining answers through path reasoning in the knowledge graph, and a schematic diagram of a knowledge-graph multi-hop question-answer task is shown in fig. 1.
The current knowledge graph multi-hop question-answering has a severe challenge, and the answer accuracy rate of the complex questions needing long reasoning paths is low, because the complex questions needing long reasoning paths exponentially increase the number of candidate answer entities along with the increase of the hop count, but a large number of candidate answer entities bring difficulty for searching accurate answers. In the prior method, KV-Mem uses a Memory Network (Memory Network) to perform multi-hop reasoning, VRN uses a variational method framework to perform multi-hop reasoning, but the methods are difficult to effectively solve the problem of accurate answer of the problem requiring a long reasoning path. In order to solve the problem, the existing methods (such as GRAFT-Net and PullNet) firstly extract a problem-related subgraph and then perform reasoning on the extracted subgraph. However, these approaches tend to sacrifice recall of answer entities in the subgraph to reduce the size of the candidate entity set, i.e., such compromises limit the performance of existing models. Therefore, for the complex problem requiring a long inference path, how to provide a high-accuracy question-answering method without sacrificing recall rate is a problem to be solved.
Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to provide a knowledge graph multi-hop question-answering method and a knowledge graph multi-hop question-answering model based on cognitive reasoning, which can solve the problems of low answer accuracy rate and correct answer recall rate of a sacrifice model caused by the need of long reasoning path complexity in the prior knowledge graph multi-hop question-answering.
The purpose of the invention is realized by the following technical scheme:
the embodiment of the invention provides a knowledge graph multi-hop question-answering method based on cognitive reasoning, which is used for obtaining a correct answer of a natural language question based on cognitive reasoning prediction by taking a certain subject entity as a reasoning starting point in a given knowledge graph and comprises the following steps:
and 3, processing the natural language questions in the test set through the optimized deep cognitive inference network model, and scoring each candidate answer entity, wherein the candidate answer entity with the highest score is the answer of the given natural language question.
The embodiment of the invention also provides a knowledge graph multi-hop question-and-answer model based on cognitive inference, which comprises the following steps:
the device comprises an input layer, an inference path decoding module, an unconscious module, a conscious module and an output layer; wherein the content of the first and second substances,
the input layer is respectively connected with the rational path decoding module and the unconscious module and is used for inputting a given natural language question;
the output end of the reasoning path decoding module is respectively connected with the unconsciousness module and the conscious module, the rational path decoding module receives the given natural language problem transmitted by the input layer and outputs each selected score in each step of the reasoning path obtained by decoding the given natural language problem;
the unconsciousness module is sequentially connected with the consciousness module and the output layer, the input of the unconsciousness module is the output of a given natural language question, a knowledge graph and an inference path decoding module, and the output of the unconsciousness module is the score of each candidate answer entity;
the input of the conscious module is given natural language question, knowledge graph, the output of the reasoning path decoding module and the output of the unconscious module, and the output is the final score of each candidate answer entity;
and the output layer is used for outputting the final score of each candidate answer entity obtained by the conscious module.
According to the technical scheme provided by the invention, the cognitive inference-based knowledge graph multi-hop question-answering method and the model provided by the embodiment of the invention have the beneficial effects that:
by simulating a human cognitive inference mechanism, knowledge inference is carried out from different angles by utilizing a hierarchical deep cognitive inference network model, the node level and side level information in the knowledge graph is effectively utilized and modeled, and the performance of carrying out knowledge graph multi-hop question answering is remarkably improved. The method and the model of the invention combine knowledge map embedding and Bayesian network technology to carry out modeling processing, can quickly and accurately predict the knowledge map multi-hop question-answering to obtain the corresponding candidate answer entity, have excellent performance, and further well solve the problems of low answer accuracy rate to the problem needing a long inference path and sacrifice of correct answer recall rate by the model in the existing knowledge map multi-hop question-answering.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a flowchart of a knowledge graph multi-hop question-answering method based on cognitive inference according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of knowledge graph multi-hop question-answer modeling based on cognitive inference provided in an embodiment of the present invention;
FIG. 3 is a schematic diagram of a knowledge graph multi-hop question-and-answer method model based on cognitive inference according to an embodiment of the present invention;
fig. 4 is a schematic diagram provided in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the specific contents of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention. Details which are not described in detail in the embodiments of the invention belong to the prior art which is known to the person skilled in the art.
Referring to fig. 1, an embodiment of the present invention provides a knowledge graph multi-hop question-and-answer method based on cognitive inference, which is used for predicting a correct answer to a natural language question based on cognitive inference from a given knowledge graph with a certain subject entity as an inference starting point, and includes the following steps:
and 3, processing the natural language questions in the test set through the optimized deep cognitive inference network model, and scoring each candidate answer entity, wherein the candidate answer entity with the highest score is the answer of the given natural language question.
Referring to fig. 3, in the above method, the deep cognitive inference network model includes:
the device comprises an input layer, an inference path decoding module, an unconscious module, a conscious module and an output layer; wherein the content of the first and second substances,
the input layer is respectively connected with the rational path decoding module and the unconscious module and is used for inputting a given natural language question;
the output end of the reasoning path decoding module is respectively connected with the unconsciousness module and the conscious module, the rational path decoding module receives the given natural language problem transmitted by the input layer and outputs each selected score in each step of the reasoning path obtained by decoding the given natural language problem;
the unconsciousness module is sequentially connected with the consciousness module and the output layer, the input of the unconsciousness module is the output of a given natural language question, a knowledge graph and an inference path decoding module, and the output of the unconsciousness module is the score of each candidate answer entity;
the input of the conscious module is given natural language question, knowledge graph, the output of the reasoning path decoding module and the output of the unconscious module, and the output is the final score of each candidate answer entity;
and the output layer is used for outputting the final score of each candidate answer entity obtained by the conscious module.
In the method, the reasoning path decoding module adopts a long-short term memory network (LSTM);
the unconsciousness module adopts a neural network model based on vector semantic matching;
the conscious module employs a neural network model based on a probabilistic graphical model.
In the method, the unconsciousness module of the deep cognitive inference network model scores each candidate answer entity through semantic matching, and the score of the candidate answer entity e is calculated through the following formula 1:
in the formula (1), the first and second groups of the compound,representing a query vector derived based on a natural language question q,the following is calculated by formula 2:
in said formula 2, symbolsDenotes multiplication between elements, o(i)And representing the output of the ith step in an inference path decoding module of the deep cognitive inference network model.
In the method, the conscious module of the deep cognitive inference network model performs sequential inference by using a bayesian network based on the score output by the unconscious module to obtain the final score of each candidate answer entity.
In the above method, the specific processing steps of the conscious module are as follows:
(a) cutting a knowledge graph: with a subject entity etopicE epsilon as inference starting point, using breadth-first search algorithm to obtain a given knowledge graphSearching a corresponding answer entity of a natural language question q to obtain a directed acyclic graph consisting of only accessed edges as a clipped knowledge graph
(b) The cut knowledge map isConversion to a Bayesian networkAndthe graph structures of the two are the same, and the definition of the nodes and the edges of the two are respectively as follows:
(c) reasoning is carried out based on the Bayesian network: based on the Bayesian network obtained in the step (b)The modeling knowledge graph multi-hop question-answering is as follows:this conditional probability is expressed in a given knowledge graphQuestion q and subject entity etopicThe probability that entity e is the correct answer.
From the properties of the bayesian network, the following results are derived:
where pa (e) represents a set of parent nodes of entity (node) e in the knowledge-graph
modeling the probability equation (4) in the above manner:
in the above formula (5), fs(e) Is the score of the unconscious module output, fb(e) Is the scoring result of the candidate entity e calculated by the conscious module, fb(e) Calculated by the following equation (6):
In the method, the loss function of the deep cognitive inference network model is as follows:
in the above-mentioned formula (7),| epsilon | represents the entity set size,representing the answer set size.
Referring to fig. 3, an embodiment of the present invention provides a knowledge graph multi-hop question-and-answer model based on cognitive inference, including:
the device comprises an input layer, an inference path decoding module, an unconscious module, a conscious module and an output layer; wherein the content of the first and second substances,
the input layer is respectively connected with the rational path decoding module and the unconscious module and is used for inputting a given natural language question;
the output end of the reasoning path decoding module is respectively connected with the unconsciousness module and the conscious module, the rational path decoding module receives the given natural language problem transmitted by the input layer and outputs each selected score in each step of the reasoning path obtained by decoding the given natural language problem;
the unconsciousness module is sequentially connected with the consciousness module and the output layer, the input of the unconsciousness module is the output of a given natural language question, a knowledge graph and an inference path decoding module, and the output of the unconsciousness module is the score of each candidate answer entity;
the input of the conscious module is given natural language question, knowledge graph, the output of the reasoning path decoding module and the output of the unconscious module, and the output is the final score of each candidate answer entity;
and the output layer is used for outputting the final score of each candidate answer entity obtained by the conscious module.
In the above model, the inference path decoding module adopts a coder-decoder model;
the unconsciousness module adopts a semantic matching model based on the inner product of the vector;
the conscious module employs a Bayesian network-based path inference model.
In the above model, the unconsciousness module of the deep cognitive inference network model scores each candidate answer entity by semantic matching, and calculates the score of the candidate answer entity e by the following formula 1:
in the formula (1), the first and second groups of the compound,representing a query vector derived based on a natural language question q,the following is calculated by formula 2:
in said formula 2, symbolsDenotes multiplication between elements, o(i)Representing the output of the ith step in an inference path decoding module of the deep cognitive inference network model;
and the conscious module of the deep cognitive inference network model carries out sequential inference by using a Bayesian network based on the score output by the unconscious module to obtain the final score of each candidate answer entity.
In the above model, the specific processing steps of the conscious module are as follows:
(a) cutting a knowledge graph: with a subject entity etopicE epsilon as inference starting point, using breadth-first search algorithm to obtain a given knowledge graphSearching a corresponding answer entity of a natural language question q to obtain a natural language questionDirected acyclic graphs composed of visited edges as tailored knowledge graphs
(b) The cut knowledge map isConversion to a Bayesian networkAndthe graph structures of the two are the same, and the definition of the nodes and the edges of the two are respectively as follows:
(c) reasoning is carried out based on the Bayesian network: based on the Bayesian network obtained in the step (b)The modeling knowledge graph multi-hop question-answering is as follows:
from the properties of the bayesian network, the following results are derived:
modeling the probability equation (4) in the above manner:
in the above formula (5), fs(e) Is the score of the unconscious module output, fb(e) Is the scoring result of the candidate entity e calculated by the conscious module, fb(e) Calculated by the following equation (6):
the knowledge graph multi-hop question-answering method based on the cognitive inference is based on a double process theory in the cognitive science, modeling processing is carried out by combining knowledge graph embedding and Bayesian network technology, corresponding candidate answer entities can be obtained by fast and accurately predicting the knowledge graph multi-hop question-answering, and the method has excellent performance, and further well solves the problems that in the existing knowledge graph multi-hop question-answering, the answer accuracy rate of the problems needing long inference paths is low, and the correct answer recall rate is sacrificed by a model.
The embodiments of the present invention are described in further detail below.
The embodiment of the invention provides a knowledge graph multi-hop question-answer model based on cognitive inference, which is a deep cognitive inference network model and comprises the following steps:
a rational path decoding module, an unconscious (unconcerous) module and a conscious (conscious) module; wherein the content of the first and second substances,
and the path decoding module is used as the lowest layer module, and the output of the path decoding module is used as part of the input of the unconscious module and the conscious module. The input of the module is a given question, and the output is inference path information decoded from the question, namely the score selected by each step in the inference path;
the unconsciousness module, the input of which is the output of a given question, knowledge graph and path decoding module, the output of which is the score for each candidate answer entity, and also as part of the input to the consciousness module.
The conscious module, whose inputs are the given question, the knowledge-graph, the output of the path decoding module, and the output of the unconscious module, whose output is the final score for each candidate answer entity. This score is also output as the entire model.
The embodiment of the invention also provides a knowledge graph multi-hop question-and-answer method based on cognitive inference, which is used for obtaining a correct answer of a natural language question based on cognitive inference prediction by taking a certain subject entity as an inference starting point in a given knowledge graph, and comprises the following steps:
and 3, processing the natural language questions in the test set through the optimized deep cognitive inference network model, and scoring each candidate answer entity, wherein the candidate answer entity with the highest score is the answer of the given natural language question.
The method and the model of the invention simulate the cognitive inference mechanism of human beings, utilize the hierarchical deep layer cognitive inference network model to carry out knowledge inference from different angles, effectively utilize and model the node level and the side level information in the knowledge graph, and obtain remarkable performance improvement for carrying out multi-hop question answering of the knowledge graph.
Specifically, the knowledge graph multi-hop question-answering method based on cognitive reasoning specifically comprises the following steps:
the knowledge-graph and symbols used are first described, followed by a description of the specific processing steps of the present invention.
Knowledge-graph (KG) is a multi-relationship directed graph representing structured human knowledge, and one KG can be expressed asWhere epsilon represents the set of entities,a set of relationships is represented that is,a set of triples is represented.
The knowledge-graph multi-hop question-answer of the present invention (see fig. 2): from a given knowledge-graphWith subject entity e as the origin of reasoningtopicE epsilon, and predicting to obtain a correct answer e of the natural language question q*,The correct answer is called a candidate answer entity.
The invention designs a Deep Cognitive inference Network model (DCRN) for a knowledge map multi-hop question-answering task. The deep cognitive inference network model is based on the Dual Process Theory (Dual Process Theory) in cognitive science. The theory proposes that the human reasoning process can be broken down into two processes: unconscious processes (nonconcissus processes) and conscious processes (consciosus processes). The former uses intuition (fast intuition) to extract important parts from massive amounts of information, while the latter uses sequential reasoning (sequential reasoning) to find answers. Similarly, the deep cognitive inference network model of the present invention includes: the unconscious Module and the conscious Module respectively perform processing of two stages, namely an unconscious stage (unconscious phase) and a conscious stage (conscious phase), and also include an inference Path Decoding Module (Path Decoding Module), as shown in fig. 3.
The functions and processes of the inference path decoding module, the unconscious module and the conscious module are described below, respectively.
(1) The inference path decoding module:
the inference path decoding module has the input that q is a natural language problem and the output is the inference path information obtained by decoding the problem q, namely the score of each selection in each step in the inference path. Specifically, the problem q is processed using an encoding-decoding (Encoder-Decoder) structure.
First, a problem q is encoded as a vector representation q ═ RNN-encoder (q) using a Recurrent Neural Network (RNN) included in an inference path decoding module;
next, decoding the vector representation q ═ RNN-encoder (q) to obtain inference path information, i.e., a score selected in each step in the inference path, as shown in fig. 4.
The process of decoding the vector representation q ═ RNN-Encoder (q) by the inference path decoding module is divided into multiple steps, wherein the state vector of the t step uses h(t)Expressed, calculated by the following formula:
h(t)=RNN-Decoder(h(t-1),i(t));
in the above formula, i(t)Is the input vector of the t step, the initial state vector is h(0)Q, the initial input vector i(0)0; the output of the t step is calculated by the following method:
wherein the content of the first and second substances, representing the score of the ith relation in the t step;
the output of the t step is used as the input of the (t +1) step, i.e. i(t+1)=o(l)。
(2) An unconscious module:
in the processing of the unconsciousness module, each candidate entity is scored using Semantic Matching (Semantic Matching), and the score of candidate entity e is calculated as follows:
wherein the content of the first and second substances,represents a query (query) vector obtained based on the problem q, which is calculated as follows:
wherein, the symbolDenotes multiplication between elements, o(i)Representing the output of the ith step in the inference path decoding module.
(3) A conscious module:
in the processing of the unconsciousness module, a sequential inference is performed using a bayesian network based on the score of the unconsciousness module, thereby accurately predicting the answer. The processing of the unconscious module includes the steps of:
(a) cutting a knowledge graph: given a knowledge graphA question q and a topic entity (as a reasoning starting point) etopicE.g. epsilon, starting from the subject entity, executing a Breadth-First Search algorithm (Breadth-First Search) from the knowledge graphSearching, only reserving visited edges (edge) in the graph, and finally obtaining the cut knowledge graphThe graph is a Directed Acyclic Graph (DAG);
(b) the cut knowledge map isConversion into a Bayesian network, for use in the converted Bayesian networkIt is shown that,andthe graph structures are the same, and the difference is that the definition of the nodes and the edges of the graph structures is different, which is shown in the following table 1;
(c) Bayesian network-basedReasoning is carried out: based on step (b)Resulting Bayesian networksThe knowledge graph multi-hop question-answering is modeled in the following way:
from the properties of the bayesian network, the following results are derived:
the above probability formula is modeled using the following:
wherein f iss(e) Is the scoring result calculated by the unconscious module; f. ofb(e) Is the scoring result of the candidate entity e calculated by the conscious module; f. ofb(e) The calculation method of (c) is as follows:
the invention makes the knowledge map multi-hop question-answering model have superior performance by designing a deep layer cognitive inference network model based on a double process theory in cognitive science and combining knowledge map embedding and Bayesian network for modeling.
Table 2 is a performance table of the deep cognitive inference network model of the present invention
The above table 2 shows the test results (index H @1) of the deep layer cognitive inference network model (DCRN) of the present invention on the main stream data set WebQSP and MetaQA data sets. Experimental results show that the DCRN has performance remarkably superior to that of the existing method on a mainstream data set.
Table 3 is a performance table of the unconscious module and conscious module ablation experiments of the deep cognitive inference network model of the present invention:
from the above table 3, it can be seen that the deep layer cognitive inference network model (i.e. DCRN) of the present invention has the ablation experimental test result on the main stream data set MetaQA data set. Experimental results show that the two stages of the DCRN play a vital role in the final result.
Examples
(1) A training stage:
the goal of the training phase is to minimize the loss function;
given knowledge graphA question q and a topic entity (reasoning starting point) etopicE epsilon, and correct answer setThe goal of the training process is to minimize the following loss function (the two-class cross-entropy loss function):
(2) and (3) a testing stage:
at the time of testing, for a given knowledge-graphA question q and a topic entity (reasoning starting point) etopicE epsilon, the DCRN scores each candidate entity e:
and then selecting the candidate entity with the highest score as the predicted final answer.
Those of ordinary skill in the art will understand that: all or part of the processes of the methods for implementing the embodiments may be implemented by a program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (11)
1. A knowledge graph multi-hop question-answering method based on cognitive reasoning is characterized in that a correct answer of a natural language question is obtained by taking a certain subject entity as a reasoning starting point in a given knowledge graph and predicting based on the cognitive reasoning, and comprises the following steps:
step 1, randomly selecting multiple batches of data from given question-answer pair data as a training set; the question-answer pair data is a data pair consisting of a natural language question and a correct candidate answer entity;
step 2, training parameters of the deep layer cognitive inference network model by taking the training set as input, and optimizing the deep layer cognitive inference network model by using a neural network optimizer to minimize the loss function value in the training process to obtain an optimized deep layer cognitive inference network model;
and 3, processing the natural language questions in the test set through the optimized deep cognitive inference network model, and scoring each candidate answer entity, wherein the candidate answer entity with the highest score is the answer of the given natural language question.
2. The cognitive inference based knowledge graph multi-hop question-answering method according to claim 1, wherein the deep layer cognitive inference network model comprises:
the device comprises an input layer, an inference path decoding module, an unconscious module, a conscious module and an output layer; wherein the content of the first and second substances,
the input layer is respectively connected with the rational path decoding module and the unconscious module and is used for inputting a given natural language question;
the output end of the reasoning path decoding module is respectively connected with the unconsciousness module and the conscious module, the rational path decoding module receives the given natural language problem transmitted by the input layer and outputs each selected score in each step of the reasoning path obtained by decoding the given natural language problem;
the unconsciousness module is sequentially connected with the consciousness module and the output layer, the input of the unconsciousness module is the output of a given natural language question, a knowledge graph and an inference path decoding module, and the output of the unconsciousness module is the score of each candidate answer entity;
the input of the conscious module is given natural language question, knowledge graph, the output of the reasoning path decoding module and the output of the unconscious module, and the output is the final score of each candidate answer entity;
and the output layer is used for outputting the final score of each candidate answer entity obtained by the conscious module.
3. The cognitive inference based knowledge graph multi-hop question-answering method according to claim 2,
the inference path decoding module adopts a coder-decoder model;
the unconsciousness module adopts a semantic matching model based on the vector inner product;
the conscious module employs a Bayesian network-based path inference model.
4. The cognitive inference based knowledge graph multi-hop question-answering method according to claim 2 or 3, wherein the unconsciousness module of the deep cognitive inference network model scores each candidate answer entity by semantic matching, and the score of the candidate answer entity e is calculated by the following formula (1):
in the formula (1), the first and second groups of the compound,representing a query vector derived based on a natural language question q,the following calculation is obtained by the formula (2):
in the formula (2), the symbol O represents the multiplication between elements, o(i)And representing the output of the ith step in an inference path decoding module of the deep cognitive inference network model.
5. The knowledge graph multi-hop question-answering method based on cognitive inference according to claim 2 or 3, wherein a conscious module of the deep cognitive inference network model carries out sequential inference by using a Bayesian network based on scores output by the unconscious module to obtain a final score of each candidate answer entity.
6. The cognitive inference based knowledge graph multi-hop question-answering method according to claim 5, wherein the specific processing steps of the conscious module are as follows:
(a) cutting a knowledge graph: with a subject entity etopicE epsilon as a reasoning starting point, searching a corresponding answer entity of a natural language question q from a given knowledge graph g by using an breadth-first search algorithm, and obtaining a directed acyclic graph consisting of accessed edges as a clipped knowledge graph
(b) The cut knowledge map isConversion to a Bayesian network Andthe graph structures of the two are the same, and the definition of the nodes and the edges of the two are respectively as follows:
(c) reasoning is carried out based on the Bayesian network: based on the Bayesian network obtained in the step (b)The modeling knowledge graph multi-hop question-answering is as follows:
from the properties of the bayesian network, the following results are derived:
modeling the probability equation (4) in the above manner:
in the above formula (5), fs(e) Is the score of the unconscious module output, fb(e) Is the scoring result of the candidate entity e calculated by the conscious module, fb(e) Calculated by the following equation (6):
7. the cognitive inference based knowledge graph multi-hop question-answering method according to claim 2 or 3, wherein the loss function of the deep layer cognitive inference network model is as follows:
8. A knowledge graph multi-hop question-answer model based on cognitive inference is characterized by comprising the following steps:
the device comprises an input layer, an inference path decoding module, an unconscious module, a conscious module and an output layer; wherein the content of the first and second substances,
the input layer is respectively connected with the rational path decoding module and the unconscious module and is used for inputting a given natural language question;
the output end of the reasoning path decoding module is respectively connected with the unconsciousness module and the conscious module, the rational path decoding module receives the given natural language problem transmitted by the input layer and outputs each selected score in each step of the reasoning path obtained by decoding the given natural language problem;
the unconsciousness module is sequentially connected with the consciousness module and the output layer, the input of the unconsciousness module is the output of a given natural language question, a knowledge graph and an inference path decoding module, and the output of the unconsciousness module is the score of each candidate answer entity;
the input of the conscious module is given natural language question, knowledge graph, the output of the reasoning path decoding module and the output of the unconscious module, and the output is the final score of each candidate answer entity;
and the output layer is used for outputting the final score of each candidate answer entity obtained by the conscious module.
9. The cognitive inference based knowledge-graph multi-hop question-answer model of claim 8,
the inference path decoding module adopts a coder-decoder model;
the unconsciousness module adopts a semantic matching model based on the vector inner product;
the conscious module employs a Bayesian network-based path inference model.
10. The cognitive inference based knowledge graph multi-hop question-answering method according to claim 8 or 9, wherein the unconsciousness module of the deep cognitive inference network model scores each candidate answer entity by semantic matching, and the score of the candidate answer entity e is calculated by the following formula (1):
in the formula (1), the first and second groups of the compound,representing a query vector derived based on a natural language question q,the following calculation is obtained by the formula (2):
in the formula (2), the symbol O represents the multiplication between elements, o(i)Representing the output of the ith step in an inference path decoding module of the deep cognitive inference network model;
and the conscious module of the deep cognitive inference network model carries out sequential inference by using a Bayesian network based on the score output by the unconscious module to obtain the final score of each candidate answer entity.
11. The cognitive inference based knowledge graph multi-hop question-answer model according to claim 10, wherein the specific processing steps of the conscious module are as follows:
(a) cutting a knowledge graph: with a subject entity etopicE epsilon as a reasoning starting point, searching a corresponding answer entity of a natural language question q from a given knowledge graph g by using an breadth-first search algorithm, and obtaining a directed acyclic graph consisting of accessed edges as a clipped knowledge graph
(b) The cut knowledge map isConversion to a Bayesian network Andthe graph structures of the two are the same, and the definition of the nodes and the edges of the two are respectively as follows:
(c) reasoning is carried out based on the Bayesian network: based on the Bayesian network obtained in the step (b)The modeling knowledge graph multi-hop question-answering is as follows:
from the properties of the bayesian network, the following results are derived:
modeling the probability equation (4) in the above manner:
in the above formula (5), fs(e) Is the score of the unconscious module output, fb(e) Is the scoring result of the candidate entity e calculated by the conscious module, fb(e) Calculated by the following equation (6):
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110697004.XA CN113360604B (en) | 2021-06-23 | 2021-06-23 | Knowledge graph multi-hop question-answering method and model based on cognitive reasoning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110697004.XA CN113360604B (en) | 2021-06-23 | 2021-06-23 | Knowledge graph multi-hop question-answering method and model based on cognitive reasoning |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113360604A true CN113360604A (en) | 2021-09-07 |
CN113360604B CN113360604B (en) | 2024-02-27 |
Family
ID=77535794
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110697004.XA Active CN113360604B (en) | 2021-06-23 | 2021-06-23 | Knowledge graph multi-hop question-answering method and model based on cognitive reasoning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113360604B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113849613A (en) * | 2021-09-15 | 2021-12-28 | 北方工业大学 | Food safety question-answer reasoning method, system and electronic equipment |
CN114925190A (en) * | 2022-05-30 | 2022-08-19 | 南瑞集团有限公司 | Mixed inference method based on rule inference and GRU neural network inference |
CN115964459A (en) * | 2021-12-28 | 2023-04-14 | 北方工业大学 | Multi-hop inference question-answering method and system based on food safety cognitive map |
CN116822633A (en) * | 2023-08-31 | 2023-09-29 | 清华大学 | Model reasoning method and device based on self-cognition and electronic equipment |
CN117493582A (en) * | 2023-12-29 | 2024-02-02 | 珠海格力电器股份有限公司 | Model result output method and device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020237856A1 (en) * | 2019-05-29 | 2020-12-03 | 平安科技(深圳)有限公司 | Smart question and answer method and apparatus based on knowledge graph, and computer storage medium |
CN112380325A (en) * | 2020-08-15 | 2021-02-19 | 电子科技大学 | Knowledge graph question-answering system based on joint knowledge embedded model and fact memory network |
-
2021
- 2021-06-23 CN CN202110697004.XA patent/CN113360604B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020237856A1 (en) * | 2019-05-29 | 2020-12-03 | 平安科技(深圳)有限公司 | Smart question and answer method and apparatus based on knowledge graph, and computer storage medium |
CN112380325A (en) * | 2020-08-15 | 2021-02-19 | 电子科技大学 | Knowledge graph question-answering system based on joint knowledge embedded model and fact memory network |
Non-Patent Citations (1)
Title |
---|
张莹莹;钱胜胜;方全;徐常胜;: "基于多模态知识感知注意力机制的问答方法", 计算机研究与发展, no. 05 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113849613A (en) * | 2021-09-15 | 2021-12-28 | 北方工业大学 | Food safety question-answer reasoning method, system and electronic equipment |
CN115964459A (en) * | 2021-12-28 | 2023-04-14 | 北方工业大学 | Multi-hop inference question-answering method and system based on food safety cognitive map |
CN115964459B (en) * | 2021-12-28 | 2023-09-12 | 北方工业大学 | Multi-hop reasoning question-answering method and system based on food safety cognition spectrum |
CN114925190A (en) * | 2022-05-30 | 2022-08-19 | 南瑞集团有限公司 | Mixed inference method based on rule inference and GRU neural network inference |
CN114925190B (en) * | 2022-05-30 | 2023-08-04 | 南瑞集团有限公司 | Mixed reasoning method based on rule reasoning and GRU neural network reasoning |
CN116822633A (en) * | 2023-08-31 | 2023-09-29 | 清华大学 | Model reasoning method and device based on self-cognition and electronic equipment |
CN116822633B (en) * | 2023-08-31 | 2023-12-26 | 清华大学 | Model reasoning method and device based on self-cognition and electronic equipment |
CN117493582A (en) * | 2023-12-29 | 2024-02-02 | 珠海格力电器股份有限公司 | Model result output method and device, electronic equipment and storage medium |
CN117493582B (en) * | 2023-12-29 | 2024-04-05 | 珠海格力电器股份有限公司 | Model result output method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113360604B (en) | 2024-02-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113360604B (en) | Knowledge graph multi-hop question-answering method and model based on cognitive reasoning | |
CN113239181B (en) | Scientific and technological literature citation recommendation method based on deep learning | |
CN109844743B (en) | Generating responses in automated chat | |
CN111241294B (en) | Relationship extraction method of graph convolution network based on dependency analysis and keywords | |
CN109977201A (en) | Machine chat method, device, computer equipment and storage medium with emotion | |
Xiong et al. | Knowledge graph question answering with semantic oriented fusion model | |
CN107590139B (en) | Knowledge graph representation learning method based on cyclic matrix translation | |
CN115964459B (en) | Multi-hop reasoning question-answering method and system based on food safety cognition spectrum | |
Wang et al. | Direction-sensitive relation extraction using bi-sdp attention model | |
CN111639254A (en) | System and method for generating SPARQL query statement in medical field | |
Zhang et al. | A contrastive learning-based task adaptation model for few-shot intent recognition | |
Narayan et al. | Deep learning approaches to text production | |
CN105956158A (en) | Automatic extraction method of network neologism on the basis of mass microblog texts and use information | |
Aakur et al. | Leveraging symbolic knowledge bases for commonsense natural language inference using pattern theory | |
Zhang et al. | Aspect-level sentiment analysis via a syntax-based neural network | |
US20240143940A1 (en) | Architecture for generating qa pairs from contexts | |
Ebert et al. | Lamb: A good shepherd of morphologically rich languages | |
CN114579605B (en) | Table question-answer data processing method, electronic equipment and computer storage medium | |
CN116467466A (en) | Knowledge graph-based code recommendation method, device, equipment and medium | |
CN116010621A (en) | Rule-guided self-adaptive path generation method | |
Liu et al. | Neural belief propagation for scene graph generation | |
CN114282497A (en) | Method and system for converting text into SQL | |
Ding et al. | Reasoning chain based adversarial attack for multi-hop question answering | |
Hu et al. | An improved algorithm of word similarity computation based on HowNet | |
Chen et al. | Llama-lora neural prompt engineering: A deep tuning framework for automatically generating chinese text logical reasoning thinking chains |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |