Method and system for enhancing multi-hop reasoning question answering based on type information

CN118504686BActive Publication Date: 2026-09-11QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410606521.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-16
Publication Date
2026-09-11
Estimated Expiration
2044-05-16

AI Technical Summary

Technical Problem

[0005]本发明的技术任务是提供一种基于类型信息增强圆柱嵌入的多跳推理问答方法及系统,来解决如何利用类型信息提高推理的准确性的问题

Benefits of technology

[0117](一)本发明通过多跳推理框架TECE来对问题查询来进行推理,利用知识图谱中丰富的语义信息对实体和关系进行增强,提升了推理的准确性;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118504686B_ABST
    Figure CN118504686B_ABST
Patent Text Reader

Abstract

The application discloses a multi-hop reasoning question and answer method and system based on type information enhanced cylindrical embedding, and belongs to the technical field of multi-hop reasoning and knowledge graph. The technical problem to be solved by the application is how to improve the accuracy of reasoning by using type information. The technical scheme adopted is as follows: the method is obtained by a multi-hop reasoning framework, and standard knowledge graph data sets and entity type data sets are subjected to entity type information enhancement, construction of a relationship type graph, integration of entity, relationship and type pair representation and reasoning processing to obtain a final reasoning answer set. Specifically, the entity type information enhancement is as follows: the query question calculation graph, anchor entity and anchor entity type information are obtained, and the entity and entity type information are combined by a multi-layer high-speed network framework to enhance the embedding representation of the entity. The relationship type graph is constructed by extracting the relationship type set as a node and a relationship as an edge of an undirected graph network, and the original embedding of the relationship and the relationship type set are obtained after construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multi-hop reasoning and knowledge graph technology, specifically a multi-hop reasoning question-answering method and system based on type information-enhanced cylindrical embedding. Background Technology

[0002] Multi-hop reasoning is a key research area in natural language processing. It involves progressively extracting and associating information from multiple sources to arrive at a final conclusion. Multi-hop reasoning is widely used in question-answering systems, especially in applications requiring the extraction of information from complex data. Examples include questions with multiple constraints and cascading relationships between entities, where answers cannot be directly retrieved from a database. Instead, the reasoning model must use entities and conditions to progressively deduce the answer from a knowledge base.

[0003] Existing multi-hop reasoning methods can be broadly categorized into path-based, logic-based, and embedding-based methods. Currently, logic-based multi-hop reasoning methods have received widespread attention in multi-hop reasoning technology. These methods, either combining probabilistic logic or knowledge embedding methods, transform queries into logical paradigms and directed acyclic computation trees. Entity embeddings are converted into representations in different forms such as planar geometry and probability distributions. By defining the operational methods of logical operations and performing transformations in the embedding space according to the relational operations of the computation tree decomposition, the embedded representation is finally compared with the entity to obtain the final answer. Most logic-based methods have achieved superior performance for positive first-order logic queries without negation operations. However, for queries with negation operations, these methods still have some limitations. Since the result of complex query reasoning is often a large entity set, and the negation operation corresponds to taking the complement of the entity set during the reasoning process, the entity set obtained after multiple reasoning steps is difficult to form a continuous whole in the embedding space, leading to a decrease in reasoning accuracy. Furthermore, most models focus only on entities and relationships in the knowledge graph, ignoring the inherent semantic information in the knowledge graph, such as entity type information, which leads to reduced query accuracy.

[0004] Therefore, how to utilize type information to improve the accuracy of reasoning is a technical problem that needs to be solved. Summary of the Invention

[0005] The technical objective of this invention is to provide a multi-hop reasoning question-answering method and system based on type information-enhanced cylindrical embedding, in order to solve the problem of how to improve the accuracy of reasoning by utilizing type information.

[0006] The technical objective of this invention is achieved as follows: a multi-hop reasoning question-answering method based on type-information-enhanced cylindrical embedding. This method uses a multi-hop reasoning framework to enhance the entity type information of a standard knowledge graph dataset and an entity type dataset, construct a relation type graph, integrate pairwise representations of entities, relations, and types, and perform reasoning processing to obtain the final reasoning answer set; specifically as follows:

[0007] Entity type information enhancement: Obtain the computation graph of the query problem, anchor entities, and anchor entity type information, and combine the entity and entity type information through a multi-layer high-speed network framework to enhance the embedded representation of entities;

[0008] Construct a relation type graph: Extract the relation type set by using an undirected graph network with types as nodes and relations as edges, and obtain the original embeddings of relations and the relation type set after construction;

[0009] Integrating entity, relation, and type pair representations: Entity-type pairs, entity-relation pairs, and type-relation pairs are enhanced with relevance information through a bidirectional attention mechanism, and then the results of bidirectional fusion are combined through a gating mechanism to regulate the information flow and obtain the final representations of entity embedding and relation embedding;

[0010] Query reasoning: By jointly representing the enhanced entity embeddings learned earlier and the original entity embeddings in the 3D cylindrical space, and by defining logical operations represented by different geometric transformations on the 3D cylinder, reasoning is performed along the computation graph through the inferencer to obtain the final set of reasoning answers.

[0011] As a preferred option, the entity type information enhancement is as follows:

[0012] The type information in entities is aggregated using a multi-layer high-speed network framework, as shown in the following formula:

[0013]

[0014]

[0015]

[0016] in, d represents the hidden state of entity type information in the i-th iteration; d and n represent the size of the type vector and the number of types, respectively. σ represents the initial type characteristics of an entity; σ represents the sigmoid function. and Let W represent two sets of trainable matrices; W and b are linear operation parameters; q represents the reset gate, which obtains the final feature information after K iterations. Will After linear transformation, we obtain Then The augmented representation of the entity is obtained by combining it with the initial entity, as shown in the following formula:

[0017]

[0018] in, Represents the initial entity representation; This represents the enhanced entity representation.

[0019] As a preferred option, the relationship type graph is constructed as follows:

[0020] The type diagram is constructed and the type set is extracted, as follows:

[0021] Constructing a type graph At that time, from the existing knowledge graph triples in Extracted from the information; where ε represents the set of all entities in the knowledge graph; Represents the set of all relations in a knowledge graph; Represents the collection of all entity types; Represents the set of triples in a knowledge graph;

[0022] Get the subset of the containment relation r Subset It contains two types of information, as detailed below:

[0023] ① Relational assertion (h,r,t); where h represents the head entity, and the tail entity t is obtained through inference using relation r;

[0024] ② Entity type set (e, type, y); where e represents an entity and y represents the type contained in entity e;

[0025] For each relation r, the type information of relation r is represented as the union of the types contained in the corresponding head entity and tail entity, expressed by the following formula:

[0026]

[0027]

