Search

CN-121997932-A - Self-adaptive induction knowledge graph reasoning method and system for conditional query

CN121997932ACN 121997932 ACN121997932 ACN 121997932ACN-121997932-A

Abstract

The invention discloses a self-adaptive induction knowledge graph reasoning method and system for conditional query, and relates to the technical field of knowledge graph reasoning. The method comprises the steps of obtaining a generalized test chart and target query comprising a head entity and a query relation, carrying out full-chart precoding on the generalized test chart, screening related initial entities to construct an initial sub-chart and generate node initial representation, constructing a query perception chart neural network, carrying out normalization weighting on tail entity in-edge grouping through multi-layer message transmission and combining a conditional query attention mechanism, dynamically updating the node representation by a self-adaptive residual information fusion strategy, adopting a relation perception double decoder consisting of a symmetrical MLP decoder and an antisymmetric ComplEx decoder, fusing scoring results through a relation level gating mechanism, sequencing candidate tail entities according to the scoring, and outputting the reasoning results. The invention strengthens the suitability of query conditions and structural evidence, relieves the overcomplete problem, improves the modeling capability of complex relations, and realizes the collaborative optimization of inductive reasoning precision and calculation efficiency.

Inventors

  • LU YANJUN
  • DU FANGFANG

Assignees

  • 重庆理工大学

Dates

Publication Date
20260508
Application Date
20251223

