A method for performing a task based on a knowledge graph obtained through entity alignment
By filtering target entities in the knowledge graph, constructing sample entity pairs based on centrality and uncertainty, and training the entity alignment model, the problems of time-consuming, labor-intensive, and low-accuracy existing technologies are solved, achieving efficient entity alignment and task execution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2026-03-17
AI Technical Summary
Existing entity alignment methods are time-consuming and labor-intensive, and have low alignment accuracy, making it difficult to effectively train untrained entity alignment models.
By filtering target entities in the knowledge graph, constructing sample entity pairs based on centrality and uncertainty, training the entity alignment model, and using the trained model for entity alignment and task execution.
It improves the alignment accuracy of entity alignment models, reduces the sample labeling cost during training, and improves the efficiency of model training and task execution.
Smart Images

Figure CN117172316B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of knowledge graph construction, and in particular to a method for task execution based on a knowledge graph obtained by entity alignment. Background Technology
[0002] In the construction of knowledge graphs, entity alignment can effectively solve the heterogeneity problem when multiple knowledge graphs interoperate, enabling heterogeneous knowledge graphs to improve each other's coverage.
[0003] Existing entity alignment methods primarily involve manually selecting and labeling entities in knowledge graphs, then using these labeled entities to train entity alignment models. This method is both time-consuming and labor-intensive, and the labeled entities often fail to provide effective training for untrained entity alignment models. Consequently, entity alignment models trained using this method generally exhibit low alignment accuracy. Therefore, identifying entities with high training value for use in the training process of untrained entity alignment models to obtain highly accurate entity alignment models is of paramount importance. Summary of the Invention
[0004] This specification provides a method for task execution based on a knowledge graph obtained from entity alignment, in order to partially solve the aforementioned problems existing in the prior art.
[0005] The following technical solution is adopted in this specification:
[0006] This specification provides a method for task execution based on a knowledge graph obtained from entity alignment, including:
[0007] Obtain a knowledge graph pair, wherein the knowledge graph pair contains a first knowledge graph and a second knowledge graph;
[0008] Each target entity is selected from the entity information contained in the first knowledge graph;
[0009] For each target entity, the centrality of the target entity is determined based on the entity information of the neighboring nodes within a preset adjacency range of the node corresponding to the target entity in the first knowledge graph. The uncertainty of the target entity is determined based on the alignment probability between at least some entities contained in the second knowledge graph and the target entity, and the alignment probability between the entity information corresponding to the neighboring nodes and at least some entities contained in the second knowledge graph.
[0010] Construct sample entity pairs based on the centrality and uncertainty of each target entity;
[0011] Based on the aforementioned entity pairs, the entity alignment model to be trained is trained.
[0012] Based on the trained entity alignment model, entity alignment is performed on each knowledge graph to be aligned, so as to obtain a knowledge graph fused after entity alignment, and the target task is executed based on the fused knowledge graph.
[0013] Optionally, each target entity is selected from the entity information contained in the first knowledge graph, specifically including:
[0014] Based on the connection relationships between the entity information contained in the first knowledge graph, determine the out-degree of each entity information contained in the first knowledge graph.
[0015] Based on the out-degree of each entity information contained in the first knowledge graph, the entity information contained in the first knowledge graph is filtered to obtain each target entity.
[0016] Optionally, for each target entity, the centrality of the target entity is determined based on the entity information of the neighboring nodes within a preset adjacency range of the node corresponding to the target entity in the first knowledge graph. Specifically, this includes:
[0017] For each entity target, determine the singleton centrality of the target entity based on its out-degree;
[0018] The individual centrality of the entity information corresponding to the neighboring nodes within a preset adjacency range of the node corresponding to the target entity in the first knowledge graph is determined.
[0019] The centrality of the target entity is determined based on the individual centrality of the target entity and the individual centrality of the entities corresponding to the neighboring nodes.
[0020] Optionally, the uncertainty corresponding to the target entity is determined based on the alignment probability between at least some entities contained in the second knowledge graph and the target entity, and the alignment probability between the entity information corresponding to the neighboring nodes and at least some entities contained in the second knowledge graph. Specifically, this includes:
[0021] For each target entity, determine the alignment probability between the target entity and at least some entities contained in the second knowledge graph;
[0022] The individual uncertainty of the target entity is determined based on the alignment probability between the target entity and at least some of the entities contained in the second knowledge graph.
[0023] Based on the entity information corresponding to the neighbor node and at least some entities contained in the second knowledge graph, determine the alignment probability between the entity information corresponding to the neighbor node and at least some entities contained in the second knowledge graph;
[0024] The individual uncertainty of the entity information corresponding to the neighbor node is determined based on the alignment probability between the entity information corresponding to the neighbor node and at least some entities contained in the second knowledge graph.
[0025] The uncertainty of the target entity is determined based on the individual uncertainty of the target entity and the individual uncertainty of the entity information corresponding to the neighboring nodes.
[0026] Optionally, the individual uncertainty of the target entity is determined based on the alignment probability between the target entity and at least some entities contained in the second knowledge graph, specifically including:
[0027] Based on the alignment probability between the target entity and at least some entities contained in the second knowledge graph, determine the probability difference between the alignment probability between the target entity and at least some entities contained in the second knowledge graph.
[0028] The individual uncertainty of the target entity is determined based on the probability difference between the alignment probability between the target entity and at least some of the entities contained in the second knowledge graph.
[0029] Based on the alignment probability between the entity information corresponding to the neighbor node and at least some entities contained in the second knowledge graph, the individual uncertainty of the entity information corresponding to the neighbor node is determined, specifically including:
[0030] Based on the alignment probability between the entity information corresponding to the neighbor node and at least some entities contained in the second knowledge graph, determine the probability difference between the alignment probability between the entity information corresponding to the neighbor node and at least some entities contained in the second knowledge graph.
[0031] The individual uncertainty of the entity information corresponding to the neighbor node is determined based on the probability difference between the alignment probability between the entity information corresponding to the neighbor node and at least some entities contained in the second knowledge graph.
[0032] Optionally, based on the centrality and uncertainty corresponding to each target entity, pairs of sample entities are constructed, specifically including:
[0033] For each target entity, determine the centrality weight corresponding to the centrality of the target entity, and determine the uncertainty weight corresponding to the uncertainty of the target entity;
[0034] The representative value of the target entity is determined based on the centrality of the target entity, the centrality weight, the uncertainty of the target entity, and the uncertainty weight.
[0035] Based on the representative value of each target entity, each target entity is filtered, and sample entity pairs are constructed based on the filtered target entities.
[0036] Optionally, determine the centrality weight corresponding to the centrality of the target entity, and determine the uncertainty weight corresponding to the uncertainty of the target entity, specifically including:
[0037] Based on the difference between the centrality and uncertainty of the target entity, determine the centrality weight corresponding to the centrality of the target entity, and determine the uncertainty weight corresponding to the uncertainty of the target entity.
[0038] Optionally, determine the centrality weight corresponding to the centrality of the target entity, and determine the uncertainty weight corresponding to the uncertainty of the target entity, specifically including:
[0039] Based on the current training round of the entity alignment model, the centrality weight corresponding to the centrality of the target entity and the uncertainty weight corresponding to the uncertainty of the target entity are determined. The larger the current training round, the smaller the centrality weight corresponding to the centrality of the target entity and the larger the uncertainty weight corresponding to the uncertainty of the target entity.
[0040] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for task execution based on a knowledge graph obtained from entity alignment.
[0041] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method for task execution based on a knowledge graph obtained from entity alignment.
[0042] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects:
[0043] As can be seen from the above method, the method for task execution based on knowledge graphs obtained by entity alignment provided in this specification involves obtaining knowledge graph pairs containing a first knowledge graph and a second knowledge graph, selecting target entities by filtering the entity information of each entity in the first knowledge graph, determining the centrality and uncertainty of each target entity based on the entity information corresponding to each target entity and its neighboring nodes, and the alignment probability of each target entity with entities contained in the second knowledge graph, and then constructing sample entity pairs based on the centrality and uncertainty of each target entity. The entity alignment model to be trained is then trained using the sample entity pairs. Finally, the trained entity alignment model is used to align the entities in each knowledge graph, and the target task is executed using the knowledge graph fused by entity alignment.
[0044] As can be seen from the above, the method for task execution based on knowledge graphs obtained through entity alignment provided in this specification can evaluate target entities with high training value in the entity alignment model training process based on the centrality and uncertainty of each target entity in the knowledge graph. These target entities with high training benefits are then used in the entity alignment model training process, resulting in an entity alignment model with high alignment accuracy for executing the target task. This method not only obtains an entity alignment model with high alignment accuracy but also significantly reduces the sample labeling cost during training, improving the efficiency of the model training process and significantly enhancing the overall task execution efficiency. Attached Figure Description
[0045] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings:
[0046] Figure 1 This is a flowchart illustrating a method for performing tasks based on a knowledge graph obtained from entity alignment, as provided in this specification.
[0047] Figure 2 This is a schematic diagram of a knowledge graph provided in this specification;
[0048] Figure 3 This is a schematic diagram illustrating the fusion of a knowledge graph through entity alignment, as provided in this specification.
[0049] Figure 4 This specification provides a schematic diagram of a device for performing tasks based on a knowledge graph obtained from entity alignment.
[0050] Figure 5 The one provided in this specification corresponds to Figure 1A schematic diagram of the structure of an electronic device. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.
[0052] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0053] Figure 1 This document presents a flowchart illustrating a method for performing tasks based on a knowledge graph obtained through entity alignment, as described in this specification. The method includes the following steps:
[0054] S101: Obtain a knowledge graph pair, wherein the knowledge graph pair includes a first knowledge graph and a second knowledge graph.
[0055] In the process of knowledge graph construction, entity alignment methods can be used to fuse heterogeneous knowledge graphs and improve the coverage of knowledge graphs. Training entity alignment models through model training and iteration can effectively improve entity alignment efficiency. Therefore, it is particularly important to select entities with high training benefits for the training process of entity alignment models and obtain entity alignment models with high alignment accuracy.
[0056] The execution subject of the task execution method based on the knowledge graph obtained by entity alignment provided in this specification can be a terminal device such as a desktop computer or laptop computer, or a server. In addition, the execution subject can also be a software entity, such as a client installed on a terminal device, or an online platform that can be logged into online. For ease of explanation, this specification only uses a terminal device as the execution subject to describe the provided task execution method.
[0057] Based on this, a terminal device using the knowledge graph obtained from entity alignment provided in this specification to perform tasks can fuse multiple knowledge graphs through an entity alignment model and use the fused knowledge graph to perform a target task. The specific target task performed by the terminal device can be determined according to the actual scenario. For example, in an information recommendation scenario, when recommending tourist attraction information to a user, a knowledge graph containing tourist attraction information can be fused with a knowledge graph containing local food information to create a knowledge graph containing both tourist attraction and local food information, and then pushed to the user. This allows the user to simultaneously learn about and select tourist attractions and local cuisine while viewing relevant information. As another example, in a risk control scenario, given the current level of technological advancement, risk control for a single risk type has low security. The terminal device can fuse multiple knowledge graphs containing a single risk type and use the fused knowledge graph with multiple risk types to perform risk control tasks, thereby improving the overall efficiency and security of the risk control task.
[0058] In this specification, the terminal device can acquire knowledge graph pairs containing a first knowledge graph and a second knowledge graph. Specifically, the terminal device can acquire multiple sets of knowledge graph pairs containing known entity alignment results and select the first and second knowledge graphs from these knowledge graph pairs.
[0059] It should be noted that the selection of the first and second knowledge graphs mentioned above is not strictly defined, but rather relative. For example, for knowledge graph A and knowledge graph B in a knowledge graph pair, if a target entity needs to be selected for knowledge graph A, then knowledge graph A is selected as the first knowledge graph, and knowledge graph B is selected as the second knowledge graph. Conversely, if a target entity needs to be selected for knowledge graph B, then knowledge graph B is selected as the first knowledge graph, and knowledge graph A is selected as the second knowledge graph.
[0060] S102: Select each target entity from the entity information contained in the first knowledge graph.
[0061] In this specification, the terminal device can filter out each target entity from the entity information contained in the first knowledge graph of the knowledge graph pair.
[0062] Specifically, the terminal device can determine the core entity in the first knowledge graph based on the number of first-order adjacent entities of each entity information and whether the order of the farthest adjacent entity of each first-order adjacent entity meets a preset value, and then use the core entity as the target entity. For each entity information in the first knowledge graph, when the number of first-order adjacent entities of that entity information is not less than a preset value for the number of first-order adjacent entities, the terminal device will judge the order of the farthest adjacent entity of all first-order adjacent entities of that entity information. If one or more of the orders of the farthest adjacent entities of all first-order adjacent entities of that entity information are not less than the preset value for the order of the farthest adjacent entity of the first-order adjacent entity, then that entity information can be determined as a core entity, and the core entity can be used as the target entity. To illustrate how to determine the core entity in the knowledge graph, a schematic diagram of a knowledge graph will be used below, such as... Figure 2 As shown.
[0063] Figure 2 A schematic diagram of a knowledge graph provided in this specification.
[0064] exist Figure 2 In the knowledge graph shown, entities B, C, F, and E are all first-order adjacent entities of entity A, meaning entity A has 4 first-order adjacent entities. Entity O is a third-order adjacent entity of entity B and is also entity B's farthest adjacent entity. Therefore, when the preset value for the number of first-order adjacent entities is 4, and the preset value for the order of the farthest adjacent entity of a first-order adjacent entity is 3, Figure 2 The core entity of the knowledge graph shown is entity A, and entity A is used as the target entity when this knowledge graph is used as the first knowledge graph.
[0065] It should be noted that in practical applications, the above preset values can be determined according to actual needs. Figure 2 The specific values of the preset values in the examples are listed for ease of understanding, therefore, this manual does not limit the specific values of the preset values.
[0066] In addition to the methods mentioned above, the terminal device can also determine each core entity based on the out-degree of each entity information in the first knowledge graph, thereby determining each target entity.
[0067] Specifically, the terminal device can remove entity information with an out-degree of 1 from the first knowledge graph. After removal, entity information with an out-degree of 1 may reappear in the first knowledge graph. This process is repeated and iterated to peel away the entity information of the first knowledge graph layer by layer until no entity information with an out-degree of 1 appears in the first knowledge graph, thereby determining the core entities of the first knowledge graph.
[0068] Continuing with the previous example, in Figure 2 In the knowledge graph shown, entities such as K, P, and I are all entities with an out-degree of 1. After removing these entities with an out-degree of 1, entities E, M, and D will become entities with an out-degree of 1, and so on, removing entities with an out-degree of 1 layer by layer. Finally, in... Figure 2 The knowledge graph shown will only contain entity A; therefore, entity A is... Figure 2 The core entity of the knowledge graph shown can be used by the terminal device to select entity A as the target entity when the knowledge graph is the first knowledge graph.
[0069] S103: For each target entity, determine the centrality of the target entity based on the entity information corresponding to the neighboring nodes within a preset adjacency range of the node corresponding to the target entity in the first knowledge graph, and determine the uncertainty of the target entity based on the alignment probability between at least some entities contained in the second knowledge graph and the target entity, and the alignment probability between the entity information corresponding to the neighboring nodes and at least some entities contained in the second knowledge graph.
[0070] In this specification, to select target entities that offer high training benefits for the entity alignment model, the terminal device needs to determine the centrality and uncertainty of each target entity. The centrality of a target entity reflects whether it is a centrally aligned entity within the knowledge graph of its respective domain. Using target entities with high centrality during training effectively compares the training results of the entity alignment model with standard results, thereby improving training efficiency. The uncertainty of a target entity reflects the alignment difficulty of the knowledge graph to which it belongs during entity alignment. Using target entities with high uncertainty during training effectively trains and improves the entity alignment capability of the entity alignment model, thus enhancing its alignment accuracy.
[0071] It should be noted that this specification takes into account the influence of the target entity's neighboring entities on the target entity. Therefore, the centrality and uncertainty of the target entity are jointly determined by the target entity itself and its neighboring entities. The centrality of the target entity can be specifically reflected by determining its centrality, and the uncertainty of the target entity can be specifically reflected by determining its uncertainty degree.
[0072] For each target entity, the terminal device determines the centrality of the target entity based on the entity information of the target entity and its neighboring nodes within a preset adjacency range. Specifically, the terminal device can determine the individual centrality of the target entity based on its out-degree, and determine the individual centrality of the neighboring nodes based on their out-degrees. Then, based on both the individual centrality of the target entity and the individual centrality of its neighboring nodes, the centrality of the target entity is determined, as shown in the following formula:
[0073]
[0074] Among them, e i Let R be the i-th target entity. n (e i Let k represent the centrality of the i-th target entity. s (e i ) represents the monomer centrality of the i-th target entity, k s (e j ) represents the individual centrality of the j-th entity information corresponding to the neighboring nodes of the target entity node within the preset adjacency range, and p represents a preset constant coefficient in the interval [0,1]. It is represented as the nth-order adjacent entity of the i-th target entity.
[0075] From the above formula, it can be seen that when the target entity e i The larger the adjacency order n, the smaller the impact of the neighboring node's entity information on the centrality of the target entity. This specification takes into account that when the adjacency order n is too large, it will cause noise interference in the process of determining the centrality of the target entity. Therefore, the adjacency order n is generally preset to 3. Of course, the adjacency order n can also be dynamically adjusted according to the actual situation.
[0076] In this specification, for each target entity, the terminal device can determine the uncertainty of the target entity based on the alignment probability between the target entity and at least some entities contained in the second knowledge graph in the knowledge graph pair, and the alignment probability between the entity information corresponding to the neighboring nodes of the target entity and at least some entities contained in the second knowledge graph.
[0077] Specifically, the terminal device can determine the probability difference between the alignment probabilities of the target entity and at least some entities contained in the second knowledge graph by utilizing the alignment probabilities between the target entity and at least some entities contained in the second knowledge graph. Furthermore, it can determine the probability difference between the alignment probabilities between the entity information corresponding to the target entity's neighbor nodes and at least some entities contained in the second knowledge graph by utilizing the alignment probabilities between the entity information corresponding to the target entity's neighbor nodes and at least some entities contained in the second knowledge graph. See the following formula for details:
[0078]
[0079] Among them, bt(e i The expression denoted by is the probability difference between the alignment probabilities of the i-th target entity and at least some of the entities contained in the second knowledge graph. It can also be expressed as the individual uncertainty of the i-th target entity. This is represented as the i-th target entity and the entities contained in the second knowledge graph. Alignment probability between them.
[0080] It should be noted that bt(e i The magnitude of bt(e) is negatively correlated with the individual uncertainty of the target entity. i The smaller the value of ), the greater the individual uncertainty of the target entity. This means that among at least some entities contained in the second knowledge graph, there may be multiple entity information that can be aligned with the target entity. The individual uncertainty of the entity information corresponding to the neighboring nodes of the target entity can also be determined using the above formula.
[0081] Furthermore, the terminal device can determine the uncertainty of the target entity by utilizing the individual uncertainty of the target entity and the individual uncertainty of the entity information corresponding to the target entity's neighboring nodes, as shown in the following formula:
[0082]
[0083] Among them, e i Let I be the i-th target entity. n (e i Let bt(e) represent the uncertainty of the i-th target entity. i Let bt(e) represent the individual uncertainty of the i-th target entity. j ) represents the individual uncertainty of the j-th entity information corresponding to the neighbor nodes of the target entity, p represents the preset constant coefficient in the interval [0,1], and N ei (n) represents the nth-order adjacent entity of the i-th target entity.
[0084] From the above formula, it can be seen that when the target entity e i The larger the adjacency order n, the smaller the impact of the individual uncertainty of the entity information of neighboring nodes on the uncertainty of the target entity. For the same reason as the formula used to determine the centrality of the target entity, this specification takes into account that when the adjacency order n is too large, it will cause noise interference in the determination process of the uncertainty of the target entity. Therefore, the adjacency order n is generally preset to 3. Of course, the adjacency order n can also be dynamically adjusted according to the actual situation.
[0085] S104: Construct sample entity pairs based on the centrality and uncertainty of each target entity.
[0086] In this specification, the terminal device determines the representative value of each target entity based on the centrality and uncertainty corresponding to each target entity, and selects the target entities used to construct each sample entity pair based on the representative value.
[0087] In this process, the terminal device can select target entities with larger representative values to construct each sample entity pair. A larger representative value indicates better centrality of the target entity, which facilitates entity alignment, and also indicates greater uncertainty, which facilitates the improvement of the alignment capability of the entity alignment model. Specifically, the terminal device can sum the centrality and uncertainty corresponding to the target entity to determine the representative value of the target entity.
[0088] Of course, when determining the above representative value, the terminal device can also introduce the centrality weight corresponding to the centrality and the uncertainty weight corresponding to the uncertainty, so as to determine the representative value of the target entity through the centrality, centrality weight, uncertainty and uncertainty weight corresponding to the target entity.
[0089] Centrality weights and uncertainty weights are primarily used to measure the contribution of uncertainty and centrality when determining the representative value of a target entity. The determination of centrality weights and uncertainty weights is closely related to centrality and uncertainty themselves. Specifically, for any target entity, the terminal device can determine the centrality weight corresponding to the centrality of the target entity and the uncertainty weight corresponding to the uncertainty of the target entity based on the difference between the centrality and uncertainty of that target entity. See the following formula for details:
[0090] dif(s)=f R (s)-f I (s)
[0091]
[0092] AC(s)=αf R (s)+(1-α)fI (s)
[0093] Among them, f R (s) represents the centrality of the target entity, f I (s) represents the uncertainty of the target entity, dif(s) represents the difference between the centrality and uncertainty of the target entity, α and (1-α) represent the centrality weight and uncertainty weight of the target entity respectively, p represents the preset constant coefficient in the interval [0,1], [-θ,θ] represents the preset difference range, and AC(s) represents the weight distribution of the centrality and uncertainty of the target entity in each sample entity pair, that is, the representative value of the target entity.
[0094] As can be seen from the formula above, the terminal device can determine the centrality weight and uncertainty weight of the target entity based on the range of the difference between the centrality and uncertainty of each target entity, and then determine the representative value of each target entity.
[0095] Furthermore, as can be seen from the above formula, when the centrality of a target entity is significantly greater than its uncertainty, the representative value of that target entity can be determined by referring only to its centrality, without considering its uncertainty. However, when there is a certain deviation between the centrality and uncertainty of a target entity, but within a preset deviation range, both the centrality and uncertainty must be considered when determining its representative value. Conversely, when the centrality of a target entity is significantly less than its uncertainty, the representative value can be determined by considering only its uncertainty, ignoring its centrality.
[0096] Of course, in the early stages of the entity alignment model training process, the training gain value brought by constructing each sample entity pair based on the centrality of the target entity is far greater than the training gain value brought by constructing each sample entity pair based on the uncertainty of the target entity.
[0097] Therefore, in this specification, the centrality weight corresponding to the centrality of a target entity and the uncertainty weight corresponding to the uncertainty of the target entity can be determined by the current training round of the entity alignment model. Specifically, the larger the current training round, the smaller the centrality weight corresponding to the centrality of the target entity and the larger the uncertainty weight corresponding to the uncertainty of the target entity.
[0098] In other words, in the initial stage of the entity alignment model training process, the terminal device can construct sample entity pairs independently based on the centrality of each target entity. This involves using the target entities with high centrality in the first knowledge graph and the corresponding aligned entities in the second knowledge graph to form sample entity pairs constructed based on the centrality of the target entities. Specifically, in the above formula, the centrality f of the target entity is represented by the representative value AC(s) of the target entity. R The weight α of (s) is 1, while the uncertainty f of the target entity is... I The weight (1-α) of (s) is 0.
[0099] In the mid-stage of entity alignment model training, although the model has undergone some training, its overall entity alignment capability is still unstable, and its alignment accuracy is not high enough to meet the standard requirements. At this point, the centrality and uncertainty of the target entity have little difference in training value and both contribute to the training process. Therefore, constructing entity pairs based on both the centrality and uncertainty of the target entity simultaneously yields higher training benefits compared to constructing them solely based on either the centrality or uncertainty. Thus, in the mid-stage of entity alignment model training, the terminal device can construct entity pairs based on both the centrality and uncertainty of the target entity simultaneously.
[0100] Specifically, in the above formula, this is expressed as the centrality f of the target entity. R (s) is slightly larger than the uncertainty f of the target entity. I When (s), the centrality f of the target entity in the representative value AC(s) of the target entity is... R The weight α of (s) is a preset value p, while the uncertainty f of the target entity is... I The weight (1-α) of (s) is 1-p; the uncertainty f of the target entity I (s) is slightly greater than the centrality Δf of the target entity. R When (s), the uncertainty f of the target entity in the representative value AC(s) of the target entity. I The weight (1-α) of (s) is a preset value p, while the centrality f of the target entity is... R The weight α of (s) is 1-p.
[0101] In the later stages of entity alignment model training, after multiple rounds of training and when the model has achieved a certain level of accuracy in entity alignment, constructing entity pairs based on the uncertainty of the target entity yields higher training value compared to constructing them based on the centrality of the target entity. Using target entities with higher uncertainty to train the entity alignment model effectively improves its alignment capability, leading to a more accurate model. Therefore, in the later stages of entity alignment model training, the terminal device can construct entity pairs independently based on the uncertainty of each target entity. This involves using target entities with higher uncertainty in the first knowledge graph and their corresponding alignment entities in the second knowledge graph to form entity pairs constructed based on the uncertainty of the target entity. Specifically, in the above formula, the centrality f of the target entity in the representative value AC(s) of the target entity... R The weight α of (s) is 0, while the uncertainty f of the target entity is... I The weight (1-α) of (s) is 1.
[0102] S105: Train the entity alignment model to be trained based on the entity pairs of the samples.
[0103] In this specification, the terminal device can use each sample entity pair in the training process of the entity alignment model to be trained, and after multiple rounds of training iterations, obtain an entity alignment model with entity alignment capabilities.
[0104] It should be noted that at the end of each training round, the terminal device will recalculate the centrality weight and uncertainty weight of each target entity according to the formula for constructing each sample entity pair mentioned above, and then construct each sample entity pair for the new training round.
[0105] S106: Based on the trained entity alignment model, perform entity alignment on each knowledge graph to be aligned, so as to obtain a knowledge graph fused after entity alignment, and perform the target task based on the fused knowledge graph.
[0106] In this specification, the terminal device utilizes a trained entity alignment model with entity alignment capabilities to perform entity alignment on multiple knowledge graphs involved in the target task. This involves fusing the differences in the same entity across different knowledge graphs, allowing multiple knowledge graphs to be merged into a single knowledge graph with broader entity information coverage. The merged knowledge graph is then used to execute the target task. To illustrate the fusion process of entity alignment across multiple knowledge graphs, a schematic diagram of entity alignment fusion of a single knowledge graph will be used below. Figure 3 As shown.
[0107] Figure 3 This is a schematic diagram illustrating the fusion of a knowledge graph through entity alignment, as provided in this specification.
[0108] exist Figure 3 In the diagram shown, entities a, c, and d are common to both Knowledge Graph 1 and Knowledge Graph 2, while entities b and h are differential entities between Knowledge Graph 1 and Knowledge Graph 2. Figure 3 As can be seen, after aligning the entities of Knowledge Graph 1 and Knowledge Graph 2, Knowledge Graph 3 is obtained. Knowledge Graph 3 contains all the common entity information of Knowledge Graph 1 and Knowledge Graph 2, and also integrates the different entity information of Knowledge Graph 1 and Knowledge Graph 2. The coverage of Knowledge Graph 3 includes both Knowledge Graph 1 and Knowledge Graph 2.
[0109] As can be seen from the above, the method for task execution based on knowledge graphs obtained through entity alignment provided in this specification can evaluate target entities with high training value in the entity alignment model training process based on the centrality and uncertainty of each target entity in the knowledge graph. These target entities with high training benefits are then used in the entity alignment model training process, resulting in an entity alignment model with high alignment accuracy for executing the target task. This method not only obtains an entity alignment model with high alignment accuracy but also significantly reduces the sample labeling cost during training, improving the efficiency of the model training process and significantly enhancing the overall task execution efficiency.
[0110] The above describes one or more implementations of the methods described in this specification. Based on the same approach, this specification also provides corresponding apparatuses for performing tasks based on knowledge graphs obtained from entity alignment, such as... Figure 4 As shown.
[0111] Figure 4 A schematic diagram of an apparatus for performing tasks based on a knowledge graph obtained from entity alignment, as provided in this specification, includes:
[0112] The acquisition module 401 is used to acquire knowledge graph pairs, wherein the knowledge graph pairs include a first knowledge graph and a second knowledge graph;
[0113] The filtering module 402 is used to filter out each target entity from the entity information contained in the first knowledge graph.
[0114] The calculation module 403 is used to determine the centrality of each target entity based on the entity information corresponding to the neighboring nodes within a preset adjacency range of the node corresponding to the target entity in the first knowledge graph, and to determine the uncertainty of the target entity based on the alignment probability between at least some entities contained in the second knowledge graph and the target entity, and the alignment probability between the entity information corresponding to the neighboring nodes and at least some entities contained in the second knowledge graph.
[0115] Module 404 is used to construct pairs of sample entities based on the centrality and uncertainty of each target entity.
[0116] Training module 405 is used to train the entity alignment model to be trained based on the sample entity pairs;
[0117] The execution module 406 is used to perform entity alignment on each knowledge graph to be aligned according to the trained entity alignment model, so as to obtain a knowledge graph fused after entity alignment, and to execute the target task according to the fused knowledge graph.
[0118] Optionally, the filtering module 402 is specifically used to: determine the out-degree of each entity information contained in the first knowledge graph based on the connection relationship between the entity information contained in the first knowledge graph; and filter the entity information contained in the first knowledge graph based on the out-degree of each entity information contained in the first knowledge graph to obtain the target entities.
[0119] Optionally, the calculation module 403 is specifically used to: for each entity target, determine the individual centrality of the target entity based on the out-degree of the target entity; determine the individual centrality of the entity information corresponding to the neighboring nodes within a preset adjacency range of the node corresponding to the target entity in the first knowledge graph; and determine the centrality of the target entity based on the individual centrality of the target entity and the individual centrality of the entities corresponding to the neighboring nodes.
[0120] Optionally, the calculation module 403 is specifically configured to: for each target entity, determine the alignment probability between the target entity and at least a portion of the entities contained in the second knowledge graph; determine the individual uncertainty of the target entity based on the alignment probability between the target entity and at least a portion of the entities contained in the second knowledge graph; determine the alignment probability between the entity information corresponding to the neighboring node and at least a portion of the entities contained in the second knowledge graph based on the entity information corresponding to the neighboring node and at least a portion of the entities contained in the second knowledge graph; determine the individual uncertainty of the entity information corresponding to the neighboring node based on the alignment probability between the entity information corresponding to the neighboring node and at least a portion of the entities contained in the second knowledge graph; and determine the uncertainty of the target entity based on the individual uncertainty of the target entity and the individual uncertainty of the entity information corresponding to the neighboring node.
[0121] Optionally, the calculation module 403 is specifically used to: determine the probability difference between the alignment probability between the target entity and at least some entities contained in the second knowledge graph based on the alignment probability between the target entity and at least some entities contained in the second knowledge graph; and determine the individual uncertainty of the target entity based on the probability difference between the alignment probability between the target entity and at least some entities contained in the second knowledge graph.
[0122] The calculation module 403 is specifically used to: determine the probability difference between the alignment probability between the entity information corresponding to the neighbor node and at least some entities contained in the second knowledge graph, based on the alignment probability between the entity information corresponding to the neighbor node and at least some entities contained in the second knowledge graph; and determine the individual uncertainty of the entity information corresponding to the neighbor node based on the probability difference between the alignment probability between the entity information corresponding to the neighbor node and at least some entities contained in the second knowledge graph.
[0123] Optionally, the construction module 404 is specifically used to: for each target entity, determine the centrality weight corresponding to the centrality of the target entity, and determine the uncertainty weight corresponding to the uncertainty of the target entity; determine the representative value of the target entity based on the centrality, the centrality weight, the uncertainty, and the uncertainty weight; filter each target entity based on the representative value of each target entity, and construct each sample entity pair based on the filtered target entities.
[0124] Optionally, the construction module 404 is specifically used to determine the centrality weight corresponding to the centrality of the target entity and the uncertainty weight corresponding to the uncertainty of the target entity based on the difference between the centrality and uncertainty of the target entity.
[0125] Optionally, the construction module 404 is specifically used to determine the centrality weight corresponding to the centrality of the target entity and the uncertainty weight corresponding to the uncertainty of the target entity based on the current training round of the entity alignment model. The larger the current training round, the smaller the centrality weight corresponding to the centrality of the target entity and the larger the uncertainty weight corresponding to the uncertainty of the target entity.
[0126] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1 This paper presents a method for task execution based on a knowledge graph obtained from entity alignment.
[0127] This instruction manual also provides Figure 5 One of the corresponding Figure 1 A schematic diagram of the structure of an electronic device. (e.g.) Figure 5 As shown, at the hardware level, this electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above. Figure 1 The method for task execution based on the knowledge graph obtained by entity alignment.
[0128] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0129] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0130] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0131] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware.
[0132] Those skilled in the art will understand that embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0133] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0134] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0135] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0136] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0137] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0138] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0139] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0140] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0141] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0142] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0143] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.
Claims
1. A method for performing a task based on a knowledge graph obtained through entity alignment, characterized in that, The method comprises the following steps: A terminal device acquires a knowledge graph pair, which comprises a first knowledge graph and a second knowledge graph; Each target entity is selected from each entity information contained in the first knowledge graph; For each target entity, a centrality of the target entity is determined according to entity information corresponding to a neighbor node of a node corresponding to the target entity within a preset adjacency range in the first knowledge graph, and an uncertainty of the target entity is determined according to an alignment probability between at least part of entities contained in the second knowledge graph and the target entity and an alignment probability between entity information corresponding to the neighbor node and at least part of entities contained in the second knowledge graph; According to the centrality and the uncertainty of each target entity, a plurality of sample entity pairs are constructed; An entity alignment model to be trained is trained according to the plurality of sample entity pairs; Each knowledge graph to be aligned is aligned according to the trained entity alignment model to obtain a fused knowledge graph after entity alignment, and a target task is performed according to the fused knowledge graph, the target task comprising an information recommendation task, when the target task is the information recommendation task, the knowledge graph pair comprises a knowledge graph containing tourist attraction information and a knowledge graph containing local food information, each node contained in the knowledge graph containing tourist attraction information corresponds to different tourist attraction information, and each node contained in the knowledge graph containing local food information corresponds to different local food information.
2. The method of claim 1, wherein, Each target entity is selected from each entity information contained in the first knowledge graph, specifically comprising: The out-degree of each entity information contained in the first knowledge graph is determined according to the connection relationship between each entity information contained in the first knowledge graph; Each entity information contained in the first knowledge graph is selected according to the out-degree of each entity information contained in the first knowledge graph to obtain the target entity.
3. The method of claim 2, wherein, For each target entity, a centrality of the target entity is determined according to entity information corresponding to a neighbor node of a node corresponding to the target entity within a preset adjacency range in the first knowledge graph, specifically comprising: For each target entity, the single centrality of the target entity is determined according to the out-degree of the target entity; The single centrality of the entity information corresponding to the neighbor node is determined according to the out-degree of the entity information corresponding to the neighbor node of the node corresponding to the target entity within the preset adjacency range in the first knowledge graph; The centrality of the target entity is determined according to the single centrality of the target entity and the single centrality of the entity corresponding to the neighbor node.
4. The method of claim 1, wherein, The uncertainty of the target entity is determined according to the alignment probability between at least part of entities contained in the second knowledge graph and the target entity and the alignment probability between the entity information corresponding to the neighbor node and at least part of entities contained in the second knowledge graph, specifically comprising: For each target entity, determine an alignment probability between the target entity and at least part of entities contained in the second knowledge graph; Determine a single-body uncertainty of the target entity according to the alignment probability between the target entity and at least part of entities contained in the second knowledge graph; Determine an alignment probability between the entity information corresponding to the neighbor node and at least part of entities contained in the second knowledge graph according to the entity information corresponding to the neighbor node and at least part of entities contained in the second knowledge graph; Determine a single-body uncertainty of the entity information corresponding to the neighbor node according to the alignment probability between the entity information corresponding to the neighbor node and at least part of entities contained in the second knowledge graph; Determine an uncertainty of the target entity according to the single-body uncertainty of the target entity and the single-body uncertainty of the entity information corresponding to the neighbor node.
5. The method of claim 4, wherein, Determine a single-body uncertainty of the target entity according to the alignment probability between the target entity and at least part of entities contained in the second knowledge graph, specifically comprising: Determine a probability difference value of the alignment probability between the target entity and at least part of entities contained in the second knowledge graph according to the alignment probability between the target entity and at least part of entities contained in the second knowledge graph; Determine a single-body uncertainty of the target entity according to the probability difference value of the alignment probability between the target entity and at least part of entities contained in the second knowledge graph; Determine a probability difference value of the alignment probability between the entity information corresponding to the neighbor node and at least part of entities contained in the second knowledge graph according to the alignment probability between the entity information corresponding to the neighbor node and at least part of entities contained in the second knowledge graph; Determine a single-body uncertainty of the entity information corresponding to the neighbor node according to the probability difference value of the alignment probability between the entity information corresponding to the neighbor node and at least part of entities contained in the second knowledge graph. According to the centrality and uncertainty corresponding to each target entity, construct each sample entity pair, specifically comprising:
6. The method of claim 1, wherein, For each target entity, determine a centrality weight corresponding to the centrality of the target entity, and determine an uncertainty weight corresponding to the uncertainty of the target entity; Determine a representative value of the target entity according to the centrality corresponding to the target entity, the centrality weight, the uncertainty corresponding to the target entity, and the uncertainty weight; According to the representative value of each target entity, screen each target entity, and construct each sample entity pair according to the screened target entity. Determine a centrality weight corresponding to the centrality of the target entity, and determine an uncertainty weight corresponding to the uncertainty of the target entity, specifically comprising:
7. The method of claim 6, wherein, According to a difference between the center degree and the uncertainty corresponding to the target entity, a center degree weight corresponding to the center degree of the target entity is determined, and an uncertainty weight corresponding to the uncertainty of the target entity is determined.
8. The method of claim 6, wherein, The center degree weight corresponding to the center degree of the target entity is determined, and the uncertainty weight corresponding to the uncertainty of the target entity is determined, specifically comprising: According to a current training round of the entity alignment model, the center degree weight corresponding to the center degree of the target entity is determined, and the uncertainty weight corresponding to the uncertainty of the target entity is determined, wherein the greater the current training round is, the smaller the center degree weight corresponding to the center degree of the target entity is, and the greater the uncertainty weight corresponding to the uncertainty of the target entity is.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is executed by the processor to implement the method in any one of claims 1-8.
10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the method in any one of claims 1-8.
Citation Information
Patent Citations
Dark network topic discovery method and system based on knowledge graph
CN110046260A
Knowledge graph entity alignment method and device, equipment and storage medium
CN111046186A