[0028]

[0029] Here, hd(t) and tl(t) represent the head entity and tail entity in the relation assertion t containing relation r, and the type sets of the two entities, head entity and tail entity, are defined as follows: and The final type set of relation r is obtained by taking the intersection of the type sets corresponding to the head entity and the tail entity.

[0030] Relationship type connection: Different weights are assigned to all types within a relation. Types more relevant to the query content should receive higher attention. Therefore, after integrating relation types using an arbitrary linear sequence, an attention neural network is used to model the relation type connections to ensure focus on information with higher type conformity. This is represented by the following formula:

[0031]

[0032]

[0033] in, An aggregated type information vector representing a relation; b represents the i-th type of the vector; i Represented as a weight vector for each type; MLP is represented as a weight vector from... arrive Multilayer perceptron.

[0034] As a preferred approach, the pairwise representation of entities, relations, and types is as follows:

[0035] This hidden constraint is captured by introducing a bidirectional attention mechanism to integrate the pairwise representations of entity-type pairs, entity-relation pairs, and type-relation pairs, as shown in the following formula:

[0036]

[0037]

[0038] in, The entity-relationship representation represents the integrated entity-relationship representation, which is represented by entities. Relationship representation Obtained by performing element-wise subtraction and multiplication calculations; The integrated relational-entity representation is derived from the relational representation. and entity representation Obtained by performing element-wise subtraction and multiplication calculations; and It represents a learnable parameter matrix, and obtains relation-aware entity representations and relation-aware relation representations through bidirectional integration of entities and relations, which are used to mine the interactions between entities and relations;

[0039] To better regulate the information flow, a gating mechanism is used to fuse the bidirectional integrated representations, and a preview layer is applied to adjust the fused features to their original size. Therefore, the final entity representation is as follows:

[0040]

[0041]

[0042] Where q represents the reset gate; The entity-type representation obtained through integration operations is then fused with the entity-relationship representation to obtain a preliminary entity augmentation representation. A linear operation is then performed on this preliminary entity augmentation representation to reset its dimensions, resulting in the final entity representation.

[0043] More preferably, the inference engine includes four logical operations: projection, intersection, negation, and union.

[0044] The projection operation connects the input entities and relation outputs to adjacent entities of a given relation, and then uses a mapping function f to anchor the entity set. Mapping to adjacent entity sets The formula is as follows:

[0045] f:

[0046]

[0047] in, Represents entity set and relationships The sum f represents a neural network, which is composed of a scaling block function g and a multilayer perceptron (MLP); the MLP maps vectors from three dimensions to three dimensions. The scaling block function g transforms a three-dimensional vector into three d-vectors, which are used for the semantic center axis θ. ax Aperture θ ap and height θ he semantic center axis θ ax Aperture θ ap and height θ he The ranges are [-π, π). d [0, 2π] d and (-π,π) d Semantic central axis θ ax Aperture θ ap and height θ he The three parameters constitute a representation of the entity in cylindrical space, while the built-in scaling operation of the scaling block function g will embed the rescaling to the standard range, as defined in the following formula:

[0048]

[0049] Where, [f(x)] i Let f(x) represent the i-th element, and let λ1, λ2, and λ3 represent the hyperparameters used for scaling.

[0050] The intersection operation takes two entities as input and performs the intersection operation on them, and outputs a related entity; for queries... A combination of queries The intersection operation is represented as set up and They are respectively and The embedded domain is the entity obtained by performing an intersection operation on all entities using the Hadman product, as shown in the following formula:

[0051]

[0052]

[0053] in, This represents an attention matrix; k represents the number of conjunction queries; Represented as (θ) i,ax ,θ i,ap ,θ i,he The concatenation of the i-th query;

[0054] The negation operation takes an entity as input and outputs the complement of that entity in the total entity space. For a set of entities... right The entity set obtained after performing the inversion operation is represented as follows: Let the input entity set be Output entity set and The conversion between them is derived from the following formula:

[0055]

[0056] [θ′ ap ] i =2π-[θ ap ] i ;

[0057] [θ′ he ] i =[θ he ] i ;

[0058] Due to the properties of a circle, the semantic central axis of the entity remains a straight line and is symmetrical about the center of the circle before and after the negation operation. The aperture range is complemented on the circle. Since the entity set is defined in three-dimensional space, changing the height parameter will cause closure loss to some answer entities. Therefore, the height parameter of the entity remains unchanged before and after the negation operation.

[0059] The union operation takes two entities as input and outputs a combined entity with a new range. For a set of entities from a union query... Composition of queries The answer is represented as When dealing with complex queries, the query is converted into disjunctive normal form, and the union operations in the query are integrated into the last step of reasoning.

[0060] By defining a distance function to determine the distance between the entity set and the query, the answer entity set for the query is obtained; for a single entity v = (θ) ax ,0,θ he ) and query V = (θ ax ,θ ap ,θ he Two different distance functions are defined for conjunctive queries and disjunctive queries, respectively.

[0061] The formula for the conjunctive query distance is as follows:

[0062] d con (v;V)=d o (v;V)+λd i (v;V)+d h (v;V);

[0063] d o =||min{d l ,d u}|| l ;

[0064] d i =||min{d ax ,d ap}|| l ;

[0065] d h =||θ′ he -θ he || l ;

[0066] Where, d o d represents the distance outside the cone. i d represents the distance within the cone. h Represents the height distance; λ∈(0,1) serves as a hyperparameter to ensure that entity v is close to the region of query V; ||·|| l Denotes the L1 norm; d l The outer cone distance from the semantic central axis of the entity to the lower bound of the query; d u The distance from the semantic center axis of the entity to the upper bound of the query is the outer cone distance; d ax The in-cone distance from the semantic center axis of the entity to the semantic center axis of the query; dap d represents the distance from the semantic central axis of the query to any boundary; l d u d ax d ap The four distance formulas are as follows:

[0067] d l =|1-cos(θ′) ax -θ l )|;

[0068] d u =|1-cos(θ′) ax -θ u )|;

[0069] d ax =|1-cos(θ′) ax -θ ax )|;

[0070] d ap =|1-cos(θ) ap / 2)|;

[0071] Where, θ l θ represents the lower bound of the query; u This represents the upper bound of the query;

[0072] For disjunctive query distance, the disjunctive normal form is used to describe the distance, and the formula is as follows:

[0073] d di s(v;V)=min{d con (v;V i )} i:1→n ;

[0074] To optimize the training loss, the objective function used is as follows:

[0075]

[0076] The model is trained by minimizing the distance between positive samples and the query and maximizing the distance between negative samples and the query.

[0077] Where σ(x) represents the sigmoid function; γ represents a fixed positive interval parameter.

