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 PDF

Info

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
Application number
CN202110697004.XA
Other languages
Chinese (zh)
Other versions
CN113360604B (en
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.)
University of Science and Technology of China USTC
Original Assignee
University of Science and Technology of China USTC
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 University of Science and Technology of China USTC filed Critical University of Science and Technology of China USTC
Priority to CN202110697004.XA priority Critical patent/CN113360604B/en
Publication of CN113360604A publication Critical patent/CN113360604A/en
Application granted granted Critical
Publication of CN113360604B publication Critical patent/CN113360604B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • 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/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • 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/3331Query processing
    • G06F16/334Query execution
    • G06F16/3346Query execution using probabilistic model
    • 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
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N7/00Computing arrangements based on specific mathematical models
    • G06N7/01Probabilistic 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

Knowledge graph multi-hop question-answering method and model based on cognitive inference
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:
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 given 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.
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:
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 given 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.
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:
Figure BDA0003128892800000041
in the formula (1), the first and second groups of the compound,
Figure BDA0003128892800000042
representing a query vector derived based on a natural language question q,
Figure BDA0003128892800000043
the following is calculated by formula 2:
Figure BDA0003128892800000044
in said formula 2, symbols
Figure BDA00031288928000000411
Denotes 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 graph
Figure BDA0003128892800000046
Searching 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
Figure BDA0003128892800000047
(b) The cut knowledge map is
Figure BDA0003128892800000048
Conversion to a Bayesian network
Figure BDA0003128892800000049
And
Figure BDA00031288928000000410
the graph structures of the two are the same, and the definition of the nodes and the edges of the two are respectively as follows:
Figure BDA0003128892800000045
Figure BDA0003128892800000051
(c) reasoning is carried out based on the Bayesian network: based on the Bayesian network obtained in the step (b)
Figure BDA00031288928000000511
The modeling knowledge graph multi-hop question-answering is as follows:
Figure BDA00031288928000000512
this conditional probability is expressed in a given knowledge graph
Figure BDA00031288928000000513
Question 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:
Figure BDA0003128892800000052
where pa (e) represents a set of parent nodes of entity (node) e in the knowledge-graph
In the formula (3), the first and second groups,
Figure BDA0003128892800000053
is defined as:
Figure BDA0003128892800000054
modeling the probability equation (4) in the above manner:
Figure BDA0003128892800000055
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):
Figure BDA0003128892800000056
wherein for any relation riWhose weight is calculated as
Figure BDA0003128892800000057
In the method, the loss function of the deep cognitive inference network model is as follows:
Figure BDA0003128892800000058
in the above-mentioned formula (7),
Figure BDA0003128892800000059
| epsilon | represents the entity set size,
Figure BDA00031288928000000510
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:
Figure BDA0003128892800000061
in the formula (1), the first and second groups of the compound,
Figure BDA0003128892800000062
representing a query vector derived based on a natural language question q,
Figure BDA0003128892800000063
the following is calculated by formula 2:
Figure BDA0003128892800000064
in said formula 2, symbols
Figure BDA00031288928000000611
Denotes 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 graph
Figure BDA0003128892800000066
Searching 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
Figure BDA0003128892800000067
(b) The cut knowledge map is
Figure BDA0003128892800000068
Conversion to a Bayesian network
Figure BDA0003128892800000069
And
Figure BDA00031288928000000610
the graph structures of the two are the same, and the definition of the nodes and the edges of the two are respectively as follows:
Figure BDA0003128892800000065
(c) reasoning is carried out based on the Bayesian network: based on the Bayesian network obtained in the step (b)
Figure BDA0003128892800000077
The modeling knowledge graph multi-hop question-answering is as follows:
Figure BDA0003128892800000071
from the properties of the bayesian network, the following results are derived:
Figure BDA0003128892800000072
in the formula (3), the first and second groups,
Figure BDA0003128892800000073
is defined as:
Figure BDA0003128892800000074
modeling the probability equation (4) in the above manner:
Figure BDA0003128892800000075
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):
Figure BDA0003128892800000076
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:
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; the deep cognitive inference network model adopts the knowledge graph multi-hop question-and-answer model based on the cognitive inference;
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 as
Figure BDA0003128892800000081
Where epsilon represents the set of entities,
Figure BDA0003128892800000082
a set of relationships is represented that is,
Figure BDA0003128892800000083
a set of triples is represented.
The knowledge-graph multi-hop question-answer of the present invention (see fig. 2): from a given knowledge-graph
Figure BDA0003128892800000084
With subject entity e as the origin of reasoningtopicE epsilon, and predicting to obtain a correct answer e of the natural language question q*
Figure BDA0003128892800000085
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:
Figure BDA0003128892800000091
wherein
Figure BDA0003128892800000092
The weight representing the ith relationship is calculated by the following formula:
Figure BDA0003128892800000093
wherein the content of the first and second substances,
Figure BDA0003128892800000094
Figure BDA0003128892800000095
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:
Figure BDA0003128892800000096
wherein the content of the first and second substances,
Figure BDA0003128892800000097
represents a query (query) vector obtained based on the problem q, which is calculated as follows:
Figure BDA0003128892800000098
wherein, the symbol
Figure BDA00031288928000001018
Denotes 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 graph
Figure BDA0003128892800000106
A 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 graph
Figure BDA0003128892800000109
Searching, only reserving visited edges (edge) in the graph, and finally obtaining the cut knowledge graph
Figure BDA0003128892800000108
The graph is a Directed Acyclic Graph (DAG);
(b) the cut knowledge map is
Figure BDA00031288928000001010
Conversion into a Bayesian network, for use in the converted Bayesian network
Figure BDA00031288928000001011
It is shown that,
Figure BDA00031288928000001012
and
Figure BDA00031288928000001013
the 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;
TABLE 1 shows
Figure BDA00031288928000001014
And
Figure BDA00031288928000001015
is distinguished by
Figure BDA0003128892800000101
(c) Bayesian network-based
Figure BDA00031288928000001016
Reasoning is carried out: based on step (b)Resulting Bayesian networks
Figure BDA00031288928000001017
The knowledge graph multi-hop question-answering is modeled in the following way:
Figure BDA0003128892800000102
from the properties of the bayesian network, the following results are derived:
Figure BDA00031288928000001019
wherein the content of the first and second substances,
Figure BDA0003128892800000103
is defined as:
Figure BDA0003128892800000104
the above probability formula is modeled using the following:
Figure BDA0003128892800000105
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:
Figure BDA0003128892800000111
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
Figure BDA0003128892800000112
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:
Figure BDA0003128892800000113
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 graph
Figure BDA0003128892800000114
A question q and a topic entity (reasoning starting point) etopicE epsilon, and correct answer set
Figure BDA0003128892800000115
The goal of the training process is to minimize the following loss function (the two-class cross-entropy loss function):
Figure BDA0003128892800000121
wherein the content of the first and second substances,
Figure BDA0003128892800000122
(2) and (3) a testing stage:
at the time of testing, for a given knowledge-graph
Figure BDA0003128892800000124
A question q and a topic entity (reasoning starting point) etopicE epsilon, the DCRN scores each candidate entity e:
Figure BDA0003128892800000123
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):
Figure FDA0003128892790000021
in the formula (1), the first and second groups of the compound,
Figure FDA0003128892790000022
representing a query vector derived based on a natural language question q,
Figure FDA0003128892790000023
the following calculation is obtained by the formula (2):
Figure FDA0003128892790000024
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
Figure FDA0003128892790000025
(b) The cut knowledge map is
Figure FDA0003128892790000026
Conversion to a Bayesian network
Figure FDA00031288927900000213
Figure FDA00031288927900000214
And
Figure FDA0003128892790000027
the graph structures of the two are the same, and the definition of the nodes and the edges of the two are respectively as follows:
Figure FDA0003128892790000028
(c) reasoning is carried out based on the Bayesian network: based on the Bayesian network obtained in the step (b)
Figure FDA00031288927900000215
The modeling knowledge graph multi-hop question-answering is as follows:
Figure FDA0003128892790000029
from the properties of the bayesian network, the following results are derived:
Figure FDA00031288927900000210
in the formula (3), the first and second groups,
Figure FDA00031288927900000211
is defined as:
Figure FDA00031288927900000212
modeling the probability equation (4) in the above manner:
Figure FDA0003128892790000031
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):
Figure FDA0003128892790000032
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:
Figure FDA0003128892790000033
in the above-mentioned formula (7),
Figure FDA0003128892790000034
| epsilon | represents the entity set size,
Figure FDA0003128892790000035
representing the answer set size.
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):
Figure FDA0003128892790000041
in the formula (1), the first and second groups of the compound,
Figure FDA0003128892790000042
representing a query vector derived based on a natural language question q,
Figure FDA0003128892790000043
the following calculation is obtained by the formula (2):
Figure FDA0003128892790000044
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
Figure FDA0003128892790000045
(b) The cut knowledge map is
Figure FDA0003128892790000046
Conversion to a Bayesian network
Figure FDA00031288927900000413
Figure FDA00031288927900000414
And
Figure FDA0003128892790000047
the graph structures of the two are the same, and the definition of the nodes and the edges of the two are respectively as follows:
Figure FDA0003128892790000048
(c) reasoning is carried out based on the Bayesian network: based on the Bayesian network obtained in the step (b)
Figure FDA00031288927900000415
The modeling knowledge graph multi-hop question-answering is as follows:
Figure FDA0003128892790000049
from the properties of the bayesian network, the following results are derived:
Figure FDA00031288927900000410
in the formula (3), the first and second groups,
Figure FDA00031288927900000411
is defined as:
Figure FDA00031288927900000412
modeling the probability equation (4) in the above manner:
Figure FDA0003128892790000051
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):
Figure FDA0003128892790000052
CN202110697004.XA 2021-06-23 2021-06-23 Knowledge graph multi-hop question-answering method and model based on cognitive reasoning Active CN113360604B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
张莹莹;钱胜胜;方全;徐常胜;: "基于多模态知识感知注意力机制的问答方法", 计算机研究与发展, no. 05 *

Cited By (9)

* Cited by examiner, † Cited by third party
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