Knowledge graph entity alignment method, device, computer equipment and storage medium
By constructing a category conflict matrix and adjusting the similarity, errors caused by category conflicts in knowledge graph entity alignment are solved and the accuracy of entity alignment is improved.
Patent Information
- Application Number
- CN202011314360.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-20
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-11-20
AI Technical Summary
Existing knowledge graph entity alignment methods tend to cluster entities with similar names or expressions but different meanings together, leading to entity alignment errors.
By obtaining the entities in the knowledge graph to be aligned and their categories, a category conflict matrix is constructed, and entities are aligned based on similarity and category conflict matrix, and the similarity is adjusted to reduce alignment errors caused by category conflicts.
It effectively reduces entity alignment errors, improves the accuracy of entity alignment, and ensures that entities with similar names but different meanings are not aggregated together.
Smart Images

Figure CN112417169B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device and storage medium for entity alignment of a knowledge graph. Background Art
[0002] Knowledge Graph is a series of different graphs that show the development process and structural relationship of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and mine, analyze, construct, draw and display knowledge and their mutual connections. Knowledge graphs are usually composed of nodes and edges. Each node represents an "entity" and each edge is a "relationship" between entities.
[0003] In different knowledge graphs, entities with the same meaning may have different names or expressions, so cross-knowledge graph entity alignment is needed. In related technologies, many embedding-based methods have emerged to achieve entity alignment. Such methods usually model the information of various dimensions of the graph in an implicit space. However, current models tend to cluster entities with similar names or expressions but different meanings together, resulting in entity alignment errors. Summary of the invention
[0004] Based on this, it is necessary to provide an entity alignment method, device, computer equipment and storage medium for a knowledge graph that can reduce entity alignment errors in response to the above technical problems.
[0005] A method for aligning entities in a knowledge graph, the method comprising:
[0006] Obtain each first entity to be aligned of the first knowledge graph to be aligned, and each second entity to be aligned of the second knowledge graph to be aligned;
[0007] Reading the categories to which each of the first entities to be aligned and each of the second entities to be aligned belong;
[0008] Constructing a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned based on each of the categories;
[0009] respectively determining the similarity between each of the first entities to be aligned and each of the second entities to be aligned;
[0010] Based on the similarity and the category conflict matrix, entity alignment is performed on the first knowledge graph to be aligned and the second knowledge graph to be aligned to obtain an aligned knowledge graph.
[0011] In one embodiment, constructing a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned based on each of the categories includes:
[0012] Counting probability statistical information of known category relationships between categories included in the first knowledge graph to be aligned and categories included in the second knowledge graph to be aligned;
[0013] Based on the probability statistics information of the known category relationship, a conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs is determined to obtain the category conflict matrix.
[0014] A knowledge graph entity alignment device, the device comprising:
[0015] An acquisition module, used to acquire each first entity to be aligned of the first knowledge graph to be aligned, and each second entity to be aligned of the second knowledge graph to be aligned;
[0016] A category reading module, used for reading the category to which each of the first entities to be aligned and each of the second entities to be aligned belong;
[0017] A conflict matrix construction module, used to construct a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned based on each of the categories;
[0018] a similarity determination module, used to respectively determine the similarity between each of the first entities to be aligned and each of the second entities to be aligned;
[0019] An entity alignment module is used to perform entity alignment on the first knowledge graph to be aligned and the second knowledge graph to be aligned based on the similarity and the category conflict matrix to obtain an aligned knowledge graph.
[0020] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0021] Obtain each first entity to be aligned of the first knowledge graph to be aligned, and each second entity to be aligned of the second knowledge graph to be aligned;
[0022] Reading the categories to which each of the first entities to be aligned and each of the second entities to be aligned belong;
[0023] Constructing a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned based on each of the categories;
[0024] respectively determining the similarity between each of the first entities to be aligned and each of the second entities to be aligned;
[0025] Based on the similarity and the category conflict matrix, entity alignment is performed on the first knowledge graph to be aligned and the second knowledge graph to be aligned to obtain an aligned knowledge graph.
[0026] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0027] Obtain each first entity to be aligned of the first knowledge graph to be aligned, and each second entity to be aligned of the second knowledge graph to be aligned;
[0028] Reading the categories to which each of the first entities to be aligned and each of the second entities to be aligned belong;
[0029] Constructing a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned based on each of the categories;
[0030] respectively determining the similarity between each of the first entities to be aligned and each of the second entities to be aligned;
[0031] Based on the similarity and the category conflict matrix, entity alignment is performed on the first knowledge graph to be aligned and the second knowledge graph to be aligned to obtain an aligned knowledge graph.
[0032] The above-mentioned knowledge graph entity alignment method, device, computer equipment and storage medium obtain the entities in the two knowledge graphs to be entity aligned respectively, read the categories to which each entity belongs, construct a category conflict matrix between the two knowledge graphs based on the categories, calculate the similarities between the entities in the two knowledge graphs respectively, and finally align the entities based on the category conflict matrix and the similarities between the entities to obtain the aligned knowledge graph. The above-mentioned method introduces entity category information by constructing a category conflict matrix. Combining the category conflict matrix to align the entities of the knowledge graph can reduce the situation where entities with similar names but different meanings are aggregated together, thereby reducing errors in entity alignment. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic diagram of a flow chart of an entity alignment method of a knowledge graph in one embodiment;
[0034] Figure 2 A schematic diagram of a process of constructing a category conflict matrix between a first knowledge graph to be aligned and a second knowledge graph to be aligned based on each category in one embodiment;
[0035] Figure 3 A schematic diagram of a process for determining the conflict probabilities between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned based on category relationship information in one embodiment;
[0036] Figure 4 A schematic diagram of a category affiliation in a specific embodiment;
[0037] Figure 5 A schematic diagram of a flow chart of determining the probability of conflict between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs based on a preset scaling factor, a first category affiliation path, and a second category affiliation path in one embodiment;
[0038] Figure 6 It is a flowchart of adjusting each similarity based on the category conflict matrix to obtain the adjusted similarity in one embodiment;
[0039] Figure 7 A schematic diagram of a flow chart of adjusting each similarity based on a category conflict matrix to obtain an adjusted similarity in another embodiment;
[0040] Figure 8 It is a flowchart of an entity alignment method of a knowledge graph in a specific embodiment;
[0041] Fig. 9 It is a structural block diagram of an entity alignment device of a knowledge graph in one embodiment;
[0042] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0044] In one embodiment, Figure 1 As shown, a method for entity alignment of a knowledge graph is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes steps S110 to S150.
[0045] Step S110, obtaining each first entity to be aligned of the first knowledge graph to be aligned, and each second entity to be aligned of the second knowledge graph to be aligned.
[0046] The knowledge graph is a graph-based data structure consisting of nodes and edges. Each node represents an entity, and each edge is a "relationship" between entities. The knowledge graph is composed of some interconnected entities and their attributes; in other words, the knowledge graph is composed of pieces of knowledge, each of which is represented by a SPO triple (Subject-Predicate-Object). Among them, entities are concrete things that exist objectively, usually referring to nouns such as organizations, institutions, objects, and people that actually exist and function.
[0047] Entity alignment aims to determine whether two or more entities from different information sources refer to the same object in the real world. If multiple entities represent the same object, an alignment relationship is established between these entities, and the information contained in the entities is fused and aggregated. Entity alignment in knowledge graphs means that when merging two knowledge graphs, the knowledge describing the same entity in both graphs needs to be normalized.
[0048] In this embodiment, entity alignment is performed on entities in two knowledge graphs. First, entities in the two knowledge graphs to be aligned are obtained respectively. In order to distinguish the two knowledge graphs to be aligned, they are named as the first knowledge graph to be aligned and the second knowledge graph to be aligned respectively. The entity in the first knowledge graph to be aligned is named as the first entity to be aligned, and the entity in the second knowledge graph to be aligned is named as the second entity to be aligned.
[0049] Step S120 , reading the categories to which each first entity to be aligned and each second entity to be aligned belong.
[0050] Category means category or category; in one embodiment, category can be used to describe objects. In this embodiment, each entity in the knowledge graph corresponds to at least one category, such as a person, whose category is human, and a pine tree, whose category is plant; or a person's category is adult, or a person's category can be described as a scientist from the perspective of the work he does, and so on; in this embodiment, for the entities in the knowledge graph, the category to which each entity belongs is obtained respectively. It can be understood that multiple entities may correspond to the same category, and one entity may correspond to multiple categories; in one embodiment, the category to which the entity corresponds in the knowledge graph to be aligned is read.
[0051] Step S130, constructing a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned based on each category.
[0052] In this embodiment, category conflict refers to the existence of an opposing or inconsistent relationship between two entity categories; the category conflict matrix refers to the probability of conflict between the categories to which each entity contained in the first knowledge graph to be aligned belongs and the categories to which each entity contained in the second knowledge graph to be aligned belongs, and is constructed based on the categories to which each entity contained in the two knowledge graphs to be aligned belongs.
[0053] In one embodiment, constructing a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned based on each category includes: obtaining the relationship between each category, determining the conflict probability between each category based on the relationship between the categories, and then obtaining the category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned; wherein the relationship between the categories can be determined based on prior knowledge. The specific process of determining the conflict probability between each category based on the relationship between the categories will be described in detail in the following embodiments and will not be repeated here.
[0054] Step S140: respectively determine the similarity between each first entity to be aligned and each second entity to be aligned.
[0055] Similarity is used to describe the degree of similarity between two things. In this embodiment, the similarity is calculated for the entities in the knowledge graph. It can be understood that in this embodiment, determining the similarity includes calculating the similarity between an entity in the first knowledge graph to be aligned and all entities in the second knowledge graph to be aligned; assuming that the first knowledge graph to be aligned contains m entities and the second knowledge graph to be aligned contains n entities, the similarity between m*n entities needs to be calculated.
[0056] Furthermore, calculating the similarity between entities in the knowledge graph can be achieved in any way. In one embodiment, the corresponding embedding representation can be determined for each entity based on the entity alignment model determined by training, and the similarity between the entities can be calculated using the embedding representation corresponding to each entity. In a specific embodiment, the cosine distance representation can be used to calculate the embedding representation corresponding to each entity to obtain the similarity between the entities.
[0057] The entity alignment model determined by training can be any entity alignment model; in a specific embodiment, the entity alignment model includes MTransE (a graph alignment algorithm based on embedded representation), GCN-Align (an embedded graph alignment algorithm), BootEA (a graph alignment algorithm based on embedded representation), etc.
[0058] Step S150, based on the similarity and the category conflict matrix, entity alignment is performed on the first knowledge graph to be aligned and the second knowledge graph to be aligned to obtain an aligned knowledge graph.
[0059] In one embodiment, entity alignment is performed on the first knowledge graph to be aligned and the second knowledge graph to be aligned based on similarity and a category conflict matrix, including: adjusting each similarity based on the category conflict matrix to obtain an adjusted similarity; and entity alignment is performed on the first knowledge graph to be aligned and the second knowledge graph to be aligned according to the adjusted similarity between each first entity to be aligned and each second entity to be aligned.
[0060] Further, in one embodiment, adjusting each similarity based on the category conflict matrix to obtain an adjusted similarity includes: reading the conflict probability of the category to which the two entities corresponding to the similarity belong in the category conflict matrix, adjusting the similarity with the conflict probability and a preset coefficient, and obtaining the corresponding adjusted similarity. The specific process of adjusting the similarity with the conflict probability and the preset coefficient to obtain the corresponding adjusted similarity will be described in detail in the following embodiments and will not be repeated here.
[0061] Traditional methods usually use entity alignment models to determine the embedding representations corresponding to each entity, and use the embedding representations to calculate the similarity between entities. After obtaining the similarity between each entity, the nearest neighbor of each entity is determined based on the similarity of each entity, thereby achieving entity alignment across knowledge graphs. In this embodiment, by determining the category conflict matrix between the categories to which each entity in the two knowledge graphs belongs, category information is introduced, and the similarity is adjusted based on the category conflict matrix in a certain way, which may have a certain impact on the similarity and thus affect the entity alignment of the knowledge graph, that is, entity category conflict information is introduced in the entity alignment process of the knowledge graph, so that entity alignment reduces alignment errors caused by category conflicts and improves the accuracy of entity alignment.
[0062] The entity alignment method of the above-mentioned knowledge graph obtains the entities in the two knowledge graphs to be aligned respectively, reads the categories to which each entity belongs, constructs a category conflict matrix between the two knowledge graphs based on the categories, calculates the similarities between the entities in the two knowledge graphs respectively, and finally aligns the entities based on the category conflict matrix and the similarities between the entities to obtain the aligned knowledge graph. The above-mentioned method introduces entity category information by constructing a category conflict matrix. Combining the category conflict matrix for entity alignment can reduce the aggregation of entities with similar names but different meanings, thereby reducing errors in entity alignment.
[0063] In one embodiment, Figure 2As shown, a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned is constructed based on each category, including step S210 and step S220. Wherein: step S210, obtain category relationship information associated with the category; step S220, based on the category relationship information, respectively determine the conflict probability between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned, and obtain the category conflict matrix.
[0064] Among them, after obtaining each entity category in the first knowledge graph to be aligned and each entity category in the second knowledge graph to be aligned, the category relationship between the entity categories of the two knowledge graphs to be aligned is obtained in a certain way, which is the category relationship information in this embodiment; for example, the entity category A1 contained in the first knowledge graph to be aligned and the entity category A2 contained in the second knowledge graph to be aligned, the category relationship between category A1 and category A2 may be: category A1 and category A2 do not conflict, or category A1 and category A2 belong to the same category, or category A1 and category A2 conflict, and so on, which is the category relationship information in this embodiment.
[0065] After determining the conflict probability between each entity category in the first knowledge graph to be aligned and each entity category in the second knowledge graph to be aligned, the category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned can be obtained. Assuming that the first knowledge graph to be aligned contains m entity categories and the second knowledge graph to be aligned contains n entity categories, an m*n category conflict matrix can be obtained.
[0066] In one embodiment, if the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs are the same category, it is determined that the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs is 0. Wherein, a conflict probability of 0 indicates that there is no conflict between the two categories. It can be understood that each category does not conflict with itself at all.
[0067] In another embodiment, the category relationship information includes known entity category conflict relationships associated with the category; in this embodiment, Figure 3 As shown, based on the category relationship information, the conflict probabilities between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned are determined respectively, including step S310: if the category to which the first entity to be aligned belongs and the category to which the first entity to be aligned belongs belong to a known entity category conflict relationship, determine that the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs is 1.
[0068] The known entity category conflict relationship refers to the relationship between two categories that has been clarified in the real world, whether they are conflicting. For example, in a specific embodiment, the category "human" and the category "work" must be conflicting.
[0069] In one embodiment, entity schema (organization and structure of the database) information in the first knowledge graph to be aligned and the second knowledge graph to be aligned is obtained, and whether two categories conflict is determined based on the meta-relationship "owl:disjointWith (expressing that a set of classes are disjoint)" in the schema information; further, in one embodiment, whether two categories conflict is represented by a triple in the schema information. In this embodiment, the triple information representing the category conflict in the schema information in the first knowledge graph to be aligned and the second knowledge graph to be aligned is read as a known entity category conflict relationship.
[0070] After reading the known entity category conflict relations in the first knowledge graph to be aligned and the second knowledge graph to be aligned, if it is determined that the categories to which the two entities belong are in conflict based on the known entity category conflict relations, then the conflict probability corresponding to the categories to which the two entities belong is determined to be 1; it can be understood that a conflict probability of 1 indicates that the two entity categories are completely conflicting.
[0071] In another embodiment, the category relationship information includes: the alignment seeds in the first knowledge graph to be aligned and the second knowledge graph to be aligned; in this embodiment, please continue to refer to Figure 3 , based on the category relationship information, respectively determining the conflict probability between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned, including step S320: if the first entity to be aligned and the second entity to be aligned belong to the alignment seed, determining that the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs is 0.
[0072] Alignment seeds refer to known aligned entities in the first knowledge graph to be aligned and the second knowledge graph to be aligned. For entity alignment tasks, a small number of alignment seeds are usually given as supervisory information. In one embodiment, the alignment seeds include one or more groups of entities that are actually aligned, and a group of entities includes entities in the first knowledge graph to be aligned and entities in the second knowledge graph to be aligned. If it belongs to the alignment seeds, it means that the two entities are aligned. In this embodiment, the corresponding entity categories of the alignment seeds are considered to be related; further, in this embodiment, the categories to which the entities belonging to the alignment seeds belong are determined to be non-conflicting, that is, the corresponding conflict probability is determined to be 0. For example, there is an entity "scientist" in the first knowledge graph to be aligned and an entity "musician" in the second knowledge graph to be aligned. Assuming that "scientist" and "musician" belong to a group of alignment seeds, it is considered that the probability of conflict between the category to which "scientist" belongs and the category to which "musician" belongs is 0.
[0073] In another embodiment, the category relationship information also includes: the subordinate relationship of each category; in this embodiment, please continue to refer to Figure 3 , based on the category relationship information, respectively determining the conflict probability between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned, including step S330 and step S340.
[0074] Step S330 , reading a preset scaling factor, a first category subordination path in the subordination relationship of the category to which the first entity to be aligned belongs, and a second category subordination path in the subordination relationship of the category to which the second entity to be aligned belongs.
[0075] The category affiliation refers to the positive correlation between categories. In one embodiment, the category affiliation includes the parent category to which the category belongs and the subcategories included in the category. In one embodiment, the category affiliation can be represented by a multi-branch tree. Figure 4 The following is a schematic diagram of the subordination relationship of categories in a specific embodiment; wherein the parent class of philosopher is person, the parent class of person is agent (the work or organization that a person is engaged in), and agent is also the parent class of organization. Furthermore, the subordination relationship between the categories can be obtained in any way.
[0076] In one embodiment, the first category affiliation path of the category to which the first entity to be aligned belongs in the affiliation refers to the path from the category to which the first entity to be aligned belongs in the affiliation to the highest parent category (the category at the highest level in the affiliation). If the affiliation is represented by a multi-branch tree, it is the path set from the category to which the first entity to be aligned belongs in the multi-branch tree to the root node. Similar to the category to which the first entity to be aligned belongs, the second category affiliation path can also be determined. Figure 4 Take the multi-branch tree shown as an example, in which the category affiliation corresponding to the entity category philosopher includes: philosopher→person→agent; the category affiliation corresponding to the entity category organisation includes organisation→agent.
[0077] The preset scaling factor is used in this embodiment to calculate the conflict probability between two entity categories and can control the decay speed of the weight; the preset scaling factor can be set according to actual conditions.
[0078] Step S340: determining the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs based on the preset scaling factor, the first category affiliation path and the second category affiliation path.
[0079] In one embodiment, the above method for determining the probability of class conflict is called the path coverage principle.
[0080] Furthermore, if Figure 5 As shown, in one embodiment, based on a preset scaling factor, a first category affiliation path, and a second category affiliation path, determining a conflict probability between a category to which a first entity to be aligned belongs and a category to which a second entity to be aligned belongs includes steps S341 to S344.
[0081] Step S341, determining the intersection and union between the first category affiliation path and the second category affiliation path.
[0082] In set theory, let A and B be two sets, and the set consisting of all elements belonging to set A and set B is called the intersection of set A and set B; accordingly, the set consisting of all elements contained in A and B is called the union of set A and set B. In this embodiment, all categories contained in the first category affiliation path and the second category affiliation path are intersected and unioned.
[0083] Step S342, calculating a first sum of the intersection and the preset scaling factor, and calculating a second sum of the union and the preset scaling factor.
[0084] Step S343, calculating the ratio of the first sum value to the second sum value.
[0085] Step S344: determine the difference between 1 and the ratio as the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs.
[0086] In a specific embodiment, the conflict probability of two entity categories calculated based on the category affiliation path can be expressed by the following formula:
[0087]
[0088] Among them, c i represents the category, P(ci)={c i ,p i,1 ,p i,2 ,…,p i,j} means from c i The category-dependent path to the root node of the category tree, p i,j c i The j-th parent node of ; Dist(ci,cj) represents two categories c i and c j The conflict probability between them is, and K represents the preset scaling factor.
[0089] In the above embodiment, the difference between the first category affiliation path and the second category affiliation path is calculated by intersection and union, and the distance between the two categories in the category affiliation is measured. The greater the distance between the two categories in the category affiliation, the greater the probability of conflict between the two categories. It can be understood that when c i =c j , then Dist(ci,cj)=0; if c i and c j are on the same branch of the tree, then The closer the distance between the two, the smaller the probability of conflict.
[0090] In this embodiment, by defining a method for determining the conflict probability between entity categories, the category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned can be determined based on the above method, which is subsequently used for entity alignment across knowledge graphs.
[0091] In another embodiment, the probability of category conflict between each entity category in the first knowledge graph to be aligned and the second knowledge graph to be aligned can also be determined by probability statistics, thereby generating a corresponding category conflict probability. In one embodiment, a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned is constructed based on each category, including: counting the probability statistical information of the known category relationship between the categories included in the first knowledge graph to be aligned and the categories included in the second knowledge graph to be aligned; based on the probability statistical information of the known category relationship, determining the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs, and obtaining a category conflict matrix.
[0092] In actual applications, for the same category, the known category relationship may have different category relationships in different application scenarios. In this embodiment, by counting the category relationships between categories in different application scenarios, the probability of conflict between categories is determined based on the probability corresponding to each category relationship. For example, in a specific embodiment, assuming that category A1 in the first knowledge graph to be aligned and category A2 in the second knowledge graph to be aligned, the category relationship information obtained by statistics in different application scenarios is: the number of conflicts accounts for 1 / 6, and the number of non-conflicts accounts for 5 / 6, then the probability of category conflict between A1 and A2 is considered to be 1 / 6. In other embodiments, determining the probability of conflict between categories based on probability statistical information of known category relationships can also be achieved in other ways.
[0093] Further, in one embodiment, if Figure 6 As shown, each similarity is adjusted based on the category conflict matrix to obtain an adjusted similarity, including steps S610 to S640.
[0094] Step S610, arbitrarily select a first target entity in the first knowledge graph to be aligned and a second target entity in the second knowledge graph to be aligned.
[0095] Step S620 , reading the target conflict probability between the category to which the first target entity belongs and the category to which the second target entity belongs in the category conflict matrix.
[0096] Step S630, calculating the difference between 1 and the target conflict probability.
[0097] Step S640: multiplying the difference by the target similarity to determine the adjusted similarity between the first target entity and the second target entity; the target similarity includes the similarity between the first target entity and the second target entity.
[0098] The above steps may be performed for each entity category in the first knowledge graph to be aligned and each entity category in the second knowledge graph to be aligned to obtain the adjusted similarity between all entity categories.
[0099] In a specific embodiment, the similarity between entities is represented by cosine distance; Figure 6 The steps in the illustrated embodiment can be expressed by the following formula:
[0100] sim(ei,ej)=(1-v i,j )cos(ei,ej);
[0101] Among them, sim(e i ,e j ) represents entity e i and e j The adjusted similarity between i,j Represents entity e i and e j The conflict probability between categories, cos(e i ,e j ) represents entity e i and e j The similarity between them; if v i,j =1, that is, the two categories are completely conflicting, then sim(e i ,e j )=0, two entities with complete category conflict should not be aligned; if 0 <v i,j <1, which is equivalent to multiplying the prediction result by a weight to obtain the adjusted similarity.
[0102] In another embodiment, Figure 7 As shown, each similarity is adjusted based on the category conflict matrix to obtain an adjusted similarity, including steps S710 to S760.
[0103] Step S710, reading a preset weight coefficient.
[0104] Step S720, arbitrarily select a first target entity in the first knowledge graph to be aligned and a second target entity in the second knowledge graph to be aligned.
[0105] Step S730 , reading the target conflict probability between the category to which the first target entity belongs and the category to which the second target entity belongs in the category conflict matrix.
[0106] Step S740, calculating a first difference between 1 and a preset weight coefficient, and calculating a second difference between 1 and the target conflict probability.
[0107] Step S750, calculating a first product of a preset weight coefficient and a target similarity, and calculating a second product of a first difference and a second difference; the target similarity includes a similarity between a first target entity and a second target entity.
[0108] Step S760: Determine the sum of the first product and the second product as the adjusted similarity between the first target entity and the second target entity.
[0109] The above steps may be performed for each entity category in the first knowledge graph to be aligned and each entity category in the second knowledge graph to be aligned to obtain the adjusted similarity between all entity categories.
[0110] In a specific embodiment, the similarity between entities is represented by cosine distance; Figure 7 The steps in the illustrated embodiment can be expressed by the following formula:
[0111] sim(ei,ej)=βcos(ei,ej)+(1-β)(1-v i,j );
[0112] Among them, β is the preset weight coefficient, cos(e i ,e j ) represents entity e i and e j The similarity between i,j Represents entity e i and e j The conflict probability between the categories, similarly, if v i,j =1, that is, the two categories are completely conflicting, then sim(e i ,e j )=0, two entities with complete category conflict should not be aligned; if 0 <v i,j <1, which is equivalent to multiplying the prediction result by a weight to obtain the adjusted similarity.
[0113] Figure 6In the embodiment shown, the category conflict probability is regarded as the weight of the entity embedding representation, and Figure 7 In the embodiment shown, two pieces of information are considered: one is the similarity of the entity embedding representation, and the other is the probability that the classes corresponding to the entities do not conflict (1-v i,j ). The methods in both embodiments can calculate the corresponding adjusted similarity, which is subsequently used for entity alignment across knowledge graphs.
[0114] Furthermore, in one embodiment, after obtaining the adjusted similarity between the first entity to be aligned and the second entity to be aligned, entity alignment is performed on the first knowledge graph to be aligned and the second knowledge graph to be aligned based on the adjusted similarity to obtain an aligned knowledge graph.
[0115] In one embodiment, entity alignment is performed on the first knowledge graph to be aligned and the second knowledge graph to be aligned based on the adjusted similarity to obtain the aligned knowledge graph, including: determining the first entity to be aligned and the second entity to be aligned corresponding to the adjusted similarity with the largest value as the alignment result. That is, for each first entity to be aligned, the nearest neighbor is found in the second entity to be aligned based on the adjusted similarity as the alignment result for alignment.
[0116] In the above embodiment, category information is introduced into entity alignment by constructing a category conflict matrix on the basis of the traditional method, which can reduce alignment errors caused by category conflicts in knowledge graph entity alignment, thereby improving the accuracy of knowledge graph entity alignment.
[0117] Furthermore, in one embodiment, the entity alignment method of the above-mentioned knowledge graph can be performed as a whole; or the entity alignment method of the above-mentioned knowledge graph can be divided into two stages. In the first stage, the conflict probability is first determined. If it is greater than a certain threshold, it is skipped. If it is less than a certain threshold, it enters the second stage to perform entity alignment.
[0118] The present application also provides an application scenario, which applies the above-mentioned entity alignment method of the knowledge graph, such as Figure 8 The figure shows a schematic diagram of the method steps in this embodiment. Specifically, the application of the entity alignment method of the knowledge graph in this application scenario is as follows:
[0119] First, each entity in the first knowledge graph to be aligned and the second knowledge graph to be aligned is obtained, and a category conflict matrix between each entity in the first knowledge graph to be aligned and the second knowledge graph to be aligned is constructed according to the following rules.
[0120] 1. Each category does not conflict with itself;
[0121] 2. Determine whether two categories conflict based on the meta-relation "owl:disjointWith" in the schema. For example, the schema defines a triple ("person", "disjointWith", "work"), which means that the categories "human" and "work" conflict;
[0122] 3. First, use the categories in the ontology schema to form a multi-branch tree according to the parent-child relationship. Each node in the tree is a category, and the edges define the subordinate relationship of the categories.
[0123] For a category c i , from c i The set of categories that lead to the root node of the category tree is P(ci)={c i ,p i,1 ,p i,2 ,…,p i,j}, that is, the above-mentioned category affiliation, where p i,j c i The j-th parent node of . Given two categories c i and c j , the probability of conflict between the two Dist(ci,cj) is defined as follows:
[0124]
[0125] Dist(ci,cj) calculates the difference between P(ci) and P(cj) by intersection and union, measuring c i and c j The distance in the tree. c i and c j The farther the distance in the tree is, the greater the probability of conflict between the two. i =c j , then Dist(ci,cj)=0; if c i and c are on the same branch of the tree, then The closer the distance between the two, the smaller the probability of conflict. K is a scaling factor that controls the decay speed of the weight.
[0126] 4. For entity alignment tasks, a small amount of alignment seeds are usually given as supervision information. The categories corresponding to the two aligned entities should be related, based on this, the category pairs corresponding to the alignment seeds can be considered related.
[0127] Given a batch of alignment seeds AS = {(ei,ej)|ei∈KG1,ej∈KG2} and the mapping relationship between entities and categories M = {(e,c)|e∈KG1,KG2}. KG1 and KG2 are two KGs to be aligned respectively; e i and ej are the entities that need to be aligned in KG1 and KG2 respectively; c is the category corresponding to each entity e. Assume (e i ,e j ) is an aligned entity pair, then we consider their corresponding category pair (c i ,c j ) is also related, that is, the probability of conflict is 0. For example, if there are aligned entities in the dataset whose corresponding categories are "scientists" and "musicians", then the probability of conflict between "scientists" and "musicians" is 0.
[0128] According to the above rules, the conflict probability between the categories to which each entity in the first knowledge graph to be aligned and the second knowledge graph to be aligned can be calculated as follows:
[0129]
[0130] According to the above formula, the category conflict matrix of the first knowledge graph to be aligned and the second knowledge graph to be aligned can be obtained. Each value in the category conflict matrix represents the probability of conflict between each category and other categories.
[0131] After obtaining the category conflict matrix of the two knowledge graphs to be aligned, perform the following steps to align entities:
[0132] First, based on the trained entity alignment model Q, we get each entity e i The embedding representation e i , the cosine distance can be used to measure the similarity between entities:
[0133] sim(e i ,e j )=cos(e i ,e j )
[0134] Each entity and its nearest neighbor are taken as the alignment results, where the entity alignment model can be any entity alignment model, such as MTransE, GCN-Align, BootEA, etc.
[0135] After calculating the similarity, correction can be performed based on the category conflict matrix by dot multiplication or weighted summation:
[0136] (1) Dot product:
[0137] sim(ei,ej)=(1-v i,j )cos(ei,ej),(ei,ej)∈M∧(ej,cj)∈M
[0138] Among them, v i,j For an entity pair (e i ,ej ) corresponds to the category pair (c i ,c j ) class conflict probability. If v i,j = 0, that is, the two categories are completely non-conflicting, then the similarity of the entity depends on the similarity of its embedded representation; if v i,j =1, that is, the two categories are completely conflicting, then sim(e i ,e j )=0, two entities with complete category conflict should not be aligned; if 0 <v i,j <1, which is equivalent to multiplying the prediction result by a weight and re-adjusting the order of the entities.
[0139] (2) Weighted summation:
[0140] sim(ei,ej)=βcos(ei,ej)+(1-β)(1-v i,j );(ei,ci)∈M∧(ej,cj)∈M
[0141] The first method uses the dot product to consider the probability of class conflict as the weight of the entity embedding representation, while the second method considers two pieces of information: one is the similarity of the entity embedding representation, and the other is the probability that the class corresponding to the entity does not conflict (1-v i,j ), weighted fusion of these two parts of information, where β is the weight coefficient.
[0142] The entity alignment method of the knowledge graph in the above embodiment can improve the recall rate of the model and the ranking of correctly aligned entities by introducing a category conflict matrix to detect the category conflict problem in the prediction result. In addition, the similarity of each entity in the entity alignment method of the knowledge graph can be calculated using any entity to implement its model, that is, it can be combined with any model to improve the performance of the model, and the robustness and effectiveness are good.
[0143] In a specific embodiment, the effects of MTransE (a method for embedded entity alignment) and AliNet (an embedded graph alignment algorithm) as well as the entity alignment method of the knowledge graph proposed in this application on DBP15K (FR-EN), DBP15K (JA-EN), SRPRS (EN-FR), and SRPRS (EN-DE) are compared, as shown in Table 1.
[0144]
[0145] Table 1
[0146] It can be seen from the above experimental results that the application of the method provided in this application can improve the accuracy of entity alignment and reduce the category conflicts caused by entity alignment.
[0147] It should be understood that, although each step in each flow chart involved in the above-described embodiment is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have strict order restrictions, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each flow chart involved in the above-described embodiment may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.
[0148] In one embodiment, Fig. 9 As shown, a knowledge graph entity alignment device is provided, which can adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes: an acquisition module 910, a category reading module 920, a conflict matrix construction module 930, a similarity determination module 940 and a similarity determination module 940, wherein:
[0149] An acquisition module 910 is used to acquire each first entity to be aligned of the first knowledge graph to be aligned, and each second entity to be aligned of the second knowledge graph to be aligned;
[0150] A category reading module 920 is used to read the category to which each first entity to be aligned and each second entity to be aligned belong;
[0151] A conflict matrix construction module 930 is used to construct a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned based on each category;
[0152] A similarity determination module 940 is used to respectively determine the similarity between each first entity to be aligned and each second entity to be aligned;
[0153] The entity alignment module 950 is used to perform entity alignment on the first knowledge graph to be aligned and the second knowledge graph to be aligned based on similarity and category conflict matrix to obtain an aligned knowledge graph.
[0154] The entity alignment device of the above-mentioned knowledge graph obtains the entities in the two knowledge graphs to be entity aligned respectively, reads the categories to which each entity belongs, constructs a category conflict matrix between the two knowledge graphs based on the categories, calculates the similarities between the entities in the two knowledge graphs respectively, and finally aligns the entities based on the category conflict matrix and the similarities between the entities to obtain the aligned knowledge graph. The above-mentioned method introduces entity category information by constructing a category conflict matrix. Entity alignment combined with the category conflict matrix can reduce the situation where entities with similar names but different meanings are aggregated together, thereby reducing errors in entity alignment.
[0155] In one embodiment, the conflict matrix construction module 930 of the above-mentioned device includes: a category acquisition unit, used to obtain category relationship information associated with the category; a conflict probability determination unit, used to determine the conflict probability between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned based on the category relationship information, and obtain a category conflict matrix.
[0156] In one embodiment, the category relationship information includes a known entity category conflict relationship associated with the category; in this embodiment, the above-mentioned conflict probability determination unit is specifically used to: if the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belong belong to a known entity category conflict relationship, determine that the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs is 1.
[0157] In one embodiment, the category relationship information includes: alignment seeds in the first knowledge graph to be aligned and the second knowledge graph to be aligned; in this embodiment, the above-mentioned conflict probability determination unit is specifically used to: if the first entity to be aligned and the second entity to be aligned belong to the alignment seeds, determine that the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs is 0.
[0158] In one embodiment, the category relationship information also includes: the subordinate relationship of each category; in this embodiment, the above-mentioned conflict probability determination unit is specifically used to: read a preset scaling factor, a first category subordinate relationship path in the subordinate relationship of the category to which the first entity to be aligned belongs, and a second category subordinate relationship path in the subordinate relationship of the category to which the second entity to be aligned belongs; based on the preset scaling factor, the first category subordinate relationship path and the second category subordinate relationship path, determine the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs.
[0159] Furthermore, in one embodiment, the above-mentioned conflict probability determination unit includes: a path operation subunit, used to determine the intersection and union between the first category subordination path and the second category subordination path; a calculation subunit, used to calculate a first sum of the intersection and a preset scaling factor, and a second sum of the union and the preset scaling factor; calculate a ratio of the first sum to the second sum; and determine the difference between 1 and the ratio as the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs.
[0160] In one embodiment, the entity alignment module 950 of the above-mentioned device includes: a similarity adjustment unit, which is used to adjust each similarity based on the category conflict matrix to obtain an adjusted similarity; the above-mentioned entity alignment module 950 is specifically used to perform entity alignment on the first knowledge graph to be aligned and the second knowledge graph to be aligned according to the adjusted similarity between each first entity to be aligned and each second entity to be aligned.
[0161] Furthermore, in one embodiment, the similarity adjustment unit of the above-mentioned device includes: a selection subunit, used to arbitrarily select a first target entity in the first knowledge graph to be aligned and a second target entity in the second knowledge graph to be aligned; a conflict probability reading subunit, used to read the target conflict probability of the category to which the first target entity belongs and the category to which the second target entity belongs in the category conflict matrix; a calculation subunit, used to calculate the difference between 1 and the target conflict probability; the product of the difference and the target similarity is determined as the adjusted similarity between the first target entity and the second target entity; the target similarity includes the similarity between the first target entity and the second target entity.
[0162] In another embodiment, the similarity adjustment unit of the above-mentioned device includes: a weight reading subunit, which is used to read a preset weight coefficient; a selection subunit, which is used to arbitrarily select a first target entity in the first knowledge graph to be aligned and a second target entity in the second knowledge graph to be aligned; a conflict probability reading subunit, which is used to read the target conflict probability of the category to which the first target entity belongs and the category to which the second target entity belongs in the category conflict matrix; a calculation subunit, which is used to calculate a first difference between 1 and the preset weight coefficient, and calculate a second difference between 1 and the target conflict probability; calculate a first product of the preset weight coefficient and the target similarity, and calculate a second product of the first difference and the second difference; the target similarity includes the similarity between the first target entity and the second target entity; and determine the sum of the first product and the second product as the adjusted similarity between the first target entity and the second target entity.
[0163] For the specific definition of the entity alignment device of the knowledge graph, please refer to the definition of the entity alignment method of the knowledge graph above, which will not be repeated here. Each module in the above-mentioned entity alignment device of the knowledge graph can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0164] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for entity alignment of a knowledge graph is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0165] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0166] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0167] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0168] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.
[0169] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0170] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0171] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A knowledge graph entity alignment method, characterized in that: The method comprises: Obtain each first entity to be aligned of the first knowledge graph to be aligned, and each second entity to be aligned of the second knowledge graph to be aligned; Reading the categories to which each of the first entities to be aligned and each of the second entities to be aligned belong; Based on each of the categories, a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned is constructed; the category conflict matrix is used to represent the probability of conflict between the category to which each entity contained in the first knowledge graph to be aligned belongs and the category to which each entity contained in the second knowledge graph to be aligned belongs; when the first knowledge graph to be aligned contains m entity categories and the second knowledge graph to be aligned contains n entity categories, an m*n category conflict matrix is constructed; respectively determining the similarity between each of the first entities to be aligned and each of the second entities to be aligned; Based on the similarity and the category conflict matrix, entity alignment is performed on the first knowledge graph to be aligned and the second knowledge graph to be aligned to obtain an aligned knowledge graph.
2. The entity alignment method of the knowledge graph according to claim 1 is characterized in that: The step of constructing a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned based on each of the categories includes: Obtaining category relationship information associated with the category; Based on the category relationship information, the conflict probabilities between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned are determined respectively to obtain the category conflict matrix.
3. The entity alignment method of the knowledge graph according to claim 2 is characterized in that: Include at least one of the following: The first item, The category relationship information includes known entity category conflict relationships associated with the category; The determining, based on the category relationship information, respectively the conflict probabilities between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned includes: if the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belong to belong to the known entity category conflict relationship, determining that the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs is 1; The second item, The category relationship information includes: alignment seeds in the first knowledge graph to be aligned and the second knowledge graph to be aligned; The determining, based on the category relationship information, respectively, the conflict probability between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned includes: if the first entity to be aligned and the second entity to be aligned belong to the alignment seed, determining that the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs is 0; The third item, The category relationship information includes: the subordinate relationship of each category; The determining, based on the category relationship information, respectively the conflict probabilities between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned comprises: Reading a preset scaling factor, a first category subordination path of the category to which the first entity to be aligned belongs in the subordination, and a second category subordination path of the category to which the second entity to be aligned belongs in the subordination; Based on a preset scaling factor, the first category affiliation path, and the second category affiliation path, a conflict probability between the category to which the first to-be-aligned entity belongs and the category to which the second to-be-aligned entity belongs is determined.
4. The entity alignment method of the knowledge graph according to claim 3 is characterized in that: The determining, based on a preset scaling factor, the first category affiliation path, and the second category affiliation path, a conflict probability between a category to which the first to-be-aligned entity belongs and a category to which the second to-be-aligned entity belongs includes: determining an intersection and a union between the first category affiliation path and the second category affiliation path; Calculate a first sum of the intersection and the preset scaling factor, and a second sum of the union and the preset scaling factor; Calculating a ratio of the first sum value to the second sum value; The difference between 1 and the ratio is determined as the conflict probability between the category to which the first to-be-aligned entity belongs and the category to which the second to-be-aligned entity belongs.
5. The entity alignment method of the knowledge graph according to claim 1, characterized in that: The performing entity alignment on the first knowledge graph to be aligned and the second knowledge graph to be aligned based on the similarity and the category conflict matrix includes: Adjusting each of the similarities based on the category conflict matrix to obtain an adjusted similarity; Entity alignment is performed on the first knowledge graph to be aligned and the second knowledge graph to be aligned according to the adjusted similarities between each of the first entities to be aligned and each of the second entities to be aligned.
6. The entity alignment method of the knowledge graph according to claim 5, characterized in that: The adjusting each of the similarities based on the category conflict matrix to obtain an adjusted similarity includes: Arbitrarily select a first target entity in the first knowledge graph to be aligned and a second target entity in the second knowledge graph to be aligned; Reading the target conflict probability between the category to which the first target entity belongs and the category to which the second target entity belongs in the category conflict matrix; Calculate the difference between 1 and the target conflict probability; The product of the difference and the target similarity is determined as the adjusted similarity between the first target entity and the second target entity; the target similarity includes the similarity between the first target entity and the second target entity.
7. The entity alignment method of the knowledge graph according to claim 5, characterized in that: The adjusting each of the similarities based on the category conflict matrix to obtain an adjusted similarity includes: Read the preset weight coefficient; Arbitrarily select a first target entity in the first knowledge graph to be aligned and a second target entity in the second knowledge graph to be aligned; Reading the target conflict probability between the category to which the first target entity belongs and the category to which the second target entity belongs in the category conflict matrix; Calculate a first difference between 1 and the preset weight coefficient, and calculate a second difference between 1 and the target conflict probability; Calculating a first product of the preset weight coefficient and the target similarity, and calculating a second product of the first difference and the second difference; the target similarity includes the similarity between the first target entity and the second target entity; The sum of the first product and the second product is determined as the adjusted similarity between the first target entity and the second target entity.
8. A knowledge graph entity alignment device, characterized in that: The device comprises: An acquisition module, used to acquire each first entity to be aligned of the first knowledge graph to be aligned, and each second entity to be aligned of the second knowledge graph to be aligned; A category reading module, used for reading the category to which each of the first entities to be aligned and each of the second entities to be aligned belong; A conflict matrix construction module is used to construct a category conflict matrix between the first knowledge graph to be aligned and the second knowledge graph to be aligned based on each of the categories; the category conflict matrix is used to represent the probability of conflict between the category to which each entity contained in the first knowledge graph to be aligned belongs and the category to which each entity contained in the second knowledge graph to be aligned belongs; when the first knowledge graph to be aligned contains m entity categories and the second knowledge graph to be aligned contains n entity categories, an m*n category conflict matrix is constructed; a similarity determination module, used to respectively determine the similarity between each of the first entities to be aligned and each of the second entities to be aligned; An entity alignment module is used to perform entity alignment on the first knowledge graph to be aligned and the second knowledge graph to be aligned based on the similarity and the category conflict matrix to obtain an aligned knowledge graph.
9. The entity alignment device for knowledge graph according to claim 8, characterized in that: The conflict matrix building module includes: A category acquisition unit, used to acquire category relationship information associated with the category; A conflict probability determination unit is used to determine the conflict probability between all categories in the first knowledge graph to be aligned and the second knowledge graph to be aligned based on the category relationship information, so as to obtain the category conflict matrix.
10. The entity alignment device for knowledge graph according to claim 9, characterized in that: Include at least one of the following: The first item, The category relationship information includes known entity category conflict relationships associated with the category; The conflict probability determination unit is further configured to determine that the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs is 1 if the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs are in a conflict relationship among the known entity categories; The second item, The category relationship information includes: alignment seeds in the first knowledge graph to be aligned and the second knowledge graph to be aligned; The conflict probability determination unit is further configured to determine that the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs is 0 if the first entity to be aligned and the second entity to be aligned belong to the alignment seed; The third item, The category relationship information includes: the subordinate relationship of each category; The conflict probability determination unit is further used to read a preset scaling factor, a first category subordination path in the subordination to which the first entity to be aligned belongs, and a second category subordination path in the subordination to which the second entity to be aligned belongs; and determine the conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs based on the preset scaling factor, the first category subordination path and the second category subordination path.
11. The entity alignment device for knowledge graph according to claim 10, characterized in that: The conflict probability determination unit includes: a path operation subunit, configured to determine an intersection and a union between the first category affiliation path and the second category affiliation path; A calculation subunit is used to calculate a first sum of the intersection and the preset scaling factor, and a second sum of the union and the preset scaling factor; calculate a ratio of the first sum to the second sum; and determine a difference between 1 and the ratio as a conflict probability between the category to which the first entity to be aligned belongs and the category to which the second entity to be aligned belongs.
12. The entity alignment device for knowledge graph according to claim 8, characterized in that: The entity alignment module is also used to adjust each of the similarities based on the category conflict matrix to obtain an adjusted similarity; and perform entity alignment on the first knowledge graph to be aligned and the second knowledge graph to be aligned according to the adjusted similarities between each of the first entities to be aligned and each of the second entities to be aligned.
13. The entity alignment device for knowledge graph according to claim 12, characterized in that: The entity alignment module comprises: A selection subunit, used to arbitrarily select a first target entity in the first knowledge graph to be aligned and a second target entity in the second knowledge graph to be aligned; A conflict probability reading subunit, used for reading the target conflict probability between the category to which the first target entity belongs and the category to which the second target entity belongs in the category conflict matrix; A calculation subunit is used to calculate the difference between 1 and the target conflict probability; the product of the difference and the target similarity is determined as the adjusted similarity between the first target entity and the second target entity; the target similarity includes the similarity between the first target entity and the second target entity.
14. The entity alignment device for knowledge graph according to claim 12, characterized in that: The entity alignment module comprises: A weight reading subunit is used to read a preset weight coefficient; A selection subunit, used to arbitrarily select a first target entity in the first knowledge graph to be aligned and a second target entity in the second knowledge graph to be aligned; A conflict probability reading subunit, used for reading the target conflict probability between the category to which the first target entity belongs and the category to which the second target entity belongs in the category conflict matrix; A calculation subunit is used to calculate a first difference between 1 and the preset weight coefficient, and calculate a second difference between 1 and the target conflict probability; calculate a first product of the preset weight coefficient and the target similarity, and calculate a second product of the first difference and the second difference; the target similarity includes the similarity between the first target entity and the second target entity; and determine the sum of the first product and the second product as the adjusted similarity between the first target entity and the second target entity.
15. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
16. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