[0078] A multi-hop reasoning question-answering system based on type-information-enhanced cylindrical embedding, the system comprising:

[0079] The entity enhancement module is used to obtain the computation graph of the query problem, anchor entities and anchor entity type information, and combine the entity and entity type information through a multi-layer high-speed network framework to enhance the embedded representation of the entity;

[0080] The type graph construction module is used to extract the relation type set by constructing an undirected graph network with types as nodes and relations as edges. After construction, the original embedding of the relation and the embedding of the relation type set are obtained.

[0081] The entity-relationship and type pair representation module is used to enhance the relevance information of entity-type pairs, entity-relationship pairs and type-relationship pairs through a bidirectional attention mechanism, and then combine the results of bidirectional fusion through a gating mechanism to regulate the information flow and obtain the final representation of entity embedding and relation embedding.

[0082] The query reasoning module is used to jointly represent the enhanced entity embeddings learned earlier and the original entity embeddings in the 3D cylindrical space, and to reason along the computation graph by defining logical operations represented by different geometric transformations on the 3D cylinder, so as to obtain the final reasoning answer set.

[0083] As a preferred approach, the entity enhancement module uses a multi-layer high-speed network framework to aggregate type information from entities, as shown in the following formula:

[0084]

[0085]

[0086]

[0087] in, d represents the hidden state of entity type information in the i-th iteration; d and n represent the size of the type vector and the number of types, respectively. σ represents the initial type characteristics of an entity; σ represents the sigmoid function. and Let W represent two sets of trainable matrices; W and b are linear operation parameters; q represents the reset gate, which obtains the final feature information after K iterations. Will After linear transformation, we obtain Then The augmented representation of the entity is obtained by combining it with the initial entity, as shown in the following formula:

[0088]

[0089] in, Represents the initial entity representation; This represents the enhanced entity representation;

[0090] The type graph building module is used to create type graphs and extract type sets, as follows:

[0091] Constructing a type graph At that time, from the existing knowledge graph triples in Extracted from the information; where ε represents the set of all entities in the knowledge graph; Represents the set of all relations in a knowledge graph; Represents the collection of all entity types; Represents the set of triples in a knowledge graph;

[0092] Get the subset of the containment relation r Subset It contains two types of information, as detailed below:

[0093] ① Relational assertion (h,r,t); where h represents the head entity, and the tail entity t is obtained through inference using relation r;

[0094] ② Entity type set (e, type, y); where e represents an entity and y represents the type contained in entity e;

[0095] For each relation r, the type information of relation r is represented as the union of the types contained in the corresponding head entity and tail entity, expressed by the following formula:

[0096]

[0097]

[0098]

[0099] Here, hd(t) and tl(t) represent the head entity and tail entity in the relation assertion t containing relation r, and the type sets of the two entities, head entity and tail entity, are defined as follows: and The final type set of relation r is obtained by taking the intersection of the type sets corresponding to the head entity and the tail entity.

[0100] Relationship type connection: Different weights are assigned to all types within a relation. Types more relevant to the query content should receive higher attention. Therefore, after integrating relation types using an arbitrary linear sequence, an attention neural network is used to model the relation type connections to ensure focus on information with higher type conformity. This is represented by the following formula:

[0101]

[0102]

[0103] in, An aggregated type information vector representing a relation; b represents the i-th type of the vector;i Represented as a weight vector for each type; MLP is represented as a weight vector from... arrive Multilayer perceptron.

[0104] More preferably, the entity-relation and type pairwise representation module captures this hidden constraint by introducing a bidirectional attention mechanism to integrate the pairwise representations of entity-type pairs, entity-relation pairs, and type-relation pairs, as shown in the following formula:

[0105]

[0106]

[0107] in, The entity-relationship representation represents the integrated entity-relationship representation, which is represented by entities. Relationship representation Obtained by performing element-wise subtraction and multiplication calculations; The integrated relational-entity representation is derived from the relational representation. and entity representation Obtained by performing element-wise subtraction and multiplication calculations; and It represents a learnable parameter matrix, and obtains relation-aware entity representations and relation-aware relation representations through bidirectional integration of entities and relations, which are used to mine the interactions between entities and relations;

[0108] To better regulate the information flow, a gating mechanism is used to fuse the bidirectional integrated representations, and a preview layer is applied to adjust the fused features to their original size. Therefore, the final entity representation is as follows:

[0109]

[0110]

[0111] Where q represents the reset gate; The entity-type representation obtained through integration operations is then fused with the entity-relationship representation to obtain a preliminary entity augmentation representation. A linear operation is then performed on this preliminary entity augmentation representation to reset its dimensions, resulting in the final entity representation.

[0112] An electronic device includes: a memory and at least one processor;

[0113] The memory contains computer programs;

[0114] The at least one processor executes the computer program stored in the memory, causing the at least one processor to perform the multi-hop reasoning question answering method based on type information-enhanced cylindrical embedding as described above.

[0115] A computer-readable storage medium storing a computer program that can be executed by a processor to implement the multi-hop reasoning question-answering method based on type information-enhanced cylindrical embedding as described above.

[0116] The multi-hop reasoning question answering method and system based on type information-enhanced cylindrical embedding of the present invention have the following advantages:

[0117] (i) This invention uses the multi-hop reasoning framework TECE to reason about the question query, and uses the rich semantic information in the knowledge graph to enhance entities and relationships, thereby improving the accuracy of reasoning;

[0118] (ii) This invention supplements the logical operation of negation in queries that cannot be effectively handled by general methods, and provides a new approach to cover a wide range of logical problems;

[0119] (iii) The present invention can define and implement a complete set of end-to-end reasoning query operations, and can provide users with query answers through reasoning;

[0120] (iv) This invention uses a standard knowledge graph dataset and an entity type dataset as input. The knowledge graph data consists of triples composed of head entities, relations, and tail entities, while the entity type data consists of entity names and types. Specifically, TECE mainly consists of four main modules: First, in the entity type information enhancement stage, to aggregate information from entity types, this invention uses an iterative multi-layer high-speed network framework to embed type information. After multiple iterations, the type embeddings are integrated with the original entity embeddings to obtain the enhanced entity embeddings. Second, in the relation type graph construction stage, an undirected graph network with types as nodes and relations as edges is used to extract the relation type set. The process involves constructing the original embeddings of relationships and the embeddings of relationship type sets. Then, in the stage of integrating entity, relationship, and type pair representations, the entity-type pairs, entity-relation pairs, and type-relation pairs are enhanced with relevance information through a bidirectional attention mechanism. A gating mechanism is then used to combine the results of the bidirectional fusion to regulate the information flow, obtaining the final representations of entity and relationship embeddings. Finally, in the reasoning stage, the enhanced entity embeddings learned earlier are jointly represented with the original entity embeddings in the 3D cylindrical space. Logical operations are represented by different geometric transformations on the 3D cylinder, and reasoning is performed along the computation graph to obtain the final set of reasoning answers, thus improving reasoning accuracy.