Claims (10)

  1. 1. The self-adaptive induction knowledge graph reasoning method for the conditional query is characterized by comprising the following steps of: acquiring an induction test chart and target query, wherein the target query comprises a head entity and a query relation and is used for querying a corresponding tail entity; Performing full-graph precoding processing on the induction test graph, screening initial entities related to the query based on the condition of the target query, constructing an initial sub-graph aiming at the query, and generating initial representations of all nodes in the sub-graph; Constructing a query perception graph neural network, carrying out multi-layer message transmission through the perception graph neural network, introducing a conditional query attention mechanism in the transmission process, carrying out grouping normalization weighting treatment on the entering edges of the tail entities, and dynamically updating the representation of each node by combining with a self-adaptive residual information fusion strategy; after the multi-layer message transmission is completed, scoring of all candidate tail entities is calculated in parallel by adopting a relation-aware double decoder, wherein the double decoder consists of a symmetrical MLP decoder and an antisymmetric ComplEx decoder, and scoring results of the two decoders are fused through a relation-level gating mechanism; and sorting all candidate tail entities according to the final scoring result, and outputting the sorted reasoning result.
  2. 2. The method for reasoning the adaptive generalized knowledge graph of claim 1, wherein the query-aware graph neural network defines a first layer of information in a multi-layer message passing process The tail entity set of the layer actually received message is For entities not included in the collection It is at the first The representation of a layer remains the same as the previous layer, i.e Wherein Is an entity In the first place And the layer representation ensures the stability of entity representation which does not participate in the message interaction of the current layer, and removes noise interference caused by irrelevant updating.
  3. 3. The method for reasoning the adaptive generalized knowledge graph of the conditional query according to claim 2, wherein the implementation process of the conditional query attention mechanism comprises the following steps: For the first Slave header entity in a layer Tail pointing entity Edges of (2) Based on the relationship of edge correspondence Query relationship with target query Generating conditional relation vectors by linear mapping Wherein Embedding and inquiring the embedded mapping function for the relation; In the first place Layer head entity Representation of (2) Based on, and related to conditional relation vector Performing element-by-element product operation to construct and obtain basic message vector Wherein +.is the product of element by element; introducing various learnable parameters Attention vector Computing a score for the attention of an edge Entity according to tail Grouping all the incoming edges, and normalizing by softmax function to obtain the attention weight of the edge ; Based on the normalized attention weight, all the tail-pointing entities are pointed to The basic message vectors of the edges of the (2) are aggregated to obtain a tail entity In the first place Intermediate representation of layers Wherein To point to tail entity Is a set of all incoming edges of (a).
  4. 4. A conditional query-oriented adaptive generalized knowledge graph reasoning method as claimed in claim 3, wherein the adaptive residual information fusion strategy comprises the following steps: Calculate the first Layer tail entity Intermediate representation of (2) And the upper layer represents Is of the difference vector of (2) ; Calculating the squared norm mean of the disparity vector Wherein Generating adaptive fusion coefficients for vector dimensions based on squared norm mean of disparity vectors In the following >0 Is a hyper-parameter controlling the degree of adaptation, Epsilon >0 is a stability constant avoiding a value of zero for the lower threshold of the fusion coefficient; The intermediate representation and the upper layer representation are weighted and fused through fusion coefficients to obtain a fusion representation ; Inputting the fusion representation into a feed-forward network composed of a linear layer and a ReLU activation function, outputting a tail entity In the first place Final representation of layers Wherein As a mapping function of the feed forward network, 、 Respectively, represent tail entities At the query Corresponding first The fused feature representation and the final feature representation in layer messaging.
  5. 5. The method for reasoning the adaptive generalized knowledge graph of the conditional query according to claim 1, wherein the fusion process of the relational-aware dual-decoder specifically comprises: Symmetrical MLP decoder first constructs candidate tail entity Connection vector with header entity Wherein As candidate tail entity Through the process of The final representation after the layer messaging, For a pre-embedded representation of the header entity, The expression vector is spliced, and then symmetrical scoring is obtained through feedforward network calculation , Mapping functions for the MLP decoder; antisymmetric ComplEx decoder pass through a learnable matrix 、 Embedding and projecting the head entity pre-embedded representation, the candidate tail entity final representation and the query relation into a complex vector space to obtain , Is a head entity At the query The complex vector characteristic representation after complex vector space projection, As candidate tail entity At the query The complex vector characteristic representation after complex vector space projection, For inquiring about In a query relationship Complex vector feature representation after complex vector space projection, and calculating antisymmetric scoring based on three-linear inner product Wherein In the case of a complex conjugate operation, In order to take the real part of the operation, Scoring the result for antisymmetry; Learning scalar gating parameters for each relationship in an expanded set of relationships Query relationship for target queries Computing gating weights by sigmoid function Wherein Combining the weighting fusion two decoder scoring results to obtain the final scoring for the sigmoid activation function Wherein 0 Is a hyper-parameter that adjusts the scale of the antisymmetric branches, And (5) comprehensively scoring the result.
  6. 6. The method for reasoning the adaptive generalized knowledge graph of a conditional query of claim 5, wherein the full graph precoding and initial subgraph construction comprises: performing unsupervised message transmission with limited layer number on inductive test chart by adopting light pre-embedded chart neural network to generate each entity Is a pre-embedded representation of (2) Wherein In order to generalize the test pattern, Aggregation operators which are dependent graph structures and query relationships; Construction of two-layer feedforward neural network Pre-embedding entities into representations Pre-embedded representation of header entity Relationship with inquiry After splicing, inputting the network, calculating the relevant scores of the entities and the query ; Selecting the highest correlation score Personal entity and head entity Together form a starting point set Wherein To generalize the entity set of the test chart; At-head entity With a set of starting points Other starting points of Introducing new relationship types between Construction of a fast channel edge set Performing a message passing on the edge set, encoding the query condition into the initial representation of each starting point, and finally obtaining the node initial representation Wherein Time of day For the representation after the encoding it is possible, Time of day Is a zero vector.
  7. 7. The method for reasoning the adaptive generalized knowledge graph of claim 6, wherein the generalized test graph and the training graph are directed multi-relational graphs with entity layers being mutually disjoint, and the training graph is expressed as The generalized test chart is shown as Wherein In order to train the set of entities of the graph, To sum up entity sets of test patterns and satisfy , As a set of relationships that are to be shared, To train the fact triplet set of the graph, To generalize the fact triplet set of test patterns, all facts are in ordered triples Representation, i.e. header entity Through relation Tail pointing entity 。
  8. 8. The method for adaptively inducing knowledge graph reasoning in response to a conditional query of claim 1, wherein for a shared set of relationships Performing expansion processing, wherein the expanded relation set is that Wherein For each relationship in the shared relationship set, as an inverse relationship set Its inverse relationship Satisfy if triplet If true, triplet The same is true; For each entity, as a set of self-loop relationships Introducing self-loop relations The corresponding triples are The integrity and directional modeling capability of message passing are improved through relation set expansion.
  9. 9. The method for reasoning the self-adaptive induction knowledge graph of the condition-oriented query according to claim 1, wherein the method is characterized in that the cross entropy loss of all entities softmax is taken as an optimization target, parameters are continuously adjusted to improve the reasoning precision, and a loss function is defined as Wherein For a query in the training set and the corresponding real tail entity, And in the training process, adopting an Adam optimizer to perform random gradient descent optimization, applying an exponential decay strategy to the learning rate, monitoring according to the average reciprocal ranking on the verification set or the preset duty ratio index of correct answers, and executing early stop operation to avoid overfitting.
  10. 10. The self-adaptive induction knowledge graph reasoning system for the conditional query is characterized by comprising the following components: The data input unit is used for carrying out format verification and preprocessing on the input data by receiving the generalized test chart data and target query comprising a head entity and a query relation, so as to ensure that the data meets the subsequent processing requirements; The pre-coding sub-graph construction unit is internally provided with a light pre-embedding graph neural network and a related score calculation module, and is used for pre-coding the induction test graph to generate entity pre-embedding representation, screening an initial entity related to inquiry, constructing an initial sub-graph and generating node initial representation; The query perception message transfer unit integrates a conditional query attention module and a self-adaptive residual error fusion module, builds a query perception graph neural network architecture, dynamically updates node representation through multi-layer message transfer, and strengthens the transfer and aggregation of query related information; the double-decoder fusion unit comprises a symmetrical MLP decoding module, an antisymmetric ComplEx decoding module and a relation level gating module, and is used for respectively calculating symmetrical scoring and antisymmetric scoring, and obtaining the final scoring of the candidate tail entity through the gating mechanism fusion; And the reasoning result output unit is used for receiving the scoring results output by the double-decoder fusion unit, sequencing all candidate tail entities, generating a reasoning result list and outputting the reasoning result list, and supporting the visual display of the results.

