A knowledge completion method and system based on relationship feature extraction
By combining private and shared feature extraction networks with meta-learning ideas, the problem of incomplete knowledge graphs in small sample scenarios is solved, achieving efficient knowledge completion without relying on background knowledge, and is suitable for the generation and completion of complex relationships.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG UNIV OF TECH
- Filing Date
- 2023-02-16
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies struggle to effectively handle the incompleteness of knowledge graphs in small-sample scenarios, especially the generation and completion of complex relationships, which rely heavily on background knowledge and have poor versatility.
We adopt a knowledge completion method based on relation feature extraction. By combining private and public feature extraction networks with the idea of meta-learning (MAML), we can quickly update relation feature representations and use TransD to calculate the scores of the reference set and query set to improve knowledge completion capabilities.
It can effectively handle complex relationships in small sample scenarios without relying on background knowledge, improve knowledge completion capabilities, and is suitable for small sample relationship scenarios.
Smart Images

Figure CN116127017B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a knowledge completion method and system based on relation feature extraction. Background Technology
[0002] The rapid dissemination of knowledge graphs has transformed various AI-based applications with remarkable results, such as recommendation systems, semantic search, social policy analysis, and question answering. However, as knowledge evolves, knowledge graphs also require continuous updates, meaning most are inherently incomplete. In related technologies, knowledge completion models independently process triples within the knowledge graph, relying heavily on background knowledge triples. This results in poor generality in small-sample scenarios and difficulty in generating trainable instances for knowledge completion. Furthermore, handling complex relationships in small-sample scenarios becomes even more challenging. Therefore, the technical problems in these technologies urgently need to be addressed. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a knowledge completion method and system based on relation feature extraction, so as to improve knowledge completion capabilities.
[0004] On the one hand, the present invention provides a knowledge completion method based on relation feature extraction, the method comprising:
[0005] Obtain the training task triple set, and preprocess the training task triple set to obtain the first reference set, the second reference set, the first query set, and the second query set.
[0006] The first reference set is processed by a private feature extraction network to obtain a third reference set, which includes private feature representations.
[0007] The third reference set is processed by a common feature extraction network to obtain the first sample relationship feature representation.
[0008] Based on the sample relationship feature representation, reference set scores are calculated for the first reference set and the second reference set to obtain the reference set loss.
[0009] The sample relationship feature representation is updated based on the loss gradient of the reference set loss to obtain the second sample relationship feature representation;
[0010] Based on the second sample relationship feature representation, query set scores are calculated for the first query set and the second query set to obtain the query set loss.
[0011] Optionally, the preprocessing of the training few-sample relation task triplet set to obtain a first reference set and a second reference set, a first query set and a second query set includes:
[0012] Randomly select entity pairs of triples from the training task triple set to obtain the first reference set, and use the remaining triples in the training task triple set as the first query set.
[0013] The tail entity types of the training task triple set are collected and processed to obtain the tail entity set;
[0014] The tail entities in the first reference set are removed, and the tail entities are randomly selected from the tail entity set for entity pair combination to obtain the second reference set; the remaining triples in the tail entity set are used as the second query set.
[0015] Optionally, the step of performing private feature extraction processing on the first reference set according to the private feature extraction network to obtain a third reference set, the third reference set including private feature representation, including:
[0016] The entity pairs in the first reference set are spliced together to obtain spliced entity pairs;
[0017] The concatenated entity pair is input into the private feature extraction network for feature extraction processing to obtain a third reference set, which includes private feature representations.
[0018] Optionally, the step of extracting common features from the third reference set using a common feature extraction network to obtain a first sample relationship feature representation includes:
[0019] The third reference set is superimposed to obtain a superposition matrix;
[0020] The first feature representation set is obtained by performing interactive information extraction processing on the superimposed matrix based on the first convolution kernel.
[0021] The first feature representation set is processed by the second convolution kernel to obtain the second feature representation set;
[0022] The second feature representation set is stacked and then processed by a third convolution kernel to extract features, resulting in the first sample relationship feature representation.
[0023] Optionally, the step of calculating the loss between the first reference set and the second reference set based on the first sample relationship feature representation to obtain the reference set loss includes:
[0024] Based on the first sample relation feature representation, the entity pair score of the first reference set is calculated to obtain the first score;
[0025] Based on the first sample relationship feature representation, the entity pair score of the second reference set is calculated to obtain the second score;
[0026] The loss is calculated based on the first score and the second score to obtain the reference set loss.
[0027] Optionally, updating the first sample relation feature representation based on the reference set loss to obtain the second sample relation feature representation includes:
[0028] Obtain the relational feature representation of the first sample;
[0029] The loss gradient is calculated based on the loss of the reference set.
[0030] The first sample relationship feature representation is updated based on the loss gradient to obtain the second sample relationship feature representation.
[0031] Optionally, based on the second sample relation feature representation, query set scores are calculated for the first query set and the second query set to obtain the query set loss, including:
[0032] The second sample relationship feature representation is obtained;
[0033] Based on the second sample relationship feature representation, the entity pair score of the first query set is calculated to obtain the first query score;
[0034] The entity pair score is calculated on the second query set based on the second sample relation feature representation to obtain the second query score;
[0035] The query set loss is obtained by calculating the loss based on the first query score and the second query score.
[0036] On the other hand, embodiments of the present invention also provide a knowledge completion system based on relation feature extraction, the system comprising:
[0037] The first module is used to obtain a set of training task triples, and to preprocess the set of training task triples to obtain a first reference set, a second reference set, a first query set, and a second query set.
[0038] The second module is used to perform private feature extraction processing on the first reference set according to the private feature extraction network to obtain a third reference set, wherein the third reference set includes private feature representations.
[0039] The third module is used to perform common feature extraction processing on the third reference set according to the common feature extraction network to obtain the first sample relationship feature representation;
[0040] The fourth module is used to perform reference set score calculation processing on the first reference set and the second reference set according to the sample relationship feature representation, so as to obtain the reference set loss;
[0041] The fifth module is used to update the sample relationship feature representation based on the loss gradient of the reference set loss to obtain the second sample relationship feature representation.
[0042] The sixth module is used to calculate the query set score of the first query set and the second query set based on the second sample relationship feature representation, so as to obtain the query set loss.
[0043] Optionally, the first module is configured to obtain a set of training task triples, preprocess the set of training task triples to obtain a first reference set, a second reference set, a first query set, and a second query set, including:
[0044] The first unit is used to randomly select entity pairs of several triples from the training task triple set to obtain a first reference set, and use the remaining triples in the training task triple set as the first query set.
[0045] The second unit is used to collect and process the tail entity types of the training task triple set to obtain the tail entity set.
[0046] The third unit is used to remove tail entities from the first reference set, randomly select tail entities from the tail entity set for entity pair combination processing to obtain the second reference set, and use the remaining triples in the tail entity set as the second query set.
[0047] Optionally, the second module is configured to perform private feature extraction processing on the first reference set according to the private feature extraction network to obtain a third reference set, the third reference set including private feature representations, including:
[0048] The fourth unit is used to concatenate entity pairs from the first reference set to obtain concatenated entity pairs.
[0049] The fifth unit is used to input the spliced entity pair into the private feature extraction network for feature extraction processing to obtain a third reference set, which includes private feature representations.
[0050] Compared with existing technologies, the present invention has the following technical effects: The embodiments of the present invention, through private feature extraction networks and shared feature extraction networks, can extract the private and shared relationship features implied in entity pairs; furthermore, by calculating the scores of the reference set and query set, the present invention has the ability to handle complex relationships in small sample scenarios, and utilizes the idea of loss gradients to enable the rapid convergence of small sample relationship feature representations to achieve the final rapid enhancement effect, thereby enhancing the ability to complete knowledge without providing background knowledge. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is a flowchart of a knowledge completion method based on relation feature extraction provided in an embodiment of this application. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] First, let's analyze some of the terms used in this application:
[0055] Knowledge Graph (KG) is a modern theory that combines theories and methods from applied mathematics, computer graphics, information visualization, and information science with methods such as bibliometric citation analysis and co-occurrence analysis. It uses a visual graph to vividly display the core structure, development history, cutting-edge fields, and overall knowledge architecture of a discipline, thereby achieving the goal of multidisciplinary integration.
[0056] Knowledge graph completion (KGC): Because knowledge graphs are inherently incomplete, most existing knowledge graphs are sparse. This leads to knowledge graph completion techniques to add new triples to the knowledge graph.
[0057] MAML (Model-Agnostic-Meta-Learning) is one category of Meta-learning (also known as Learn-to-Learn).
[0058] Since knowledge graphs are always incomplete, existing knowledge is typically used to predict new facts, thus completing and expanding the existing knowledge graph. However, due to the long-tailed distribution of relations in knowledge graphs, small-sample relations lacking trainable entity pairs are widespread. In related technologies, knowledge graph completion methods rely on a large number of background knowledge triples, making them unsuitable for small-sample scenarios.
[0059] In view of this, refer to Figure 1 This invention provides a knowledge completion method based on relation feature extraction, comprising:
[0060] S101. Obtain the training task triple set, and preprocess the training task triple set to obtain the first reference set, the second reference set, the first query set, and the second query set.
[0061] S102. Perform private feature extraction processing on the first reference set according to the private feature extraction network to obtain a third reference set, wherein the third reference set includes private feature representation;
[0062] S103. Perform common feature extraction processing on the third reference set according to the common feature extraction network to obtain the first sample relationship feature representation;
[0063] S104. Based on the sample relationship feature representation, perform reference set score calculation processing on the first reference set and the second reference set to obtain the reference set loss;
[0064] S105. Update the sample relationship feature representation according to the loss gradient of the reference set loss to obtain the second sample relationship feature representation;
[0065] S106. Based on the second sample relationship feature representation, perform query set score calculation processing on the first query set and the second query set to obtain the query set loss.
[0066] In this embodiment of the invention, a training task triplet set is first obtained, which consists of all triples (h, r, t) for each training task (i.e., a few-sample relation r). By preprocessing the training task triplet set, a first reference set and a second reference set are obtained. The first reference set consists of triples randomly selected from five few-sample relations, with the remaining triples serving as the first query set. The second reference set is constructed from the first reference set, and similarly, the second query set is constructed from the first query set. Then, a private feature extraction network is used to extract private features from the first reference set of the training tasks, resulting in private features. Next, a common feature extraction network is used to extract common features from the first reference set containing the private features, resulting in common features, thus obtaining a feature representation representing the few-sample relation. Finally, the loss between the first and second reference sets is calculated based on the private and common features to obtain a reference set loss. The feature representation representing the few-sample relation is then updated based on the reference set loss, resulting in a final representation representing the few-sample relation. This feature representation is used to calculate the first query set score and the second query set score, and to calculate the final loss. This invention extracts private and shared relationship features from entity pairs through private and shared feature extraction networks. It also enables the processing of complex relationships by rapidly updating the relationship feature representation through meta-learning (MAML) and calculating reference and query set scores through TransD. This improves knowledge completion capabilities and is applicable to small-sample relationship scenarios.
[0067] Further, as a preferred embodiment, in step S101 above, the preprocessing of the training small sample relation task triplet set to obtain a first reference set and a second reference set, a first query set and a second query set includes:
[0068] Randomly select entity pairs of triples from the training task triple set to obtain the first reference set, and use the remaining triples in the training task triple set as the first query set.
[0069] The tail entity types of the training task triple set are collected and processed to obtain the tail entity set;
[0070] The tail entities in the first reference set are removed, and the tail entities are randomly selected from the tail entity set for entity pair combination to obtain the second reference set; the remaining triples in the tail entity set are used as the second query set.
[0071] In this embodiment of the invention, several entity pairs of triples are randomly selected from the training task triple set to obtain the first reference set, which is the entity pair form (h) under relation r.i ,t i The set S r The remaining triplet entity pairs are used as the first query set Q. r In one feasible implementation, five entity pairs from the training task triplet set are randomly selected to obtain the first reference set, and the remainder constitutes the first query set. Next, this embodiment of the invention collects the tail entity types of all triples in the training task triplet set, and constructs a tail entity set C for the relation based on the collected entity types. r Finally, the tail entities of the first reference set are corrupted, and tail entities are randomly selected from the tail entity set for entity pair combination processing to obtain the second reference set. This second reference set is formed by randomly selecting entities from each entity pair of the first reference set according to the original tail entity type to create a pseudo-entity pair. Thus, the second reference set is obtained. Similarly, the tail entities of the first query set are corrupted, and tail entities are randomly selected from the tail entity set for entity pairing to obtain the second query set. This second query set is formed by randomly selecting entities from each entity pair of the first query set according to the original tail entity type to create a pseudo entity pair. Thus, the second reference set is obtained.
[0072] As a further preferred embodiment, in step S102 above, the private feature extraction processing of the first reference set according to the private feature extraction network to obtain a third reference set, the third reference set including private feature representation, including:
[0073] The entity pairs in the first reference set are spliced together to obtain spliced entity pairs;
[0074] The concatenated entity pair is input into the private feature extraction network for feature extraction processing to obtain a third reference set, which includes private feature representations.
[0075] In this embodiment of the invention, a two-layer fully connected network is used as the private feature extraction network to transform the entity pairs (h,t) of the triple set into corresponding embeddings. Then, the two are concatenated to obtain a concatenated entity pair, which is used as the input of the private feature extraction network to obtain a representation of private relation features in the private space, as shown below:
[0076] ht hidden =W1[h,t];
[0077] r unique =W2ht hidden ;
[0078] Where, h∈R d , t∈R d W1∈Rd×2d W2∈R d×d d represents the entity embedding dimension, (h,t) represents the entity pair, [h,t] represents the concatenation operation, W1 represents the first layer of the fully connected network, W2 represents the second layer of the fully connected network, and ht hidden This represents the intermediate hidden vector. unique ∈R d This represents the private characteristics of an entity's relationship with another entity.
[0079] As a further preferred embodiment, in step S103 above, the step of performing common feature extraction processing on the third reference set according to the common feature extraction network to obtain the first sample relationship feature representation includes:
[0080] The third reference set is superimposed to obtain a superposition matrix;
[0081] The first feature representation set is obtained by performing interactive information extraction processing on the superimposed matrix based on the first convolution kernel.
[0082] The first feature representation set is processed by the second convolution kernel to obtain the second feature representation set;
[0083] The second feature representation set is stacked and then processed by a third convolution kernel to extract features, resulting in the first sample relationship feature representation.
[0084] In this embodiment of the invention, the superimposed matrix is input into a common feature extraction network for common feature extraction processing. A three-layer multi-kernel convolution is used to extract the common features contained in the entity pairs. In the first layer of the common feature extraction network, five 5×1 convolution kernels, i.e., the first convolution kernels, are used to extract the common relational metadata and interaction information between the five entity pairs contained in the superimposed matrix T from five perspectives, resulting in five d-dimensional common feature representations, i.e., the first feature representation set. In the second layer of the common feature extraction network, the five d-dimensional representations are combined into a 5×d matrix T1, and three 5×1 convolution kernels, i.e., the second convolution kernels, are used to extract features, resulting in three d-dimensional representations, i.e., the second feature representation set. In the third layer of the common feature extraction network, the three d-dimensional representations are stacked into a 3×d matrix T2, and one 3×1 convolution kernel, i.e., the third convolution kernel, is used to extract features, resulting in one d-dimensional representation. In one embodiment, K is set to 5, that is, the final d-dimensional representation is used as a common feature to obtain the first sample relationship feature representation, which is the feature representation representing the small sample relationship.
[0085] In this embodiment of the invention, it is necessary to extract the common features between entity pairs in the first reference set within the shared space. To this end, this embodiment designs a common feature extraction network to model and extract the shared relational features between different entity pairs in the same relational reference set, which are implicitly possessed by each other. In this embodiment, a convolutional network is designed as the common feature extraction network to perform the common feature extraction process. The first reference set is superimposed to obtain a superposition matrix, which is then input into the common feature extraction network to obtain the common features, thus yielding a feature representation representing the small sample relations.
[0086] As a further preferred embodiment, in step S104 above, calculating the loss between the first reference set and the second reference set based on the first sample relationship feature representation to obtain the reference set loss includes:
[0087] Based on the first sample relation feature representation, the entity pair score of the first reference set is calculated to obtain the first score;
[0088] Based on the first sample relationship feature representation, the entity pair score of the second reference set is calculated to obtain the second score;
[0089] The loss is calculated based on the first score and the second score to obtain the reference set loss.
[0090] In this embodiment of the invention, a score is calculated for each entity pair in the first reference set based on the obtained feature representation of the small sample relations to obtain a first score. Similarly, a score is calculated for each entity pair in the second reference set based on the obtained feature representation of the small sample relations to obtain a second score. Then, the loss between the first and second reference sets is calculated based on the first and second scores to obtain the reference set loss.
[0091] In this embodiment of the invention, a spatial mapping transformation of private features is added to the original TransD (a knowledge representation model) to calculate the score between the private features and each entity pair in the first reference set. This embodiment uses the TransE (a knowledge representation model) distance to calculate the score, as detailed below:
[0092] r p =W p r share ;
[0093]
[0094]
[0095] h = M rh h;
[0096] t = M rt t;
[0097] socre(h,t)=||h+r share -t||;
[0098] Among them, W p ∈R d×d Representing private feature r share The transformation space matrix, h p and t p These represent the mappings of the original entity pairs in different spaces, I∈R d×d Let ||x|| denote the identity matrix, and ||x|| denote the L2 regularization of vector x.
[0099] Further, as a preferred embodiment, in step S105 above, updating the first sample relationship feature representation based on the reference set loss to obtain the second sample relationship feature representation includes:
[0100] Obtain the relational feature representation of the first sample;
[0101] The loss gradient is calculated based on the loss of the reference set.
[0102] The first sample relationship feature representation is updated based on the loss gradient to obtain the second sample relationship feature representation.
[0103] In this embodiment of the invention, based on the fast adaptation task idea of MAML, the loss gradient of the reference set is used to quickly update the representation of relation elements to better adapt to the query set. The gradient of the loss descent of the reference set is used to quickly update the first sample relation feature representation to obtain the second sample relation feature representation, calculated as follows:
[0104] r final =r share -βGrad(r share );
[0105] Where, r final This represents the updated relational representation, r. share Grad(r) represents the common features, β represents the update rate, and Grad(r) represents the update rate. share ) represents the loss gradient.
[0106] As a further preferred embodiment, in step S106 above, the query set score is calculated for the first query set and the second query set based on the second sample relationship feature representation to obtain the query set loss, including:
[0107] The second sample relationship feature representation is obtained;
[0108] Based on the second sample relationship feature representation, the entity pair score of the first query set is calculated to obtain the first query score;
[0109] The entity pair score is calculated on the second query set based on the second sample relation feature representation to obtain the second query score;
[0110] The query set loss is obtained by calculating the loss based on the first query score and the second query score.
[0111] In this embodiment of the invention, a score is calculated for each entity pair in the first query set based on the second sample relationship feature representation obtained in step S105 to obtain a first query score. Similarly, a score is calculated for each entity pair in the first query set based on the second sample relationship feature representation obtained in step S105 to obtain a second query score. Then, the loss between the first query set and the second query set is calculated based on the first query score and the second query score to obtain the final query loss.
[0112] On the other hand, embodiments of the present invention also provide a knowledge completion system based on relation feature extraction, the system comprising:
[0113] The first module is used to obtain a set of training task triples, and to preprocess the set of training task triples to obtain a first reference set, a second reference set, a first query set, and a second query set.
[0114] The second module is used to perform private feature extraction processing on the first reference set according to the private feature extraction network to obtain a third reference set, wherein the third reference set includes private feature representations.
[0115] The third module is used to perform common feature extraction processing on the third reference set according to the common feature extraction network to obtain the first sample relationship feature representation;
[0116] The fourth module is used to perform reference set score calculation processing on the first reference set and the second reference set according to the sample relationship feature representation, so as to obtain the reference set loss;
[0117] The fifth module is used to update the sample relationship feature representation based on the loss gradient of the reference set loss to obtain the second sample relationship feature representation.
[0118] The sixth module is used to calculate the query set score of the first query set and the second query set based on the second sample relationship feature representation, so as to obtain the query set loss.
[0119] In summary, the embodiments of the present invention have the following advantages: This model, without relying on entity background knowledge, designs a private feature extraction network and a public feature extraction network to obtain a high-level representation of relations, and then uses the meta-learning MAML idea to realize the rapid update of the relation meta-representation, quickly adapt to the query of current small sample relations, and uses TransD to calculate the scores of the reference set and query set, so as to enable it to handle complex relations, thereby improving the knowledge completion capability.
[0120] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.
[0121] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the system disclosed herein, the actual implementation of the module will be understood within the scope of conventional art for an engineer. Therefore, those skilled in the art can implement the invention set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0122] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0123] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0124] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0125] The above is a detailed description of the preferred embodiments of the present invention, but the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.
Claims
1. A knowledge completion method based on relation feature extraction, characterized in that, The method includes: Obtain the training task triple set, and preprocess the training task triple set to obtain the first reference set, the second reference set, the first query set, and the second query set. The first reference set is processed by a private feature extraction network to obtain a third reference set, which includes private feature representations. The third reference set is processed by a common feature extraction network to obtain the first sample relationship feature representation. Based on the sample relationship feature representation, reference set scores are calculated for the first reference set and the second reference set to obtain the reference set loss. The sample relationship feature representation is updated based on the loss gradient of the reference set loss to obtain the second sample relationship feature representation; Based on the second sample relationship feature representation, query set scores are calculated for the first query set and the second query set to obtain the query set loss. The step of calculating the loss between the first reference set and the second reference set based on the first sample relationship feature representation to obtain the reference set loss includes: Entity pair scores are calculated on the first reference set based on the first sample relationship feature representation to obtain a first score; Based on the first sample relationship feature representation, the entity pair score of the second reference set is calculated to obtain the second score; The loss is calculated based on the first score and the second score to obtain the reference set loss; The step of updating the first sample relation feature representation based on the reference set loss to obtain the second sample relation feature representation includes: Obtain the relational feature representation of the first sample; The loss gradient is calculated based on the loss of the reference set. The second sample relationship feature representation is obtained by updating the first sample relationship feature representation based on the loss gradient. The step of calculating query set scores for the first query set and the second query set based on the second sample relationship feature representation to obtain the query set loss includes: Obtain the second sample relationship feature representation; The first query score is obtained by calculating entity pair scores based on the second sample relationship feature representation of the first query set; The entity pair score is calculated on the second query set based on the second sample relation feature representation to obtain the second query score; The query set loss is obtained by calculating the loss based on the first query score and the second query score.
2. The method according to claim 1, characterized in that, The preprocessing of the training task triplet set to obtain a first reference set, a second reference set, a first query set, and a second query set includes: Randomly select entity pairs of triples from the training task triple set to obtain the first reference set, and use the remaining triples in the training task triple set as the first query set. The tail entity types of the training task triple set are collected and processed to obtain the tail entity set; The tail entities in the first reference set are removed, and the tail entities are randomly selected from the tail entity set for entity pair combination to obtain the second reference set; the remaining triples in the tail entity set are used as the second query set.
3. The method according to claim 1, characterized in that, The process of extracting private features from the first reference set using a private feature extraction network yields a third reference set, which includes private feature representations, including: The entity pairs in the first reference set are spliced together to obtain spliced entity pairs; The concatenated entity pair is input into the private feature extraction network for feature extraction processing to obtain a third reference set, which includes private feature representations.
4. The method according to claim 1, characterized in that, The step of extracting common features from the third reference set using a common feature extraction network to obtain a first sample relationship feature representation includes: The third reference set is superimposed to obtain a superposition matrix; The first feature representation set is obtained by performing interactive information extraction processing on the superimposed matrix based on the first convolution kernel; The first feature representation set is processed by the second convolution kernel to obtain the second feature representation set; The second feature representation set is stacked and then processed by a third convolution kernel to extract features, resulting in the first sample relationship feature representation.
5. A knowledge completion system based on relation feature extraction, characterized in that, The knowledge completion system based on relation feature extraction is applied to the knowledge completion method based on relation feature extraction as described in claim 1, and the system includes: The first module is used to obtain a set of training task triples, and to preprocess the set of training task triples to obtain a first reference set, a second reference set, a first query set, and a second query set. The second module is used to perform private feature extraction processing on the first reference set according to the private feature extraction network to obtain a third reference set, wherein the third reference set includes private feature representations. The third module is used to perform common feature extraction processing on the third reference set according to the common feature extraction network to obtain the first sample relationship feature representation; The fourth module is used to perform reference set score calculation processing on the first reference set and the second reference set according to the sample relationship feature representation, so as to obtain the reference set loss; The fifth module is used to update the sample relationship feature representation based on the loss gradient of the reference set loss to obtain the second sample relationship feature representation. The sixth module is used to calculate the query set score of the first query set and the second query set based on the second sample relationship feature representation, so as to obtain the query set loss.
6. A knowledge completion system based on relation feature extraction according to claim 5, characterized in that, The first module is used to obtain a set of training task triples, preprocess the set of training task triples to obtain a first reference set, a second reference set, a first query set, and a second query set, including: The first unit is used to randomly select entity pairs of several triples from the training task triple set to obtain a first reference set, and use the remaining triples in the training task triple set as the first query set. The second unit is used to collect and process the tail entity types of the training task triple set to obtain the tail entity set. The third unit is used to remove tail entities from the first reference set, randomly select tail entities from the tail entity set for entity pair combination processing to obtain the second reference set, and use the remaining triples in the tail entity set as the second query set.
7. A knowledge completion system based on relation feature extraction according to claim 5, characterized in that, The second module is used to perform private feature extraction processing on the first reference set according to the private feature extraction network to obtain a third reference set, wherein the third reference set includes private feature representations, including: The fourth unit is used to concatenate entity pairs from the first reference set to obtain concatenated entity pairs. The fifth unit is used to input the spliced entity pair into the private feature extraction network for feature extraction processing to obtain a third reference set, which includes private feature representations.