[0121] (v) This invention uses the multi-hop reasoning framework TECE to reason about complex queries, integrates type information, and enhances entities and relationships through type information, thereby improving the accuracy of multi-hop reasoning from the perspective of information enhancement. Attached Figure Description

[0122] The invention will be further described below with reference to the accompanying drawings.

[0123] Appendix Figure 1 Diagrams illustrating entity type information enhancement, type graph construction, and relation type extraction. Appendix Figure 2 Add a diagram to the bidirectional attention mechanism information;

[0124] Appendix Figure 3 This is a schematic diagram of the cone embedding logic operation. Detailed Implementation

[0125] The multi-hop reasoning question-answering method and system based on type information-enhanced cylindrical embedding of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0126] Example 1:

[0127] As attached Figure 1 and 2 As shown, this embodiment provides a multi-hop reasoning question answering method based on type information-enhanced cylindrical embedding. This method uses a multi-hop reasoning framework to enhance the standard knowledge graph dataset and entity type dataset with entity type information, construct a relation type graph, integrate pairwise representations of entities, relations, and types, and perform reasoning processing to obtain the final reasoning answer set; specifically as follows:

[0128] S1. Entity type information enhancement: Obtain the computation graph of the query problem, anchor entities and anchor entity type information, and combine the entity and entity type information through a multi-layer high-speed network framework to enhance the embedded representation of the entity;

[0129] S2. Construct a relation type graph: Extract the relation type set by using an undirected graph network with types as nodes and relations as edges, and obtain the original embedding of relations and relation type set after construction;

[0130] S3. Integrating entity-relationship and type pair representations: Entity-type pairs, entity-relationship pairs, and type-relationship pairs are enhanced with relevance information through a bidirectional attention mechanism, and then the results of bidirectional fusion are combined through a gating mechanism to regulate the information flow and obtain the final representations of entity embedding and relation embedding;

[0131] S4. Query Reasoning: By jointly representing the enhanced entity embeddings learned earlier and the original entity embeddings in the 3D cylindrical space, and by defining logical operations represented by different geometric transformations on the 3D cylinder, the reasoning is performed along the computation graph through the inferencer to obtain the final set of reasoning answers.

[0132] The enhancement of entity type information in step S1 of this embodiment is as follows:

[0133] The type of an entity provides information related to the object it represents in the knowledge graph. For example, if an entity includes types such as sports, news, and competition, it can be inferred that the entity is related to major sporting events. To utilize this type-based information, a multi-layer high-speed network framework is used to aggregate the type information in entities, as shown in the following formula:

[0134]

[0135]

[0136]

[0137] in, d represents the hidden state of entity type information in the i-th iteration; d and n represent the size of the type vector and the number of types, respectively. σ represents the initial type characteristics of an entity; σ represents the sigmoid function. and Let W represent two sets of trainable matrices; W and b are linear operation parameters; q represents the reset gate, which obtains the final feature information after K iterations. Will After linear transformation, we obtain Then The augmented representation of the entity is obtained by combining it with the initial entity, as shown in the following formula:

[0138]

[0139] in, Represents the initial entity representation; This represents the enhanced entity representation.

[0140] The specific steps for constructing the relational type graph in step S2 of this embodiment are as follows:

[0141] S201. A type graph is constructed and a type set is extracted. After type information enhancement, the query effect is significant for queries without quantifiable variables. However, for queries with chained existential variables, the correlation between the anchor entity and the answer entity weakens after multiple relation projections of the anchor entity. Therefore, information enhancement of the relations is needed to eliminate this cascading error generated during reasoning. However, existing knowledge graphs lack specific type annotations for relations. Therefore, this invention solves this problem by constructing a type graph on the original knowledge graph. Specifically:

[0142] S20101, Constructing a Type Diagram At that time, from the existing knowledge graph triples in Extracted from the information; where ε represents the set of all entities in the knowledge graph; Represents the set of all relations in a knowledge graph; Represents the collection of all entity types; Represents the set of triples in a knowledge graph;

[0143] S20102. Obtain the subset of the containment relation r. Subset It contains two types of information, as detailed below:

[0144] ① Relational assertion (h,r,t); where h represents the head entity, and the tail entity t is obtained through inference using relation r;

[0145] ② Entity type set (e, type, y); where e represents an entity and y represents the type contained in entity e;

[0146] S20103. For each relation r, the type information of relation r is represented as the union of the types contained in the corresponding head entity and tail entity, expressed by the following formula:

[0147]

[0148]

[0149]

[0150] Here, hd(t) and tl(t) represent the head entity and tail entity in the relation assertion t containing relation r, and the type sets of the two entities, head entity and tail entity, are defined as follows: and The final type set of relation r is obtained by taking the intersection of the type sets corresponding to the head entity and the tail entity.

[0151] S202, Relationship Type Connection: Not all types within a relation are given equal weight. Types more relevant to the query content should receive higher attention. Therefore, after integrating relation types using an arbitrary linear sequence, an attention neural network is used to model the relation type connections to ensure focus on information with higher type conformity. This is expressed by the following formula:

[0152]

[0153]

[0154] in, An aggregated type information vector representing a relation; b represents the i-th type of the vector; i Represented as a weight vector for each type; MLP is represented as a weight vector from... arrive Multilayer perceptron.

[0155] The specific representation of the integrated entity, relation, and type pairs in step S3 of this embodiment is as follows:

[0156] S301. Integrating entity, type, and relation information when embedding queries can effectively smooth decision boundaries. For example, when querying "Which schools have not held a sports meet this year?", the focus of reasoning for this query should be on the "holding" relation and the "sports meet" entity. Integrating entity, type, and relation representations can achieve the expected matching between this query and the knowledge graph. By introducing a bidirectional attention mechanism to integrate pairwise representations of entity-type pairs, entity-relation pairs, and type-relation pairs, this hidden constraint can be captured. The formula is as follows:

[0157]

[0158]

[0159] in, The entity-relationship representation represents the integrated entity-relationship representation, which is represented by entities. Relationship representation Obtained by performing element-wise subtraction and multiplication calculations; The integrated relational-entity representation is derived from the relational representation. and entity representation Obtained by performing element-wise subtraction and multiplication calculations; and It represents a learnable parameter matrix, and obtains relation-aware entity representations and relation-aware relation representations through bidirectional integration of entities and relations, which are used to mine the interactions between entities and relations;