Description

Self-adaptive induction knowledge graph reasoning method and system for conditional query Technical Field The invention relates to the technical field of knowledge graph reasoning, in particular to a method and a system for realizing self-adaptive induction knowledge graph reasoning of conditional query for accurately querying an unseen entity by learning structural modes and relational semantics. Background In the rapid evolution of artificial intelligence and semantic computation, a knowledge graph is used as a core carrier of structured knowledge, and key fields such as semantic search, intelligent question-answering, recommendation systems and the like are deeply energized to become a core infrastructure for supporting downstream intelligent application. The knowledge graph describes semantic association among entities through ordered triples, but the problem of imperfection commonly existing in the construction process severely restricts the upper performance limit of downstream application. Knowledge graph reasoning is used as a key technology for making up the defect, and aims to mine implicit facts from the existing triples, realize accurate prediction of missing relations or entities, and further relieve challenges brought by knowledge sparsity. However, due to the dynamic expansion characteristics of the knowledge graph in the real scene, the entity sets in the training stage and the reasoning stage often have significant differences, the traditional conduction type reasoning method relies on the embedded model of the fixed entity, so that the reasoning requirement of the emerging entity is difficult to adapt, and a generalized reasoning technology with the migration capability of the cross-entity set is needed. The generalized knowledge graph reasoning requires that the model transfers the learned structural mode and relation semantics to an unseen entity under the setting that the training graph and the testing graph entity are mutually disjoint, so as to realize the prediction of the emerging triples. The existing inductive reasoning method is mainly divided into three categories, namely three categories based on triplets, three categories based on paths and three categories based on a graph neural network. The method based on the triples is related to semantic modeling through low-dimensional vector embedding and scoring function modeling, but the induction capability of the method is limited due to the characteristic of fixed entity embedding, the method based on the paths has the problems of high path searching cost and insufficient rule generalization on a large-scale map although the method based on the paths has a certain interpretability by taking a path or logic rule as reasoning evidence, the method based on the graph neural network realizes joint modeling of structure and semantic information by means of a message transmission mechanism and becomes the main stream direction of induction reasoning, but the conventional model is easy to introduce irrelevant noise in multi-hop propagation, insufficient in query condition modeling and limited in the description capability of complex relation modes, and further improvement of reasoning precision is restricted. With the continuous expansion of the scale of the knowledge graph and the continuous increase of the complexity of the structure, the core challenges faced by inductive reasoning are increasingly highlighted. On one hand, in the multi-hop message transmission process, the traditional model lacks accurate perception of query conditions, so that a large amount of neighbor information irrelevant to target query is incorporated into aggregation, not only is calculation overhead increased, but also redundant noise is introduced, so that condition information attenuation and reasoning bias are caused, on the other hand, the problems of over-smoothness and gradient instability easily occur in deep network propagation, so that early key structure information is lost, the effectiveness of entity representation is affected, in addition, the modeling requirement of complex relation modes such as symmetry and antisymmetry is difficult to consider due to a single symmetrical or approximately symmetrical scoring function in a decoding stage, the expression capability of strong directivity relation is insufficient, and the suitability of the model in diversified relation scenes is limited. The problems commonly lead to the urgent improvement of the performance of the existing method in the scenes of long-distance reasoning, complex relation modeling and the like. In order to cope with the above challenges, the academic community needs to construct a generalized reasoning framework capable of adaptively capturing query conditions, stably transmitting structural information and efficiently modeling complex relations. Disclosure of Invention Based on the technical problems, the application discloses a conditional query-oriented self-adaptive generaliz