A multi-hop question and answer method and system
By combining language models and graph neural network logical expressions, the multi-hop question answering method in domain knowledge graphs is optimized, solving the problem of inaccurate candidate entity recognition and achieving more accurate answer output and interpretable logical path expression.
Patent Information
- Application Number
- CN202311190827.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-14
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-09-14
AI Technical Summary
Existing technologies for multi-hop question answering using knowledge graphs suffer from complex long-path reasoning problems and low answer accuracy, especially in domain knowledge graphs, where proprietary entity names and similar entity representations lead to inaccurate candidate entity identification.
By combining language models and graph neural network logical expressions, multi-hop paths are queried from the domain knowledge graph, and text similarity and graph neural network embedding techniques are used to optimize entity recognition and logical expression, thereby improving the accuracy of the answer.
It improves the accuracy of answers to domain-specific questions, provides interpretable logical path expressions, solves the problem of inaccurate candidate entity recognition, and enhances the accuracy of multi-hop question answering.
Smart Images

Figure CN117194636B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a multi-hop question-answering method and system. Background Technology
[0002] In recent years, with the rapid development of natural language processing, language models have achieved good results in question answering by utilizing information within knowledge graphs. Knowledge graphs typically consist of a graph structure containing nodes and edges. Nodes represent entities, and edges represent relationships between entities. Information in knowledge graphs is generally stored in triples, such as: Hangzhou, located in, Zhejiang Province.
[0003] Question answering systems can acquire relevant knowledge from knowledge graphs and perform reasoning on them. Typically, knowledge can be implicitly encoded in large language models (LMs) pre-trained on unstructured text, or explicitly represented in structured knowledge graphs (KGs). Recently, pre-trained LMs have shown significant success in many question answering tasks. However, despite their broad knowledge coverage, learning strategies have not performed well empirically in structured reasoning (e.g., handling negation). On the other hand, KGs are better suited for structured reasoning and enable interpretable predictions, such as by providing reasoning paths, but may lack coverage of unknown knowledge and robustness. How to effectively utilize these two knowledge sources for reasoning remains an important unresolved issue.
[0004] Knowledge graph question answering technology utilizes triples within a knowledge graph to answer relevant natural language questions. Multi-hop question answering, in particular, requires combining multiple triples within the knowledge graph to arrive at the answer. General knowledge graph multi-hop question answering suffers from complex long-path reasoning and an exponentially increasing number of candidate entities with each hop, leading to low accuracy. For domain-specific knowledge graphs, these problems are compounded by proprietary entity names and similar entity representations, further complicating accurate identification of candidate entities during path reasoning. Therefore, domain-specific knowledge graphs require models with even higher accuracy in identifying candidate entities. Developing an interpretable and accurate multi-hop question answering method for domain-specific knowledge graphs that accurately identifies candidate entities is a current challenge. Summary of the Invention
[0005] This application provides a multi-hop question answering method and system that combines logical expressions obtained by language models and graph neural networks. The language model improves the distinguishability of entities in the domain knowledge graph, while the graph neural network has its own advantages. The two complement each other, making the answers to domain questions more accurate.
[0006] This application provides a multi-hop question-answering method, including:
[0007] Query all entities and their corresponding relationships within a preset number of hops related to the entities in the problem from the domain knowledge graph to form multiple multi-hop paths;
[0008] Based on all entities and their corresponding relationships, obtain the text similarity between the question and each multi-hop path and the corresponding first text-based logical expression;
[0009] Based on all entities and their corresponding relationships, obtain a logical expression based on a graph neural network;
[0010] By combining the first text-based logical expression and the graph neural network-based logical expression, the answer to the question is obtained.
[0011] Preferably, the text similarity between the question and each multi-hop path and the corresponding first text-based logical expression are obtained based on all entities and their corresponding relationships, specifically including:
[0012] The text-based logical expression corresponding to each multi-hop path is concatenated with the question to obtain multiple first concatenated texts;
[0013] Input multiple first concatenated texts into the text scoring model to obtain the similarity between the question and each multi-hop path;
[0014] Output the maximum similarity of a preset number of values and its corresponding first text-based logical expression.
[0015] Preferably, a logical expression based on a graph neural network is obtained based on all entities and their corresponding relationships, specifically including:
[0016] Extract all entities and their corresponding triples from the relationships to form a knowledge graph subgraph;
[0017] The embedding of the output node of each multi-hop path in the knowledge graph subgraph is obtained using a graph encoder;
[0018] The graph decoder is used to decode the embeddings of the output nodes of the multi-hop path into path information, thereby obtaining the logical expression based on the graph neural network corresponding to the multi-hop path.
[0019] Preferably, the embedding of the output node of the multi-hop path is obtained based on the attention mechanism.
[0020] Preferably, the answer to the question is obtained by combining the first text-based logical expression and the graph neural network-based logical expression, specifically including:
[0021] Each graph neural network-based logical expression is concatenated with a preset number of first text-based logical expressions to obtain a preset number of second concatenated texts.
[0022] Input all the second concatenated texts into the text scoring model to obtain the second concatenated text with the highest similarity.
[0023] The output node corresponding to the graph neural network-based logical expression in the second concatenated text with the highest similarity is used as the answer to the question.
[0024] This application also provides a multi-hop question-answering system, including a query module, a first text parsing module, a graph parsing module, and a second text parsing module;
[0025] The query module is used to query all entities and their corresponding relationships within a preset number of hops related to the entities in the problem from the domain knowledge graph, forming multiple multi-hop paths;
[0026] The first text parsing module is used to obtain the text similarity between the question and each multi-hop path and the corresponding first text-based logical expression based on all entities and their corresponding relationships;
[0027] The graph parsing module is used to obtain a logical expression based on a graph neural network, based on all entities and their corresponding relationships.
[0028] The second text parsing module combines the first text-based logical expression and the graph neural network-based logical expression to obtain the answer to the question.
[0029] Preferably, the first text parsing module includes a first concatenation module, a first similarity acquisition module, and an output module;
[0030] The first concatenation module is used to concatenate the text-based logical expression corresponding to each multi-hop path with the question to obtain multiple first concatenation texts;
[0031] The first similarity acquisition module is used to input multiple first concatenated texts into the text scoring model to obtain the similarity between the question and each multi-hop path;
[0032] The output module is used to output a preset number of maximum similarities and their corresponding first text-based logical expressions.
[0033] Preferably, the graph parsing module includes a subgraph construction module, an encoding module, and a decoding module;
[0034] The subgraph building module is used to extract triples from all entities and their corresponding relations to form knowledge graph subgraphs;
[0035] The encoding module is used to obtain the embedding of the output node of each multi-hop path in the knowledge graph subgraph using the graph encoder;
[0036] The decoding module is used to decode the embeddings of the output nodes of the multi-hop path into path information using a graph decoder, and obtain the logical expression based on the graph neural network corresponding to the multi-hop path.
[0037] Preferably, the encoding module is used to obtain the embedding of the output node of the multi-hop path based on the attention mechanism.
[0038] Preferably, the second text parsing module includes a second concatenation module, a second similarity acquisition module, and an answer determination module;
[0039] The second concatenation module is used to concatenate each graph neural network-based logical expression with a preset number of first text-based logical expressions to obtain a preset number of second concatenated texts.
[0040] The second similarity acquisition module is used to input all the second concatenated texts into the text scoring model to obtain the second text-based logical expression with the highest similarity to the graph neural network-based logical expression;
[0041] The answer determination module is used to select the output node corresponding to the graph neural network-based logical expression in the second concatenated text with the highest similarity as the answer to the question.
[0042] Other features and advantages of this application will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0043] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the present application and, together with their description, serve to explain the principles of the present application.
[0044] Figure 1 A flowchart of the multi-hop question-answering method provided in this application;
[0045] Figure 2 A flowchart for obtaining the text similarity between the problem and each multi-hop path and the corresponding first text-based logical expression provided in this application;
[0046] Figure 3 A flowchart for obtaining a graph neural network-based logical expression provided in this application;
[0047] Figure 4 A flowchart for obtaining the answer to a question by combining a first text-based logical expression and a graph neural network-based logical expression, as provided in this application;
[0048] Figure 5 This is a structural diagram of the multi-hop question-answering system provided in this application. Detailed Implementation
[0049] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0050] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.
[0051] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the specification.
[0052] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0053] This application provides a multi-hop question answering method and system that combines logical expressions obtained by language models and graph neural networks. The language model improves the distinguishability of entities in the domain knowledge graph, while the graph neural network has its own advantages. The two complement each other, making the answers to domain questions more accurate.
[0054] like Figure 1 As shown, the multi-hop question-answering method provided in this application includes:
[0055] S110: Query all entities and their corresponding relationships within a preset number of hops related to the entities in the problem from the domain knowledge graph to form multiple multi-hop paths.
[0056] It should be noted that the problem is a natural language problem related to domain knowledge. After the entities in the problem are identified through an entity recognition task, they are input into the domain knowledge graph. The domain knowledge graph queries all entity relationships within a preset hop count range (e.g., K) related to the problem, forming multiple multi-hop paths, thus creating a set of candidate entities and relationship paths.
[0057] As an example, these multi-hop paths are represented by text-based logical expressions in the form of S-expressions.
[0058] S120: Based on all entities and their corresponding relationships, obtain the text similarity between the question and each multi-hop path and the corresponding first text-based logical expression.
[0059] As an example, such as Figure 2 As shown, based on all entities and their corresponding relationships, the text similarity between the question and each multi-hop path, and the corresponding first text-based logical expression, are obtained, specifically including:
[0060] S210: Concatenate each multi-hop path with the question to obtain multiple first concatenated texts. The first concatenated texts include the question and the text-based logical expression corresponding to the multi-hop path. The specific form is: [CLS] + question + [SEP] + text-based logical expression.
[0061] S220: Input multiple concatenated first texts into the text scoring model to obtain the similarity s(x,y) between the question and each multi-hop path:
[0062] s(x,y)=Linear(BertCLS([x;y])) (1)
[0063] Here, BertCLS represents the representation of the first concatenated text of the input, x represents the question, y represents the multi-hop path, and Linear is a projection layer that reduces the representation to a scalar similarity score.
[0064] As an example, the text scoring model is a pre-trained BERT model.
[0065] S230: Output the maximum similarity of a preset number of values and its corresponding first text-based logical expression.
[0066] Specifically, the text-based logical expression in the first concatenated text with the highest similarity is taken as the first text-based logical expression.
[0067] S130: Obtain a logical expression based on a graph neural network based on all entities and their corresponding relationships.
[0068] As an example, such as Figure 3 As shown, a logical expression based on a graph neural network is obtained based on all entities and their corresponding relationships, specifically including:
[0069] S310: Extract the triples from all the entities and their corresponding relations to form a knowledge graph subgraph, and define the set of all multi-hop paths formed by the triples as Φ. k :
[0070] Φ k ={(j,r1,…,r k ,i)|(j,r1,j1)…,(j k-1 ,r k ,i)∈ε}(1≤k≤K) (2)
[0071] Where j represents the head entity of the multi-hop path, i represents the tail entity of the multi-hop path, j1, j k-1 Represents intermediate entities in a multi-hop path, "r1,...,r k"" represents the relationship between entities in each hop of a multi-hop path, and K represents the number of hops in the multi-hop path.
[0072] S320: Use a graph encoder to obtain the embedding of the output node of each multi-hop path in the knowledge graph subgraph.
[0073] Preferably, the embedding of the output node of the knowledge graph subgraph is obtained based on the attention mechanism. A graph neural network framework is used, firstly, the input node features undergo a linear transformation of node type, then the attention scores of all relational path information of length K are combined, and the information transmitted by different relational paths is aggregated through the attention mechanism. Finally, the embedding of the output node is obtained through residual connections and a non-linear activation function. Specifically, this includes:
[0074] S3201: Based on the attention mechanism, aggregate information of different lengths along multi-hop paths in a knowledge graph subgraph to obtain aggregated information z. i .
[0075] First, in order for the graph encoder to recognize the type φ (including question entities and answer entities) of nodes in the knowledge graph subgraph, a linear transformation corresponding to the type of the node is performed on the node features of the input nodes of the knowledge graph subgraph to obtain the node representation x after linear transformation. i :
[0076] x i =U φ(i) h i +b φ(i) (3)
[0077] Where, x i h is the node representation of the i-th input node. i For the node features of the i-th input node, U φ(i) and b φ(i) φ(i) is a learnable parameter corresponding to the type of the i-th input node, where φ(i) is the node type of the i-th input node.
[0078] Secondly, to enable the graph encoder to directly model paths, nodes pass information on all relational paths (each hop corresponds to one relational path) on a multi-hop path of length K, obtaining the attention score for each relational path.
[0079]
[0080] in, This represents the attention score on the relation path of the k-th hop in the l-th multi-hop path. This represents a filled matrix, a matrix These are learnable parameters, matrices This represents the {m×L×m} that is assigned to each k-hop relation as a separate transformation. k A low-order approximation of the ×d×d tensor, where d represents the node representation of the input node x in the relation path. j The dimension, m represents the number of association types, α(j,r1,…,r) k ,i)=p(φ(j),r1,…,r k φ(i)|s) denotes the structural attention score, s denotes the embedding of the text question, and p denotes the relation sequence (φ(j), r1,…,r) based on s. k The conditional probability of φ(i)). It is the normalization factor.
[0081] Subsequently, the transmission information on paths of different lengths within the multi-hop path is aggregated to obtain the aggregation information z of that multi-hop path. l :
[0082]
[0083] Where bilinear represents a bilinear layer, z l Let represent the aggregation information of the l-th multi-hop path, and s represent the embedding of the text question.
[0084] S3202: By using residual connections and nonlinear activation functions, the embedding of the output node of the multi-hop path is obtained based on the node features of the input nodes and the aggregation information of the multi-hop path.
[0085] h′ l =σ(Vh l +V′z l (6)
[0086] Where V and V′ are learnable model parameters, σ is a nonlinear activation function, and h′ is a nonlinear activation function. l h represents the embedding of the output node of the l-th multi-hop path. l This represents the node features of the input node of the l-th multi-hop path.
[0087] S330: Utilize a graph decoder to decode the embeddings of the output nodes of the multi-hop path into path information, obtaining the graph neural network-based logical expression s corresponding to the multi-hop path. g .
[0088] As an example, the embeddings of the output node are decoded using structural attention scores. g :
[0089] s g =argmax(α(j,r1,…,r) k ,i)) (7)
[0090] Therefore, it can be seen that the above steps can be used to obtain the set Φ. k The embedding of output nodes corresponding to all multi-hop paths.
[0091] S140: Combine the first text-based logical expression and the graph neural network-based logical expression to obtain the answer to the question.
[0092] As an example, such as Figure 4 As shown, by combining the first text-based logical expression and the graph neural network-based logical expression, the answer to the question is obtained, specifically including:
[0093] S410: Concatenate each graph neural network-based logical expression with a preset number of first text-based logical expressions to obtain the second concatenated text.
[0094] Taking a preset quantity of 3 as an example, the first text-based logical expression for the top 3 is as follows: The second concatenated text is in the form of
[0095] S420: Input all second concatenated texts into the text scoring model to obtain the second concatenated text with the highest similarity.
[0096] It should be noted that the text scoring model here is the same as the text scoring model in S220. The similarity obtained in this step is the similarity between the first text-based logical expression and the graph neural network-based logical expression. The output s0 of the text scoring model in this step is represented as:
[0097]
[0098] Where η(·) represents the similarity score of the text scoring model, thus combining the two forms of logical paths using the text scoring model.
[0099] S430: Use the output node corresponding to the graph neural network-based logical expression in the second concatenated text with the highest similarity as the answer to the question.
[0100] Based on the above, this application implements multi-hop question answering using a multi-hop question answering model. This model includes three components: a text scoring model, a graph encoder, and a graph decoder. During training, the entire model is trained using a given question-answer pair training set, with the goal of minimizing the corresponding loss function. After training, a natural language question is used as input to the multi-hop question answering model, enabling the model to output the answer to the question.
[0101] In training the text scoring model, for each input question, the system queries the domain knowledge graph for all entity relationships within a preset hop count range related to the question, constructing multiple first multi-hop paths. These first multi-hop paths are used as positive examples, while second multi-hop paths composed of randomly selected entities and relationships are used as negative examples. Then, all positive and negative examples are concatenated with the question, and the concatenated text is input into the BERT model. The model learns by comparing the similarity between the positive and negative examples and the question, strengthening its ability to distinguish between correct and incorrect logical forms. The specific loss function L... s as follows:
[0102]
[0103] This maximizes the similarity between the problem and positive examples, and minimizes the similarity between the problem and negative examples, in order to achieve more accurate and superior problem logic extraction.
[0104] For graph encoders, during training, the graph representation g is obtained by embedding the answer entity a∈C into an attention pool. a Then it is compared with the problem representation s in the language model. q Connect, and through To calculate the likelihood score, where MLP represents a multilayer perceptron. This represents a vector connection. During training, the cross-entropy loss L is minimized. g To maximize the correct answer Likelihood score:
[0105]
[0106] Where E represents the expectation and exp represents an exponential function with base e.
[0107] Based on the above-described multi-hop question-answering method, this application also provides a multi-hop question-answering system. For example... Figure 5 As shown, the multi-hop question-and-answer system includes a query module 510, a first text parsing module 520, a graph parsing module 530, and a second text parsing module 540.
[0108] The query module 510 is used to query all entities and their corresponding relationships within a preset number of hops related to the entities in the problem from the domain knowledge graph, forming multiple multi-hop paths.
[0109] The first text parsing module 520 is used to obtain the text similarity between the question and each multi-hop path and the corresponding first text-based logical expression based on all entities and their corresponding relationships.
[0110] The graph parsing module 530 is used to obtain a logical expression based on a graph neural network based on all entities and their corresponding relationships.
[0111] The second text parsing module 540 is used to combine the first text-based logical expression and the graph neural network-based logical expression to obtain the answer to the question.
[0112] Preferably, the first text parsing module 520 includes a first splicing module 5201, a first similarity acquisition module 5202, and an output module 5203.
[0113] The first concatenation module 5201 is used to concatenate the text-based logical expression corresponding to each multi-hop path with the question to obtain multiple first concatenated texts.
[0114] The first similarity acquisition module 5202 is used to input multiple first concatenated texts into the text scoring model to obtain the similarity between the question and each multi-hop path.
[0115] The output module 5203 is used to output a preset number of maximum similarities and their corresponding first text-based logical expressions.
[0116] Preferably, the graph parsing module 530 includes a subgraph construction module 5301, an encoding module 5302, and a decoding module 5303.
[0117] The subgraph construction module 5301 is used to extract triples from all entities and their corresponding relations to form knowledge graph subgraphs.
[0118] The encoding module 5302 is used to obtain the embedding of the output node of each multi-hop path in the knowledge graph subgraph using a graph encoder.
[0119] The decoding module 5303 is used to decode the embedding of the output node of the multi-hop path into path information using a graph decoder, and obtain the logical expression based on the graph neural network corresponding to the multi-hop path.
[0120] Preferably, the encoding module 5302 is used to embed the output node of the multi-hop path based on the attention mechanism.
[0121] Preferably, the second text parsing module 540 includes a second splicing module 5401, a second similarity acquisition module 5402, and an answer determination module 5403.
[0122] The second splicing module 5401 is used to splice each graph neural network-based logical expression with a preset number of first text-based logical expressions to obtain a preset number of second spliced texts.
[0123] The second similarity acquisition module 5402 is used to input all the second concatenated texts into the text scoring model to obtain the second text-based logical expression with the highest similarity to the graph neural network-based logical expression.
[0124] The answer determination module 5403 is used to select the output node corresponding to the graph neural network-based logical expression in the second concatenated text with the highest similarity as the answer to the question.
[0125] This application utilizes both a language model and an attention-based graph neural network model, combining the outputs of the two models in the form of text similarity to obtain more accurate answers to domain questions. It solves the problem of inaccurate candidate entities caused by proper entity names and similar entity expressions in domain knowledge graphs, and provides interpretable logical path expressions.
[0126] While specific embodiments of this application have been described in detail by way of examples, those skilled in the art should understand that the above examples are for illustrative purposes only and are not intended to limit the scope of this application. Those skilled in the art should understand that modifications can be made to the above embodiments without departing from the scope and spirit of this application. The scope of this application is defined by the appended claims.
Claims
1. A multi-hop question-and-answer method, characterized in that, include: Query all entities and their corresponding relationships within a preset number of hops related to the entities in the problem from the domain knowledge graph to form multiple multi-hop paths; Based on all the entities and their corresponding relationships, obtain the text similarity between the question and each of the multi-hop paths, and the corresponding first text-based logical expression; Based on all the entities and their corresponding relationships, a logical expression based on a graph neural network is obtained; By combining the first text-based logical expression and the graph neural network-based logical expression, the answer to the question is obtained; Specifically, obtaining the logical expression based on the graph neural network based on all the entities and their corresponding relationships includes: Extract the triples from all entities and their corresponding relations to construct a knowledge graph subgraph, and define the set of all multi-hop paths formed by the triples as... : ; in, The head entity representing a multi-hop path. The tail entity represents a multi-hop path. This represents an intermediate entity in a multi-hop path. These represent the relationships between entities at each hop in a multi-hop path. Indicates the number of hops in a multi-hop path; Obtaining the embedding of the output node of each multi-hop path in the knowledge graph subgraph using a graph encoder includes: Based on the attention mechanism, information transmitted along multi-hop paths of different lengths in a knowledge graph subgraph is aggregated to obtain aggregated information. ; ; , ; ; in, Let be the node representation of the i-th input node. Let i be the node features of the i-th input node. and These are the learnable parameters corresponding to the type of the i-th input node. Let i be the node type of the i-th input node; This represents the attention score on the relation path of the k-th hop in the l-th multi-hop path. This represents a filled matrix, a matrix These are learnable parameters, matrices Indicate each Jump relation assignments are transformed separately. Low-order approximations of tensors The node representation of the input node of this relation path The dimension, m, represents the number of association types. Represents the structural attention score. Represents a relation sequence based on s The conditional probability, It is a normalization factor; Indicates a bilinear layer. Let represent the aggregation information of the l-th multi-hop path, and s represent the embedding of the text question; By using residual connections and nonlinear activation functions, the embedding of the output node of the multi-hop path is obtained based on the node features of the input node and the aggregation information of the multi-hop path: ; in, and These are learnable model parameters. It is a non-linear activation function. This represents the embedding of the output node of the l-th multi-hop path. The node features representing the input node of the l-th multi-hop path; The graph decoder is used to decode the embeddings of the output nodes of the multi-hop path into path information, thereby obtaining the graph neural network-based logical expression corresponding to the multi-hop path, including: ; in, Embedding of output nodes for structural attention score decoding.
2. The multi-hop question-answering method according to claim 1, characterized in that, Based on all the entities and their corresponding relationships, the text similarity between the question and each of the multi-hop paths is obtained, along with the corresponding first text-based logical expression, specifically including: The text-based logical expression corresponding to each of the multi-hop paths is concatenated with the question to obtain multiple first concatenated texts; Input the multiple first concatenated texts into a text scoring model to obtain the similarity between the question and each of the multi-hop paths; Output the maximum similarity of a preset number of values and its corresponding first text-based logical expression.
3. The multi-hop question-answering method according to claim 1, characterized in that, The embedding of the output node of the multi-hop path is obtained based on the attention mechanism.
4. The multi-hop question-answering method according to claim 2, characterized in that, By combining the first text-based logical expression and the graph neural network-based logical expression, the answer to the question is obtained, specifically including: Each of the graph neural network-based logical expressions is concatenated with a preset number of first text-based logical expressions to obtain a preset number of second concatenated texts; Input all the second concatenated texts into the text scoring model to obtain the second concatenated text with the highest similarity. The output node corresponding to the graph neural network-based logical expression in the second concatenated text with the highest similarity is taken as the answer to the question.
5. A multi-hop question-answering system, characterized in that, It includes a query module, a first text parsing module, a graph parsing module, and a second text parsing module; The query module is used to query all entities and their corresponding relationships within a preset number of hops related to the entities in the problem from the domain knowledge graph, forming multiple multi-hop paths; The first text parsing module is used to obtain the text similarity between the question and each of the multi-hop paths and the corresponding first text-based logical expression based on all the entities and their corresponding relationships; The graph parsing module is used to obtain a logical expression based on a graph neural network based on all the entities and their corresponding relationships; The second text parsing module is used to combine the first text-based logical expression and the graph neural network-based logical expression to obtain the answer to the question; Specifically, obtaining the logical expression based on the graph neural network based on all the entities and their corresponding relationships includes: Extract the triples from all entities and their corresponding relations to construct a knowledge graph subgraph, and define the set of all multi-hop paths formed by the triples as... : ; in The head entity representing a multi-hop path. The tail entity represents a multi-hop path. This represents an intermediate entity in a multi-hop path. These represent the relationships between entities at each hop in a multi-hop path. Indicates the number of hops in a multi-hop path; Obtaining the embedding of the output node of each multi-hop path in the knowledge graph subgraph using a graph encoder includes: Based on the attention mechanism, information transmitted along multi-hop paths of different lengths in a knowledge graph subgraph is aggregated to obtain aggregated information. ; ; , ; ; in, Let be the node representation of the i-th input node. Let i be the node features of the i-th input node. and These are the learnable parameters corresponding to the type of the i-th input node. Let i be the node type of the i-th input node; This represents the attention score on the relation path of the k-th hop in the l-th multi-hop path. This represents a filled matrix, a matrix These are learnable parameters, matrices Indicate each Jump relation assignments are transformed separately. Low-order approximations of tensors The node representation of the input node of this relation path The dimension, m, represents the number of association types. Represents the structural attention score. Represents a relation sequence based on s The conditional probability, It is a normalization factor; Indicates a bilinear layer. Let represent the aggregation information of the l-th multi-hop path, and s represent the embedding of the text question; By using residual connections and nonlinear activation functions, the embedding of the output node of the multi-hop path is obtained based on the node features of the input node and the aggregation information of the multi-hop path: ; in, and These are learnable model parameters. It is a non-linear activation function. This represents the embedding of the output node of the l-th multi-hop path. The node features representing the input node of the l-th multi-hop path; The graph decoder is used to decode the embeddings of the output nodes of the multi-hop path into path information, thereby obtaining the graph neural network-based logical expression corresponding to the multi-hop path, including: ; in, Embedding of output nodes for structural attention score decoding.
6. The multi-hop question-answering system according to claim 5, characterized in that, The first text parsing module includes a first concatenation module, a first similarity acquisition module, and an output module; The first concatenation module is used to concatenate the text-based logical expression corresponding to each of the multi-hop paths with the question to obtain multiple first concatenated texts; The first similarity acquisition module is used to input the plurality of first concatenated texts into a text scoring model to obtain the similarity between the question and each of the multi-hop paths; The output module is used to output a preset number of maximum similarities and their corresponding first text-based logical expressions.
7. The multi-hop question-answering system according to claim 6, characterized in that, The encoding module is used to obtain the embedding of the output node of the multi-hop path based on the attention mechanism.
8. The multi-hop question-answering system according to claim 6, characterized in that, The second text parsing module includes a second concatenation module, a second similarity acquisition module, and an answer determination module; The second splicing module is used to splice each of the graph neural network-based logical expressions with the preset number of first text-based logical expressions to obtain a preset number of second spliced texts; The second similarity acquisition module is used to input all the second concatenated texts into the text scoring model to obtain the second text-based logical expression with the highest similarity to the graph neural network-based logical expression; The answer determination module is used to select the output node corresponding to the graph neural network-based logical expression in the second concatenated text with the highest similarity as the answer to the question.
Citation Information
Patent Citations
Intelligent customer service voice processing system and method based on knowledge graph
CN115688879A
Multi-hop question-answering system and method based on graph neural network
CN116501849A