[0160] S302. To better regulate the information flow, a gating mechanism is used to fuse the bidirectional integrated representations, and a preview layer is applied to adjust the fused features to their original size. Therefore, the final entity representation is as follows:

[0161]

[0162]

[0163] Where q represents the reset gate; The entity-type representation obtained through integration operations is then fused with the entity-relationship representation to obtain a preliminary entity augmentation representation. A linear operation is then performed on this preliminary entity augmentation representation to reset its dimensions, resulting in the final entity representation.

[0164] The inference in step S4 of this embodiment includes four logical operations: projection, intersection, negation, and union.

[0165] Among them, as attached Figure 3 As shown in (b), the projection operation connects the input entities and relation outputs to the adjacent entities of a given relation, and then uses the mapping function f to realize the anchor entity set. Mapping to adjacent entity sets The formula is as follows:

[0166] f:

[0167]

[0168] Among them, V Q Represents entity set and relationships The sum f represents a neural network, which is composed of a scaling block function g and a multilayer perceptron (MLP); the MLP maps vectors from three dimensions to three dimensions. The scaling block function g transforms a three-dimensional vector into three d-vectors, which are used for the semantic center axis θ. ax Aperture θ ap and height θ he semantic center axis θ ax Aperture θ ap and height θ he The ranges are [-π, π). d [0, 2π] d and (-π,π) d Semantic central axis θ ax Aperture θ ap and height θ heThe three parameters constitute a representation of the entity in cylindrical space, while the built-in scaling operation of the scaling block function g will embed the rescaling to the standard range, as defined in the following formula:

[0169]

[0170] Where, [f(x)] i Let f(x) represent the i-th element, and let λ1, λ2, and λ3 represent the hyperparameters used for scaling.

[0171] As attached Figure 3 As shown in (c), the intersection operation takes two entities as input and outputs a related entity; for a query... A combination of queries The intersection operation is represented as set up and They are respectively and The embedded domain is the entity obtained by performing an intersection operation on all entities using the Hadman product, as shown in the following formula:

[0172]

[0173]

[0174] in, This represents an attention matrix; k represents the number of conjunction queries; Represented as (θ) i,ax ,θ i,ap ,θ i,he The concatenation of the i-th query;

[0175] As attached Figure 3 As shown in (d), the negation operation takes the entity to be processed as input and outputs the complement of that entity in the total entity space. For a set of entities... right The entity set obtained after performing the inversion operation is represented as follows: Let the input entity set be Output entity set and The conversion between them is derived from the following formula:

[0176]

[0177] [θ′ ap ] i =2π-[θ ap ] i ;

[0178] [θ′ he ] i =[θ he ] i ;

[0179] Due to the properties of a circle, the semantic central axis of the entity remains a straight line and is symmetrical about the center of the circle before and after the negation operation. The aperture range is complemented on the circle. Since the entity set is defined in three-dimensional space, changing the height parameter will cause closure loss to some answer entities. Therefore, the height parameter of the entity remains unchanged before and after the negation operation.

[0180] As attached Figure 3 As shown in (e), the union operation takes two entities as input and outputs a joint entity with a new range. For a set of entities from a joint query... Composition of queries The answer is represented as When dealing with complex queries, the query is converted into disjunctive normal form, and the union operations in the query are integrated into the last step of reasoning.

[0181] By defining a distance function to determine the distance between the entity set and the query, the answer entity set for the query is obtained, as shown in the appendix. Figure 3 As shown in (a); for a single entity v = (θ) ax ,0,θ he ) and query V = (θ ax ,θ ap ,θ he Two different distance functions are defined for conjunctive queries and disjunctive queries, respectively.

[0182] The formula for the conjunctive query distance is as follows:

[0183] d con (v;V)=d o (v;V)+λd i (v;V)+d h (v;V);

[0184] d o =||min{d l ,d u}|| l ;

[0185] d i =||min{d ax ,d ap}|| l ;

[0186] d h =||θ′ he -θ he ||l ;

[0187] Where, d o d represents the distance outside the cone. i d represents the distance within the cone. h Represents the height distance; λ∈(0,1) serves as a hyperparameter to ensure that entity v is close to the region of query V; ||·|| l Denotes the L1 norm; d l The outer cone distance from the semantic central axis of the entity to the lower bound of the query; d u The distance from the semantic center axis of the entity to the upper bound of the query is the outer cone distance; d ax The in-cone distance from the semantic center axis of the entity to the semantic center axis of the query; d ap d represents the distance from the semantic central axis of the query to any boundary; l d u d ax d ap The four distance formulas are as follows:

[0188] d l =|1-cos(θ′) ax -θ l )|;

[0189] d u =|1-cos(θ′) ax -θ u )|;

[0190] d ax =|1-cos(θ′) ax -θ ax )|;

[0191] d ap =|1-cos(θ) ap / 2)|;

[0192] Where, θ l θ represents the lower bound of the query; u This represents the upper bound of the query;

[0193] For disjunctive query distance, the disjunctive normal form is used to describe the distance, and the formula is as follows:

[0194] d dis (v;V)=min{d con (v;V i )} i:1→n ;

[0195] To optimize the training loss, the objective function used is as follows:

[0196]

[0197] The model is trained by minimizing the distance between positive samples and the query and maximizing the distance between negative samples and the query.

[0198] Where σ(x) represents the sigmoid function; γ represents a fixed positive interval parameter.

[0199] To verify the effectiveness of TECE, this embodiment uses three standard datasets of different sizes—FB15K, FB15K-237, and NELL995—to evaluate the proposed model. The FB15K dataset is a subgraph composed of a portion of topic words extracted from the Freebase knowledge graph. FB15K-237 is a knowledge graph composed of 237 relations extracted from FB15K, possessing more accurate relations and sparser edges. The NELL995 dataset is a knowledge graph developed by Carnegie Mellon University, primarily used in machine learning tasks and commonly used in multi-hop inference tasks. Detailed information about the datasets is shown in Table 1.

[0200] Table 1 Statistical information of the dataset

[0201] FB15K 14951 2690 3851 FB15K-237 14505 237 3851 NELL995 63361 400 267

[0202] To illustrate the superiority of the model proposed in this invention, TECE is compared with state-of-the-art multi-hop inference methods:

[0203] • GQE: This model maps query entities to one-dimensional vectors in an embedding space, performs logical operations in the embedding space through geometric operations (such as transformations and rotations), and ultimately represents the query as a vector in the embedding space. The query answer is obtained by comparing the distance between the query vector and other entity vectors. This invention names the model GQE.

[0204] • Q2B: This model models the query as a hyperrectangle, where the points within the rectangle are naturally represented as a set of entities. By converting logical operations into union operations between rectangles, the entities in the resulting polygonal union are the query answer. This invention names the model Q2B.

