Information retrieval optimization method and system based on small sample knowledge graph completion
By using the GAKDN model, combined with a gated and role-aware neighbor aggregator, an entity pair information encoder, and an adaptive matching processor, the problems of entity noise and representation inconsistency in few-sample knowledge graph completion are solved, improving the accuracy and richness of information retrieval.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU DIANZI UNIV
- Filing Date
- 2023-07-28
- Publication Date
- 2026-05-26
Smart Images

Figure CN116955650B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information retrieval technology, and relates to an information retrieval optimization method and system based on small sample knowledge graph completion. Background Technology
[0002] With the rapid development of big data and the internet, people's reliance on information search has become increasingly strong. Currently, keyword-based full-text search is no longer sufficient to meet people's search needs. In this context, a knowledge graph-based information retrieval method has been proposed. This method extracts knowledge from large-scale unstructured data on the internet using a self-supervised open-ended Chinese relation extraction method, and constructs a knowledge graph based on a knowledge base in the relevant domain. Information retrieval is then performed by calculating semantic similarity based on the knowledge graph. Using this technology, the efficiency and accuracy of information retrieval results will be greatly improved, and it has significant application value in the fields of information retrieval and intelligent recommendation.
[0003] However, in practical applications, knowledge graphs often face the problem of incomplete data. Knowledge graph completion is a key technology to address this issue. It is particularly important in small-sample environments. By using a small amount of sample data and leveraging advanced machine learning methods, such as meta-learning, representations of entities and relationships can be learned, thus enabling knowledge graph completion. Combining knowledge graph completion with information retrieval can further enhance the performance of information retrieval. First, knowledge graph completion can provide richer and more accurate entity and relationship information, thereby enhancing semantic search capabilities. Second, by completing the information in the knowledge graph, the precision and richness of query expansion can be increased, better meeting users' information needs. Furthermore, knowledge graph completion can enhance the entity parsing and linking functions of information retrieval systems, thereby providing richer and more accurate search results.
[0004] Therefore, research on few-sample knowledge graph completion has great potential for optimizing information retrieval. However, traditional knowledge graph completion methods mostly require a large amount of sample information, which does not perform well in scenarios with few samples or low resources, and knowledge graphs suffer from the long-tail problem. Existing knowledge graph completion models mainly focus on introducing meta-learning metrics into knowledge graph completion, and some advanced results have been achieved. However, existing completion methods do not adequately address issues such as neighbor noise in triples, the different meanings of head and tail entities in different few-sample relationships, and the lack of effective integration of structural information in entity pair representations in few-sample scenarios. Summary of the Invention
[0005] One objective of this invention is to address the shortcomings of existing knowledge graph completion techniques in resolving issues such as noisy neighboring entities, inconsistent entity representations across different relations, and low-quality entity pair embeddings. This invention provides a knowledge graph completion method that combines attention gating and knowledge distillation. The method, termed GAKDN, consists of a gating and role-aware neighbor aggregator, an entity pair information encoder, and an adaptive matching processor. It effectively filters noisy neighbor information and integrates effective neighbor information using the gating and role-aware neighbor aggregator, learning adaptive entity embeddings. Then, in the entity pair information encoder, knowledge distillation is used to extract the implicit information between entity pairs corresponding to small sample relations and their neighbors, thereby improving the accuracy of the completion prediction.
[0006] The technical solution adopted in this invention is as follows:
[0007] Step 1: First, obtain the dataset related to information retrieval. The dataset contains multiple small sample relations r, which are divided into training, testing, and validation relations.
[0008] Step 2: For each small sample relation r, construct the corresponding support set, candidate set, positive query set, and negative query set;
[0009] Step 3: Construct a small-sample knowledge graph completion model GAKDN and train it. The optimal parameter model is obtained after the model parameters converge.
[0010] Step 4: Use the trained small-sample knowledge graph completion model GAKDN to complete and predict the tail entities of triples.
[0011] Another objective of this invention is to provide an information retrieval optimization system based on few-shot knowledge graph completion, including a trained few-shot knowledge graph completion model GAKDN.
[0012] Another object of the present invention is to provide a computer-readable storage medium storing a computer program for a knowledge graph completion method based on few-shot learning, wherein when the program for the knowledge graph completion method based on few-shot learning is executed by a processor, the computer performs the above-described method.
[0013] Another objective of this invention is to provide a computing device for knowledge graph completion based on few-shot learning, including a memory and a processor. The memory contains executable code for a knowledge graph completion method based on few-shot learning that can run on the processor. When the processor executes the executable code, it implements the aforementioned method.
[0014] The technical solution provided by this invention has the following beneficial effects:
[0015] This invention proposes a novel deep neural network model (Gated Attention and Knowledge Distillation Network, GAKDN), which includes a gated and role-aware neighbor aggregator, an entity pair information encoder, and an adaptive matching processor. After being trained using a meta-learning method, this model achieves completion of tail entities in knowledge graph triples.
[0016] This invention utilizes a gating mechanism in the neighbor aggregator module to effectively filter neighbor noise information, reducing the impact of noise on entity embedding learning. Based on this, a role recognition network learns the deep associations between entities and neighbor relationships, thereby identifying the role of an entity under different few-sample relationships. Through roles with different semantics, the model can effectively extract fine-grained meanings between few-sample relationships and head-and-tail entities, thus obtaining more expressive entity representations and ultimately improving the accuracy of completion prediction.
[0017] This invention addresses the problem of insufficient entity pair representation in small sample scenarios by using a knowledge distillation network in the entity pair information encoder to extract the structural information between entity pairs corresponding to small sample relationships and learn the correlation between each layer of the encoder. This alleviates the problem of insufficient sample representation to a certain extent and improves the accuracy of completion prediction. Attached Figure Description
[0018] Figure 1 This is a flowchart of the method of the present invention;
[0019] Figure 2 This is a structural diagram of the knowledge graph completion model based on few-shot learning in this invention;
[0020] Figure 3 A diagram of the knowledge distillation method; Detailed Implementation
[0021] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0022] An information retrieval optimization method, the specific process of which is described as follows: Figure 1 As shown, the specific steps include:
[0023] Step 1: First, obtain the dataset related to information retrieval. The dataset contains multiple small sample relations r, which are divided into training, testing, and validation relations. A specific small sample relation r includes multiple different triples. Each triple consists of a head entity, the small sample relation r, and a tail entity.
[0024] Step 2: Construct the support set, candidate set, positive query set, and negative query set required for training (input to the representation layer).
[0025] For each few-sample relation r, head and tail entity pairs are randomly selected from the triples in the training set, and then a support set is constructed. and positive example query set Where h i Let t represent the i-th head entity. i Let K represent the i-th tail entity, and K represent the support set. The number of triples in the middle This indicates the number of triples in the positive query set;
[0026] Based on the header entity h of the positive example query set j Constructing candidate sets based on type constraints of the small sample relation r Using t j Different tail entities, This represents the number of triples in the candidate set, and it must satisfy...
[0027] Using candidate sets Randomly replace the tail entity in the positive query set The tail entity in the middle is used to construct the negative query set.
[0028] Perform the following operation on the support set and positive / negative query set: Obtain the neighborhood of the first and last entities in the triples of the support set or positive / negative query set, denoted as . Indicates the neighbors of the head entity h. Let represent the neighbors of the tail entity t. For ease of description, both the head entity h and the tail entity t are defined as entity e, and the neighbors of entity e are . in and Each element in is a pair This represents the i-th neighbor relationship of entity e. This represents the i-th neighboring entity of entity e;
[0029] Step 3: Construct the small-sample knowledge graph completion model GAKDN and train it.
[0030] The overall structure of the small-sample knowledge graph completion model GAKDN is as follows: Figure 2 As shown.
[0031] During the training phase, the few-shot knowledge graph completion model GAKDN receives a labeled support set. The model contains |K| triples, and corresponding positive and negative query sets; the learning objective of the model is: for each head entity-relation pair (h) in the positive query set... j(r) and its corresponding real tail entity t j The model should provide a high prediction probability, such that t j In the candidate entity set The ranking in the query set should be as high as possible; while for each head entity-relation pair (h) in the negative query set... j (r) and its corresponding error tail entity The model should produce low prediction probabilities, so that In the candidate entity set The ranking should be as low as possible.
[0032] The small-sample knowledge graph model GAKDN consists of three parts: a gated and role-aware neighbor aggregator, an entity pair information encoder, and an adaptive matching processor.
[0033] (1) Gated and Role-Aware Neighborhood Aggregator:
[0034] The main goal of the neighbor aggregator is to learn fine-grained representations of the head and tail entities in triples. It mainly consists of three modules: an attention gating module, an attention network module, and a few-shot relation role recognition module, as detailed below:
[0035] a) The attention gating module filters noise introduced during the encoding of sparse neighborhoods in representing small sample relationships. It filters noisy neighbor information based on attention weights and automatically captures the most valuable neighbor information to learn entity representations. It includes the following steps:
[0036] Specifically, given a small sample relation r corresponding to the triplet entity pair (h,t), its neighborhood is denoted as: The i-th neighbor relationship and neighbor entities of entity e It is expressed as follows:
[0037]
[0038]
[0039] Where W1 is a linear transformation matrix; U1 is a weighted vector; c i yes Aggregate representation; d i Let be the importance score of the i-th neighbor of entity e; LeakyReLU represents the activation function.
[0040] To obtain the attention weight α for each neighbor i Applying the softmax function to d i Above, as shown below:
[0041]
[0042] To eliminate noisy neighbors caused by sparse neighborhoods, a gating value g is needed to determine the activation level of the neighborhood of entity e; the formula for the gating value g is as follows:
[0043]
[0044] Where U2 represents the weight vector, b g represents the scalar bias parameter, and sigmoid represents the activation function.
[0045] Based on the gating mechanism, neighborhood aggregation is represented as c i Combined with entity e, we obtain the representation e′ of half the neighborhood of the small sample relation r:
[0046]
[0047] Where W2 represents the weight matrix, b is the bias vector parameter; e ′ This represents the representation of half the neighborhood of a small sample relation r, or h if it corresponds to a head entity. ′ The corresponding tail entity is represented as t. ′ .
[0048] b) Attention network module. This utilizes the representation e of half the neighborhood of the small-sample relation r. ′ The input representation of the support set is constructed and fed into a Bi-LSTM. Then, the neighborhood representation vector at each time step is encoded forward and backward, and concatenated to obtain global features of contextual information, thereby learning a general representation of few-sample relationships. Specifically, this includes:
[0049] The encoding formula for the input representation s of the support set is as follows:
[0050] s = [h ′ ;t ′ (6)
[0051] Where [;] represents aggregation operation, h ′ and t ′ From formula (5), the input representation s of the support set is represented as a sequence s1, s2, ..., s K The number is K.
[0052] Then, a bidirectional long short-term memory network (Bi-LSTM) with m hidden units is used to encode the input representation s at given time steps i and i-1 in both forward and backward directions. The formulas for calculating the forward and backward hidden states at time steps i and i-1 are as follows:
[0053]
[0054]
[0055] in and These are the hidden states of the forward encoding of the Bi-LSTM at time steps i and i-1. and W represents the hidden states of the inverse encoding of the Bi-LSTM at time steps i and i-1. h1 W s1 W h2 W s2 The parameter matrix representing the Bi-LSTM; This represents the i-th forward input representation. This represents the (K-i+1)th backward input representation.
[0056] The final hidden states from the forward and backward directions are concatenated into a single vector p. i This vector can be further encoded into p′ through a linear transformation. i Where W3 is the linear transformation matrix, its formula is as follows:
[0057]
[0058] p′ i =W3p i (10)
[0059] Where [;] represents the aggregation operation, and W3 represents the weight matrix;
[0060] Then, the weight β for each final hidden state is calculated using an attention mechanism. i The formula is as follows:
[0061]
[0062]
[0063] Where U3 represents the weight vector; b a Indicates scalar bias parameter;
[0064] The final hidden state of Bi-LSTM is determined by the weight β. i With p′ i The product of these products and their summation is given by the following formula:
[0065]
[0066] Where r′ represents the task relation representation of entity e, which is obtained by integrating all neighborhood representations on the triple support set or query set.
[0067] c) Small sample relation role recognition module. Used to identify a relation that reflects a role of an entity, mainly based on task relation r′ and adjacency relation r. nbr The correlation between them is used to distinguish the roles of head and tail entities. Specifically:
[0068] First, define a measurement function. The correlation score is calculated using the bilinear dot product, as shown in the following formula:
[0069]
[0070] Where r′ is obtained by formula (13), W4 represents the weight vector, and b represents the scalar bias parameter;
[0071] Then, by considering the different roles of the head and tail entities, the neighbor embedding c for role perception is obtained using an attention mechanism. nbr The formula is as follows:
[0072]
[0073]
[0074] This means that when the adjacent relationship r nbr The greater the correlation with the task relationship r′, The higher the value, the greater the role of the corresponding neighboring entity in the neighboring embedding.
[0075] To enhance the head and tail entity embeddings, a pre-trained entity embedding h and its role-aware neighbor embedding c are used. nbr When coupled, the formula is as follows:
[0076] f(e) = σ(W5e + W6c) nbr (17)
[0077] Where σ(·) represents the ReLU activation function; W5 and W6 are learnable weight parameters; the augmented head entity is denoted as f(h), and the augmented tail entity is denoted as f(t).
[0078] The entity representation obtained in this way has the following characteristics: 1) it retains the individual attributes established by the current embedding model; 2) it has different roles to adapt to different tasks.
[0079] (2) Transformer encoder for entity pairs:
[0080] The entity pair information encoder is used to learn entity pair representations and consists of two modules: an entity pair learning module and a knowledge distillation module.
[0081] a) The entity pair learning module is based on the enhanced entity f(e), and combines the relative position information (i.e., index subscripts) of the entity sequence as input to the Transformer encoder to obtain fine-grained embeddings of entity pairs. Specifically:
[0082] The enhanced entities f(h) and f(t) are respectively regarded as The intermediate vector generated by the masking mechanism is considered as The final sequence
[0083] The representation of each element in x is constructed as follows:
[0084]
[0085] in This represents the relative position embedding of f(h), f(t), and the intermediate vector, so the length of the position embedding is fixed at 3;
[0086] After constructing all input representations, The input x is encoded in the Transformer encoder at layer L, where the formulas from layer l-1 to layer l are as follows:
[0087]
[0088] in Indicates x after layer l m The hidden state.
[0089] The Transformer employs a multi-head self-attention mechanism, where each block allows each element to pay attention to all elements in the sequence with different weights; the final hidden state after l layers of Transformers... The final output of entity pairs, namely the entity pair representation s of the support set. r The entity pair representation q of the positive query set r Entity pairs of negative query sets
[0090] b) The knowledge distillation module further extracts fine-grained information about entity pairs based on the structural information between the head and tail entities and the relationships between small samples. Specifically:
[0091] The main approach is to learn the correlations between vectors in each layer of the Transformer using a relation-based knowledge distillation method, as shown in the following formula:
[0092]
[0093] Among them, f l+1 This represents the l+1 layer of the Transformer. Aggregate output, similarly f l Represents the l-th layer of the Transformer Aggregate output, and This represents a function for calculating similarity.
[0094] Figure 3 A detailed flowchart of the Transformer encoder for entity pairs.
[0095] (3) Adaptive Matching Processor:
[0096] The adaptive matching processor considers the different semantics of task relationships and compares the positive and negative query sets with the support set to make predictions. Specifically:
[0097] The entity pair representation q of the positive query set r The embedding representation s of the k-th entity pair in the support set rk The metric function is obtained by calculating the dot product:
[0098] δ(q r ,s rk )=q r ·s rk (twenty one)
[0099] Where s rk The final hidden state is determined by formula (19). get.
[0100] Then, an attention mechanism is used to assign different weights to the support set triples, capturing their subtle meanings. This makes support set entity pairs with similar meanings to the query set more referential, ultimately enabling the representation of the support set s. r It has an adaptive representation effect for different query triples, and its formula is as follows:
[0101]
[0102]
[0103] Where β k q represents the attention score supporting the k-th entity pair in the support set; r Represents the set of positive query examples; This represents the aggregate representation of the support set that has received attention weights.
[0104] To make predictions, a positive example score is defined. Used to measure positive query q r and Semantic similarity between them:
[0105]
[0106] Similarly, the entity pair representation of the negative example query set The embedding representation s of the k-th entity pair in the support set rk The metric function is obtained by calculating the dot product:
[0107]
[0108] To make predictions, a negative example score is defined. Used to measure negative queries and Semantic similarity between them:
[0109]
[0110] If the query meets the criteria, the expected value of φ(·) will be relatively large; conversely, a small value indicates that the query does not meet the criteria. Here, φ(·,·) can also be implemented using alternative metrics such as cosine similarity or Euclidean distance.
[0111] The parameterized learning process designs a loss function based on the score calculated by the adaptive matching processor and solves for the model parameters. The formula is as follows:
[0112]
[0113] The standard hinge loss function is defined as [x]. + =max(0,x), where γ represents a manually set hyperparameter. This represents the score calculated between the negative query set and the support set. L represents the score calculated between the positive query set and the support set. CC It is obtained from formula (20);
[0114] The parameter training process of the neural network is completed by iteratively finding the minimum value of the loss function through the gradient descent optimization algorithm.
[0115] Step 3: Utilize the trained knowledge graph completion model GAKDN based on few-shot learning to complete the tail entities of the knowledge graph in few-shot scenarios, thereby optimizing the information retrieval capability of the knowledge graph.
[0116] The performance of this invention was evaluated on two benchmark datasets: the NELL-One and Wiki-One public benchmark datasets. Relations with few triples were selected for few-shot learning tasks. The remaining relations were called background relations because their triples provided important background knowledge for matching entity pairs. The first dataset was based on NELL, a system that continuously collects structured knowledge through a reading network. The latest data dump was used, and inverse relations were removed. Relations with 50 to 500 triples were selected for a single learning task. To demonstrate that this model can operate on large-scale knowledge graphs, we followed a similar process to construct another, larger dataset based on Wikidata. The Wiki-One dataset is an order of magnitude larger than any other benchmark dataset in terms of the number of entities and triples. For NELL-One, this method used 51 / 5 / 11 task relations for training / validation / testing. For Wiki-One, the split ratio was 133:16:34. The following table shows the data volume of this dataset:
[0117] Dataset Entity Number Relationships Triplet number Number of tasks NELL-One 68,545 358 181109 67 Wiki-One 4,838,244 822 5,859,240 183
[0118] The experiment uses the mean reciprocal ranking (MRR) and the hit rate (Hits@n) among triples with a ranking less than or equal to N as performance evaluation metrics for knowledge graph completion.
[0119] According to the definition of Mean Reciprocal Rank (MRR): for a given dataset, the mean reciprocal rank is the average of the sum of the reciprocals of the predicted rank of each triplet link. This allows us to derive the calculation method for the mean reciprocal rank in knowledge graph completion tasks.
[0120]
[0121] Where S is the set of triples, |S| is the number of triple sets, and rank is... i This refers to the predicted rank (distance score) of the link in the i-th triple. A higher MRR value indicates that the rank is consistent with reality, and therefore the embedding effect is better.
[0122] Based on the definition of hit rate (Hits@n): for a given dataset, the hit rate is the average proportion of triples ranked less than or equal to N in link prediction. Therefore, the hit rate in the knowledge graph completion task can be calculated as follows:
[0123]
[0124] Where Ⅱ(·) is the indicator function (the function value is 1 if the condition is true, otherwise it is 0). Generally, n is taken as 1, 5 or 10, and the larger the HITS@n index, the better.
[0125] The table below shows the results of small-sample knowledge graph completion using the above two datasets:
[0126] Table 1: Comparison of experimental results on the NELL-One dataset
[0127]
[0128] Table 2: Comparison of experimental results on the WIKI dataset
[0129]
[0130]
[0131] To evaluate the effectiveness of our method, we compare it with the following two sets of baselines: 1. Knowledge Graph Embedding Methods. These methods learn entity / relation embeddings by modeling the relation structure in a knowledge graph. Five widely used methods are used as baselines: TransE, DistMult, ComplEx, SimpleE, and RotatE. All knowledge graph embedding methods require sufficient training triples for each relation and learn a static representation of the knowledge graph. 2. Few-Shot Relation Learning Methods. This method achieves state-of-the-art few-shot knowledge graph completion performance on the NELL-One and Wiki-One datasets. GMatching employs a neighborhood encoder and a matching network, but assumes that all neighbors contribute equally. FSRL uses a fixed attention mechanism to encode neighbors and applies a recurrent autoencoder to aggregate references. MetaR makes predictions by passing shared knowledge from references to queries based on a novel optimization strategy. FAAN employs a neighborhood encoder and a matching network. It learns dynamic representations of entities or references, ignoring the interference of neighbor noise and the problem of insufficient representation.
[0132] In the table of few-shot knowledge graph completion results above, GAKDN is the few-shot learning-based knowledge graph completion method proposed in this invention. Tables 1 and 2 show the performance of all models on NELL-One and Wiki-One. The tables show that: (1) Compared with traditional knowledge graph embedding methods, this model achieves better performance on both datasets. Experimental results show that the few-shot learning method used in this model is more suitable for solving few-shot problems. (2) Compared with the baseline of few-shot relation learning methods, this model performs well in all metrics on both datasets. Compared with the best-performing baseline FAAN, GAKDN improves MRR / Hits@10 by 3.3% / 3.2% on the NELL-One test data and by 1.5% / 3.1% on the Wiki-One test data. This shows that using gating, attention networks, and knowledge distillation can indeed improve the performance of few-shot knowledge graph completion.
Claims
1. An information retrieval optimization method based on small-sample knowledge graph completion, characterized in that... Includes the following steps: Step (1): First, obtain the dataset related to information retrieval. The dataset contains multiple small sample relationships. A specific small sample relationship It includes multiple different triples, each triple consisting of a head entity and a small sample relation. It consists of a tail entity; Step (2): Construct the support set, candidate set, positive query set, and negative query set required for training; Step (3): Construct the small-sample knowledge graph completion model GAKDN and train it; The small-sample knowledge graph completion model GAKDN includes a gated and role-aware neighbor aggregator, an entity pair information encoder, and an adaptive matching processor. The gated and role-aware neighbor aggregator is used to learn fine-grained representations of the head and tail entities in the triples, including an attention gate module, an attention network module, and a few-shot relationship role recognition module; The attention gating module is used to filter noise introduced during the encoding of sparse neighborhoods in the process of representing small sample relationships. It filters noise information of neighbors according to attention weights and automatically captures the most valuable neighbor information to learn entity representations. The attention network module utilizes small sample relationships. Representation of half of the neighborhood The input representation of the support set is constructed and fed into Bi-LSTM. Then, the neighborhood representation vector at each time step is encoded forward and backward respectively, and concatenated to obtain the global features of the context information, so as to learn the general representation of small sample relationships. The small-sample relationship role recognition module is used to identify a role that reflects an entity in a relationship, based on the task relationship. Relations with neighbors The correlation between them is used to distinguish the roles of head or tail entities; The entity pair information encoder is used to learn entity pair representations, including an entity pair learning module and a knowledge distillation module; The entity pair learning module is based on augmented entities. The relative position information of the entity sequence is then input into the Transformer encoder to obtain fine-grained embeddings of entity pairs. The knowledge distillation module further extracts fine-grained information about entity pairs based on the structural information between the head and tail entities and the small sample relationships. The adaptive matching processor compares the positive and negative query sets with the support set to make predictions. Step (4): Use the trained knowledge graph completion model GAKDN based on few-shot learning to complete the tail entity of the knowledge graph in the few-shot scenario, so as to optimize the information retrieval capability of the knowledge graph.
2. The method according to claim 1, characterized in that... The attention gating module is specifically: First, a small sample of relationships is given. Corresponding triplet entity pairs Its neighborhood is: ;in, Represents head entity Neighbors Represents tail entity The neighbor, will the head entity Tail-end entity All are defined as entities ,entity The neighbor is ;in and Each element in is a pair , Representing entities The Neighborly relations, Representing entities The Neighboring entities; entities The Neighbor relationships and neighbor entities , means as follows: in It is a linear transformation matrix; It is a weighted vector; yes Aggregate representation; It is a physical entity The The importance score of each neighbor; To obtain the attention weight for each neighbor ,application The function is in superior: Use gating values Entity The activation level of the neighborhood; the gating value The formula is as follows: in Represents the weight vector. Indicates the scalar deviation parameter; Based on the gating mechanism, neighborhood aggregation is represented... With entity By combining these methods, we can obtain small sample relationships. Representation of half of the neighborhood : in Represents the weight matrix. It is the bias vector parameter.
3. The method according to claim 2, characterized in that... The small sample relationship role recognition module is specifically: First, define a measurement function. The correlation score is calculated using the bilinear dot product, as shown in the following formula: in Represents the entity output by the attention network module The task relationship is represented as follows: Represents the weight vector. Indicates scalar bias parameter; Obtaining neighbor embeddings for role perception using attention mechanisms The formula is as follows: in Indicates task relationship Relations with neighbors Attention weights based on relevance; Represents head entity Neighbors; To enhance the entity By entity And role-aware neighbor embedding When coupled, the formula is as follows: in Represents the ReLU activation function; These are learnable weight parameters.
4. The method according to claim 3, characterized in that... The knowledge distillation module is specifically: The correlation between vectors in each layer of the Transformer is learned through a relation-based knowledge distillation method, as shown in the following formula: in, Represents the entity's relationship to the learning module. Layer , , Aggregated output, Represents the entity's relationship to the learning module. Layer , , Aggregated output, This represents a function for calculating similarity.
5. The method according to claim 4, characterized in that... The loss function of the small-sample knowledge graph completion model GAKDN is as follows: in , This refers to manually set hyperparameters. This represents the score calculated between the negative query set and the support set. This represents the score calculated between the positive query set and the support set. It is obtained from formula (10).
6. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-5.
7. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-5.