[0205] • BetaE: This model embeds queries and entities into a Beta distribution using probabilistic logic operators. It models logical operations by transforming between high and low probability distributions, and obtains the query answer by comparing the distributions of queries and entities. This model is the first to process all first-order logical operations that include negation. This invention names the model BetaE.

[0206] • CylE: This model models entities and queries by embedding a cylindrical object into a conical prism within a space. Due to the properties of a circle, an entity can obtain a closed interval when performing a negation operation, thus naturally transforming the negation operation into a geometric transformation. The model obtains the query answer by calculating the distance between the entity and the query. This invention names the model CylE.

[0207] The experimental results are shown in Table 2:

[0208] Table 2 Results of the multi-hop reasoning experiment

[0209]

[0210]

[0211] The results of the multi-hop inference experiments are shown in Table 2. It can be seen that the TECE method in this embodiment achieves excellent results on all three datasets. GQE maintains good results when dealing with simple query structures, but its performance declines as the query structure complexity increases. Compared to GQE and Q2B, BetaE achieves better performance when handling queries with multiple mappings due to the introduction of a closed embedding space, but its performance is weaker than Q2B when facing queries with intersection operations. TECE outperforms the aforementioned models in multi-hop inference for positive first-order logic queries, improving model performance by introducing type information. Compared to the current best-performing model, CylE, TECE improves performance on the three datasets by approximately 1.3%, 1.2%, and 2.0%, respectively. Compared to BetaE, TECE's improvement is more significant, increasing by 22.5%, 15.7%, and 15.4%, respectively, demonstrating the importance of introducing type information.

[0212] Example 2:

[0213] This embodiment provides a multi-hop reasoning question-answering system based on type information-enhanced cylindrical embedding, the system comprising:

[0214] The entity enhancement module is used to obtain the computation graph of the query problem, anchor entities and anchor entity type information, and combine the entity and entity type information through a multi-layer high-speed network framework to enhance the embedded representation of the entity;

[0215] The type graph construction module is used to extract the relation type set by constructing an undirected graph network with types as nodes and relations as edges. After construction, the original embedding of the relation and the embedding of the relation type set are obtained.

[0216] The entity-relationship and type pair representation module is used to enhance the relevance information of entity-type pairs, entity-relationship pairs and type-relationship pairs through a bidirectional attention mechanism, and then combine the results of bidirectional fusion through a gating mechanism to regulate the information flow and obtain the final representation of entity embedding and relation embedding.

[0217] The query reasoning module is used to jointly represent the enhanced entity embeddings learned earlier and the original entity embeddings in the 3D cylindrical space, and to reason along the computation graph by defining logical operations represented by different geometric transformations on the 3D cylinder, so as to obtain the final reasoning answer set.

[0218] In this embodiment, the entity enhancement module uses a multi-layer high-speed network framework to aggregate type information in entities, as shown in the following formula:

[0219]

[0220]

[0221]

[0222] in, d represents the hidden state of entity type information in the i-th iteration; d and n represent the size of the type vector and the number of types, respectively. σ represents the initial type characteristics of an entity; σ represents the sigmoid function. and Let W represent two sets of trainable matrices; W and b are linear operation parameters; q represents the reset gate, which obtains the final feature information after K iterations. Will After linear transformation, we obtain Then The augmented representation of the entity is obtained by combining it with the initial entity, as shown in the following formula:

[0223]

[0224] in, Represents the initial entity representation; This represents the enhanced entity representation.

[0225] In this embodiment, the type graph construction module is used to build a type graph and extract a type set, as follows:

[0226] Constructing a type graph At that time, from the existing knowledge graph triples in Extracted from the information; where ε represents the set of all entities in the knowledge graph; Represents the set of all relations in a knowledge graph; Represents the collection of all entity types; Represents the set of triples in a knowledge graph;

[0227] Get the subset of the containment relation r Subset It contains two types of information, as detailed below:

[0228] ① Relational assertion (h,r,t); where h represents the head entity, and the tail entity t is obtained through inference using relation r;

[0229] ② Entity type set (e, type, y); where e represents an entity and y represents the type contained in entity e;

[0230] For each relation r, the type information of relation r is represented as the union of the types contained in the corresponding head entity and tail entity, expressed by the following formula:

[0231]

[0232]

[0233]

[0234] Here, hd(t) and tl(t) represent the head entity and tail entity in the relation assertion t containing relation r, and the type sets of the two entities, head entity and tail entity, are defined as follows: and The final type set of relation r is obtained by taking the intersection of the type sets corresponding to the head entity and the tail entity.

[0235] Relationship type connection: Different weights are assigned to all types within a relation. Types more relevant to the query content should receive higher attention. Therefore, after integrating relation types using an arbitrary linear sequence, an attention neural network is used to model the relation type connections to ensure focus on information with higher type conformity. This is represented by the following formula:

[0236]

[0237]

[0238] in, An aggregated type information vector representing a relation; b represents the i-th type of the vector; i Represented as a weight vector for each type; MLP is represented as a weight vector from... arrive Multilayer perceptron.

[0239] In this embodiment, the entity-relationship and type pairwise representation module captures this hidden constraint by introducing a bidirectional attention mechanism to integrate the pairwise representations of entity-type pairs, entity-relationship pairs, and type-relationship pairs, as shown in the following formula:

[0240]

[0241]

[0242] in, The entity-relationship representation represents the integrated entity-relationship representation, which is represented by entities. Relationship representation Obtained by performing element-wise subtraction and multiplication calculations; The integrated relational-entity representation is derived from the relational representation. and entity representation Obtained by performing element-wise subtraction and multiplication calculations; and It represents a learnable parameter matrix, and obtains relation-aware entity representations and relation-aware relation representations through bidirectional integration of entities and relations, which are used to mine the interactions between entities and relations;

[0243] To better regulate the information flow, a gating mechanism is used to fuse the bidirectional integrated representations, and a preview layer is applied to adjust the fused features to their original size. Therefore, the final entity representation is as follows:

[0244]

[0245]

[0246] Where q represents the reset gate; The entity-type representation obtained through integration operations is then fused with the entity-relationship representation to obtain a preliminary entity augmentation representation. A linear operation is then performed on this preliminary entity augmentation representation to reset its dimensions, resulting in the final entity representation.

[0247] Example 3:

[0248] This embodiment also provides an electronic device, including: a memory and a processor;

[0249] The memory stores the instructions executed by the computer.

[0250] The processor executes computer execution instructions stored in the memory, causing the processor to perform the multi-hop reasoning question answering method based on type information-enhanced cylindrical embedding in any embodiment of the present invention.

[0251] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can be a microprocessor or any conventional processor.

[0252] Memory is used to store computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function, etc.; the data storage area can store data created based on the use of the terminal, etc. In addition, memory can also include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart memory cards (SMC), secure digital cards (SD cards), flash memory cards, at least one disk storage device, flash memory devices, or other volatile solid-state storage devices.

[0253] Example 4:

[0254] This embodiment also provides a computer-readable storage medium storing multiple instructions, which are loaded by a processor to cause the processor to execute the multi-hop reasoning question-answering method based on type information-enhanced cylindrical embedding in any embodiment of the present invention. Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the above embodiments is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.

[0255] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0256] Storage media embodiments for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0257] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0258] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion unit connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion unit execute some and all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0259] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-hop reasoning question-answering method based on type-information-enhanced cylindrical embedding, characterized in that, This method is used in natural language processing. Through a multi-hop reasoning framework, it enhances the standard knowledge graph dataset and entity type dataset with entity type information, constructs a relation type graph, integrates pairwise representations of entities, relations, and types, and performs reasoning processing to obtain the final inference answer set; specifically as follows: Entity type information enhancement: Obtain the computation graph of the query problem, anchor entities, and anchor entity type information, and combine the entity and entity type information through a multi-layer high-speed network framework to enhance the embedded representation of entities; Construct a relation type graph: Extract the relation type set by using an undirected graph network with types as nodes and relations as edges, and obtain the original embeddings of relations and the relation type set after construction; Integrating entity, relation, and type pair representations: Entity-type pairs, entity-relation pairs, and type-relation pairs are enhanced with relevance information through a bidirectional attention mechanism, and then the results of bidirectional fusion are combined through a gating mechanism to regulate the information flow and obtain the final representations of entity embedding and relation embedding; Query reasoning: By jointly representing the enhanced entity embeddings learned earlier and the original entity embeddings in the 3D cylindrical space, and by defining the logical operations represented by different geometric transformations on the 3D cylinder, reasoning is performed along the computation graph through the inferencer to obtain the final set of reasoning answers; The enhancement of entity type information is as follows: The type information in entities is aggregated using a multi-layer high-speed network framework, as shown in the following formula: ; ; ; in, The entity type information is represented in the first... Hidden state at the next iteration; and This indicates the size and number of types in the type vector; Represents the initial type characteristics of an entity; Represents the sigmoid function; and This represents two sets of trainable matrices; and Both represent linear operation parameters; Indicates the reset door, in The final feature information is obtained after the second iteration. ,Will After linear transformation, we obtain ,Will The augmented representation of the entity is obtained by combining it with the initial entity, as shown in the following formula: ; in, Represents the initial entity representation; This represents the enhanced entity representation.

2. The multi-hop reasoning question answering method based on type information-enhanced cylindrical embedding according to claim 1, characterized in that, The relationship type graph is constructed as follows: The type diagram is constructed and the type set is extracted, as follows: Constructing a type graph At that time, from the existing knowledge graph triples in Extract from the information; among which, Represents the set of all entities in a knowledge graph; Represents the set of all relations in a knowledge graph; Represents the collection of all entity types; Represents the set of triples in a knowledge graph; Get containment relationship subsets subset It contains two types of information, as detailed below: ① Relational assertions ;in, Represents the head entity, through relations Reasoning to obtain tail entities ; ② Entity type set ;in, Represents an entity, Representing entities The types included; For each relation ,relation Type information is represented as the union of the types contained in the corresponding head entity and tail entity, using the following formula: ; ; ; in, and Indicates inclusion relationship Relationship assertion The header and tail entities are defined in the code, and the type sets of the header and tail entities are defined as follows: and The intersection of the type sets corresponding to the head entity and the tail entity is the relation. final type collection ; Relation type connection: After integrating relation types using an arbitrary linear sequence, an attention neural network is used to model the relation type connection, which is expressed by the following formula: ; ; in, An aggregated type information vector representing a relation; The vector represents the first One type; Represented as a weight vector for each type; Represented as a from arrive Multilayer perceptron.

3. The multi-hop reasoning question-answering method based on type information-enhanced cylindrical embedding according to claim 1, characterized in that, The integration of entities, relations, and types into paired representations is as follows: This hidden constraint is captured by introducing a bidirectional attention mechanism to integrate the pairwise representations of entity-type pairs, entity-relation pairs, and type-relation pairs, as shown in the following formula: ; ; in, The entity-relationship representation represents the integrated entity-relationship representation, which is represented by entities. Relationship representation Obtained by performing element-wise subtraction and multiplication calculations; The integrated relational-entity representation is derived from the relational representation. and entity representation Obtained by performing element-wise subtraction and multiplication calculations; and It represents a learnable parameter matrix, and obtains relation-aware entity representations and relation-aware relation representations through bidirectional integration of entities and relations, which are used to mine the interactions between entities and relations; A gating mechanism is used to fuse the bidirectional integrated representations, and a preview layer is applied to adjust the fused features to their original size. Therefore, the final entity representation is as follows: ; ; in, Indicates the reset gate; The entity-type representation obtained through integration operations is then fused with the entity-relationship representation to obtain a preliminary entity augmentation representation. A linear operation is then performed on this preliminary entity augmentation representation to reset its dimensions, resulting in the final entity representation. .

4. The multi-hop reasoning question answering method based on type information-enhanced cylindrical embedding according to any one of claims 1 to 3, characterized in that, The inference engine includes four logical operations: projection, intersection, negation, and union. The projection operation connects the input entities and relation outputs to adjacent entities of a given relation, and then uses a mapping function. Implement anchor entity set Mapping to adjacent entity sets The formula is as follows: ; ; in, Represents entity set and relationships The sum ; Representing a neural network, using a scaling block function and multilayer perceptron Combining and integrating; multilayer perceptron Mapping vectors from 3D to 3D Scaling block function It transforms a three-dimensional vector into three... Vector, used for semantic central axis Aperture and height Semantic central axis Aperture and height The ranges are respectively , and Semantic central axis Aperture and height Three parameters constitute a representation of an entity in cylindrical space, along with a scaling block function. The built-in scaling operation will embed rescaling to the standard range, as defined in the following formula: ; in, express The One element, , , This represents the hyperparameters used for scaling. The intersection operation takes two entities as input and performs the intersection operation on them, and outputs a related entity; for queries... A combination of queries , The intersection operation is represented as ,set up and They are respectively and The embedded domain is the entity obtained by performing an intersection operation on all entities using the Hadman product, as shown in the following formula: ; ; in, Represent an attention matrix; Indicates the number of conjunctive queries; Represented as No. A chain of queries; The negation operation takes an entity as input and outputs the complement of that entity in the total entity space. For a set of entities... ,right The entity set obtained after performing the inversion operation is represented as Let the input entity set be Output entity set , and The conversion between them is derived from the following formula: ; ; ; Due to the properties of a circle, the semantic central axis of the entity remains a straight line and is symmetrical about the center of the circle before and after the negation operation. The aperture range is complemented on the circle. Since the entity set is defined in three-dimensional space, changing the height parameter will cause closure loss to some answer entities. Therefore, the height parameter of the entity remains unchanged before and after the negation operation. The union operation takes two entities as input and outputs a combined entity with a new range. For a set of entities from a union query... Composition of queries , The answer is represented as This transforms the query into disjunctive normal form, integrating the union operations in the query into the final step of inference. The distance between the entity set and the query is determined by defining a distance function, and the answer entity set for the query is obtained; for a single entity... and query Two different distance functions are defined for conjunctive queries and disjunctive queries, respectively; The formula for the conjunctive query distance is as follows: ; ; ; ; in, Indicates the distance outside the cone; Indicates the distance within the cone; Indicates altitude or distance; As a hyperparameter-guaranteed entity Near query The area; Represents the L1 norm; Represents the outer cone distance from the semantic center axis of the entity to the lower bound of the query; This represents the outer cone distance from the semantic center axis of the entity to the upper bound of the query; This represents the in-cone distance from the semantic center axis of the entity to the semantic center axis of the query; This represents the distance from the semantic central axis of the query to any boundary. , , , The four distance formulas are as follows: ; ; ; ; in, This represents the lower bound of the query; This represents the upper bound of the query; For disjunctive query distance, the disjunctive normal form is used to describe the distance, and the formula is as follows: ; To optimize the training loss, the objective function used is as follows: ; The model is trained by minimizing the distance between positive samples and the query and maximizing the distance between negative samples and the query. in, Represents the sigmoid function; This represents a fixed positive interval parameter.

5. A multi-hop reasoning question-answering system based on type-information-enhanced cylindrical embedding, characterized in that, This system is used for natural language processing; the system includes: The entity enhancement module is used to obtain the computation graph of the query problem, anchor entities and anchor entity type information, and combine the entity and entity type information through a multi-layer high-speed network framework to enhance the embedded representation of the entity; The type graph construction module is used to extract the relation type set by constructing an undirected graph network with types as nodes and relations as edges. After construction, the original embedding of the relation and the embedding of the relation type set are obtained. The entity-relationship and type pair representation module is used to enhance the relevance information of entity-type pairs, entity-relationship pairs and type-relationship pairs through a bidirectional attention mechanism, and then combine the results of bidirectional fusion through a gating mechanism to adjust the information flow and obtain the final representation of entity embedding and relation embedding. The query reasoning module is used to jointly represent the enhanced entity embeddings learned earlier and the original entity embeddings in the 3D cylindrical space, and to reason along the computation graph by defining logical operations represented by different geometric transformations on the 3D cylinder, so as to obtain the final reasoning answer set. The entity enhancement module uses a multi-layer high-speed network framework to aggregate type information in entities, as shown in the following formula: ; ; ; in, The entity type information is represented in the first... Hidden state at the next iteration; and This indicates the size and number of types in the type vector; Represents the initial type characteristics of an entity; Represents the sigmoid function; and This represents two sets of trainable matrices; and For linear operation parameters; Indicates the reset door, in The final feature information is obtained after the second iteration. ,Will After linear transformation, we obtain Then The augmented representation of the entity is obtained by combining it with the initial entity, as shown in the following formula: ; in, Represents the initial entity representation; This represents the enhanced entity representation.

6. The multi-hop reasoning question-answering system based on type information-enhanced cylindrical embedding according to claim 5, characterized in that, The type graph building module is used to create type graphs and extract type sets, as follows: Constructing a type graph At that time, from the existing knowledge graph triples in Extract from the information; among which, Represents the set of all entities in a knowledge graph; Represents the set of all relations in a knowledge graph; Represents the collection of all entity types; Represents the set of triples in a knowledge graph; Get containment relationship subsets subset It contains two types of information, as detailed below: ① Relational assertions ;in, Represents the head entity, through relations Reasoning to obtain tail entities ; ② Entity type set ;in, Represents an entity, Representing entities The types included; For each relation ,relation Type information is represented as the union of the types contained in the corresponding head entity and tail entity, using the following formula: ; ; ; in, and Indicates inclusion relationship Relationship assertion The header and tail entities are defined in the code, and the type sets of the header and tail entities are defined as follows: and The intersection of the type sets corresponding to the head entity and the tail entity is the relation. final type collection ; Relation type connection: After integrating relation types using an arbitrary linear sequence, an attention neural network is used to model the relation type connection, which is expressed by the following formula: ; ; in, An aggregated type information vector representing a relation; The vector represents the first One type; Represented as a weight vector for each type; Represented as a from arrive Multilayer perceptron.

7. The multi-hop reasoning question-answering system based on type information-enhanced cylindrical embedding according to claim 5 or 6, characterized in that, The entity-relation and type pairwise representation module captures this hidden constraint by introducing a bidirectional attention mechanism to integrate the pairwise representations of entity-type pairs, entity-relation pairs, and type-relation pairs, as shown in the following formula: ; ; in, The entity-relationship representation represents the integrated entity-relationship representation, which is represented by entities. Relationship representation Obtained by performing element-wise subtraction and multiplication calculations; The integrated relational-entity representation is derived from the relational representation. and entity representation Obtained by performing element-wise subtraction and multiplication calculations; and It represents a learnable parameter matrix, and obtains relation-aware entity representations and relation-aware relation representations through bidirectional integration of entities and relations, which are used to mine the interactions between entities and relations; A gating mechanism is used to fuse the bidirectional integrated representations, and a preview layer is applied to adjust the fused features to their original size. Therefore, the final entity representation is as follows: ; ; in, Indicates the reset gate; The entity-type representation obtained through integration operations is then fused with the entity-relationship representation to obtain a preliminary entity augmentation representation. A linear operation is then performed on this preliminary entity augmentation representation to reset its dimensions, resulting in the final entity representation. .

8. An electronic device, characterized in that, include: Memory and at least one processor; The memory contains computer programs; The at least one processor executes the computer program stored in the memory, causing the at least one processor to perform the multi-hop reasoning question answering method based on type information-enhanced cylindrical embedding as described in any one of claims 1 to 4.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that can be executed by a processor to implement the multi-hop reasoning question-answering method based on type information-enhanced cylindrical embedding as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Knowledge graph multi-hop reasoning method and device based on vector logic

    CN115269799A

  • Multi-hop fault diagnosis question and answer method and device based on knowledge graph reasoning and decision

    CN117909467A