Knowledge graph potential relation mining method based on semantic perception clustering
Through semantic perception clustering method, the potential relationships are mined in the knowledge graph, and the problems of sparse data and fewer relationships in the knowledge graph are solved, the graph data is enriched, the graph representation learning ability is improved, and better natural language processing and recommendation systems are supported. Task.
Patent Information
- Application Number
- CN202411357308.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-14
AI Technical Summary
The data in the knowledge graph is too sparse and there are fewer types of relationships, which leads to the failure to represent potential relationships, which brings huge difficulties to the knowledge graph representation learning task. The existing methods rely on large-scale data and complex computing processes, which are costly and There is a risk of data quality and difficulty in convergence.
Using the method based on semantic perception clustering, first obtain the user-item interaction graph and knowledge graph, perform semantic perception clustering, establish a virtual relationship matrix, cluster the original relationship through similarity calculation, form a virtual relationship, and then each user Create tables, use relationships in clustering to mine potential relationships, and fuse them into the knowledge graph.
By mining potential relationships in the knowledge graph, the links between items are enriched, the problem of sparse relationships is improved, the data quality of the knowledge graph is improved, and tasks such as natural language processing and recommendation systems are supported.
Smart Images

Figure CN119312908A_ABST
Abstract
Description
[0001] Technology Neighborhood
[0002] The present invention relates to the field of knowledge graph relationship mining, and in particular to a knowledge graph potential relationship mining method based on semantic-aware clustering. Background Art
[0003] Knowledge graphs, as a semantic network structure that describes the intricate relationships between entities in detail, play an important role in cutting-edge technology fields such as natural language processing, information retrieval, and personalized recommendation systems. However, in practical applications, the data in knowledge graphs is too sparse, the types of relationships are relatively rare, and the potential relationships between some entities are not represented, which brings great difficulties and challenges to the knowledge graph representation learning task. In order to enrich and improve the missing relationships in the graph, existing methods mainly expand the data scale and integrate information resources from different channels. However, they are highly dependent on large data sets and complex computing processes, with high implementation costs and potential risks associated with data quality and fusion difficulties. Summary of the invention
[0004] The present invention aims to solve the above problems existing in the prior art and provide a method for mining potential relationships in knowledge graphs based on semantic-aware clustering.
[0005] The technical solution of the present invention is: a knowledge graph potential relationship mining method based on semantic-aware clustering, which is carried out in the following steps:
[0006] Step 1. Obtain the user-item interaction graph G1 = {(u, r0, i) | u∈U, i∈I}, where U and I represent the user set and item set respectively, r0 is the interaction relationship, and I = {i1, i2, i3…i N}, U={u1,u2,u3…u M}, r0 = 1 means that user u has interacted with item i, if not, r0 = 0; obtain the knowledge graph G2 = {(h,r,t)|h,t∈V,r∈R}, V and R represent the entity set and relationship set respectively, where V = {v1,v2,v3…v L}, R={r1,r2,r3…r K}, the triple (h, r, t) indicates that there is a relationship r between entity h and entity t;
[0007] Step 2. In the knowledge graph G2, perform semantic-aware clustering on all relations r0:
[0008] Step 2.1 First, initialize all virtual relations into a virtual centroid matrix O∈R n×d , where O=(o1,o2,…o n ) T , row n on ∈R d is the representation of the nth virtual relationship, n is the number of virtual relationships;
[0009] Step 2.2 Calculate the similarity between the original relation and the virtual relation in G2. For relation r K ∈R, construct similarity vector s k ∈R K ,in
[0010] s k =(g(r k ,o1),g(r k ,o2),...g(r k ,o n ))
[0011] g(r k ,o n )=r k To n
[0012] r k ∈R d It is a relationship k embedding, g(·) is a similarity function; if the relationship r k With virtual relationship n The similarity is the highest, so the original relationship r k Clustering to virtual relations n When all relations are clustered, the relations in G2 are represented as follows: R = {1r1, 1r2, 2r3, 2r4, ... nr K}, where 1r1, 1r2 means r1, r2 are clustered into the virtual relation o1, and 2r3, 2r4 means r3, r4 are clustered into the virtual relation o2;
[0013] Step 3. Based on the obtained user-item interaction graph G1 and knowledge graph G2, n tables are created for each user, that is, different tables are established according to the different relationships in each virtual relationship cluster. The row index of the table is the number of item I, the column index of the table is the relationship R in the current cluster, and the last column adds the interaction relationship r0, and the value in the table is the entity v l , define the equation ρ(i N ,r k )=v l , indicating that item i N In the relationship k The corresponding entity is v l , if there is no corresponding entity, the value in the table is 0, and the value of the r0 column is 0 or 1;
[0014] Step 4. To mine potential relationships based on every two relationships in the created table, the following steps are performed separately in each clustering table:
[0015] Step 4.1 According to the table, in the relationship r x and the relationship y Between corresponding entities, define a tuple set where x,y∈K and x≠y, Represents r x The entity set under the relationship, Represents r y The entity set under the relationship, take all non-empty subsets of the tuple set as R" xy , define R”(r x ,r y ) are two pairs of relations r x and r y The support set of all possible potential relations is expressed as follows:
[0016]
[0017] Step 4.2 Divide all items in the table into the following two steps:
[0018] Step 4.2.1: Based on the interaction relationship r0, a partitioning method B is formed to divide all items into two parts, namely, items that have interacted with the user and items that have not interacted with the user. The resulting B is a set, which contains two subsets. One subset is all items that have interacted with the user, and the other subset is the remaining items that have not interacted with the user. That is, the union of the two subsets is all items.
[0019] Step 4.2.2 Based on any two relations {r x ,r y}, according to all possible potential relationships R" xy The value set of Q is different x,y The division is as follows:
[0020] Q x,y ={R″(r x ,r y ),IR″(r x ,r y )}
[0021] Step 4.3 Define the indicator sim to calculate Q according to the following formula x,y The similarity between A and B;
[0022]
[0023] When Q x,yThe potential relationship R″ corresponding to the maximum similarity with B xy It is a useful potential relationship. If there is a situation with the same similarity, it is necessary to calculate the number of tuples in the potential relationship and select the potential relationship containing fewer tuples;
[0024] Step 4.4 Add the potential relationship to the table, and the item in the potential relationship R″ xy The corresponding values are:
[0025] ρ(i n ,R″ xy )=v' xy
[0026] Execute steps 4.1-4.4 repeatedly until the corresponding potential relationships in each cluster are mined;
[0027] Step 5: The mined potential relationship R″ xy are all connected to the knowledge graph G2, that is, if ρ(i n ,R″ xy )=v' xy , then add a new triple (i n ,R″ xy ,v' xy ), v' xy It is a new virtual entity created. The subscript xy indicates that the original relationship r is used. x and the original relation r y The potential relationship R″ mined xy Entity to link to.
[0028] The present invention is different from the existing data mining methods for knowledge graphs, which only use the existing relationship information of the knowledge graph and ignore the importance of potential relationships in the knowledge graph. First, the user-item interaction bipartite graph and the knowledge graph are obtained; then, all relationships are semantically clustered in the knowledge graph; then multiple tables are established for each user, each row in the table represents an item, each column represents a relationship in the same cluster, and the value in the table represents the entity between the corresponding item and the relationship; finally, through the proposed similarity calculation method, the pairwise relationship in the same cluster is used to mine potential relationships, and these potential relationships are integrated into the original knowledge graph. The present invention mines the potential relationships in the knowledge graph, establishes better links between items, thereby enriching the useful information of the items, effectively improving the phenomenon of scarce relationships in the knowledge graph, solving the limitations of the existing technology, and being more helpful for subsequent tasks such as natural language processing and recommendation systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 The user-item bipartite graph G1 obtained in this embodiment of the present invention.
[0030] Figure 2 The object-entity knowledge graph G2 obtained in this embodiment of the present invention.
[0031] Figure 3 The knowledge graph G with potential relationships newly generated in the embodiment of the present invention. DETAILED DESCRIPTION
[0032] The present invention provides a knowledge graph potential relationship mining method based on semantic-aware clustering. Figure 1 As shown, follow the steps below:
[0033] Step 1. Get Figure 2 The user-item interaction graph G1 = {(u, r0, i) | u∈U, i∈I} shown in the figure, where U and I represent the user set and item set respectively, r0 is the interaction relationship, and I = {i1, i2, i3…i N}, U={u1,u2,u3…u M}, r0 = 1 means that user u has interacted with item i, if not, r0 = 0; get Figure 3 The knowledge graph G2 shown is G2 = {(h, r, t) | h, t∈V, r∈R}, where V and R represent entity sets and relationship sets respectively, and V = {v1, v2, v3…v L}, R={r1,r2,r3…r K}, the triple (h, r, t) indicates that there is a relationship r between entity h and entity t;
[0034] Step 2. In the knowledge graph G2, perform semantic-aware clustering on all relations r0:
[0035] Step 2.1 In order to cluster the original relations with potential correlation into a virtual relation, first initialize all virtual relations into a virtual centroid matrix O∈R n×d , where O=(o1,o2,…o n ) T , row n o n ∈R d is the representation of the nth virtual relationship, n is the number of virtual relationships, taking the number of virtual relationships as 2 as an example, then O = (o1, o2) T ;
[0036] Step 2.2 Calculate the similarity between the original relation and the virtual relation in G2. For relation r K ∈R, construct similarity vector s k ∈R K ,in
[0037] s k =(g(r k ,o1),g(rk , o2),... g(r k , o n ))
[0038] g(r k , o n ) = r k To n
[0039] r k ∈ R d is the embedding of the relationship r k , g(·) is a similarity function, and the inner product function is used in the embodiments of the present invention; if the relationship r k has the highest similarity with the virtual relationship o n , the original relationship r k will be clustered into the class of the virtual relationship o n ; after all relationships are clustered, the relationships in G2 are represented as follows: R = {1r1, 1r2, 2r3, 2r4,... nr K}, where 1r1, 1r2 mean that r1, r2 are clustered into the virtual relationship o1, and 2r3, 2r4 mean that r3, r4 are clustered into the virtual relationship o2;
[0040] Taking the number of original relationships k = 5 and the number of virtual relationships n = 2 as an example:
[0041] s1 = (g(r1, o1), g(r1, o2))
[0042] s2 = (g(r2, o1), g(r2, o2))
[0043] s3 = (g(r3, o1), g(r3, o2))
[0044] s4 = (g(r4, o1), g(r4, o2))
[0045] s5 = (g(r5, o1), g(r5, o2))
[0046] If: g(r1, o1) > g(r1, o2); g(r2, o1) > g(r2, o2), g(r3, o1) > g(r3, o2), g(r4, o1) < g(r4, o2), g(r5, o1) < g(r5, o2), then r1, r2, r3 are clustered into 1, and r4, r5 are clustered into 2, R = {1r1, 1r2, 1r3, 2r4, 2r5};
[0047] Step 3. Based on the obtained user-item interaction graph G1 and knowledge graph G2, n = 2 tables are created for each user, that is, different tables are established according to the different relationships in each virtual relationship cluster, such as Table 1 and Table 2. The row index of the table is the number of item I, and the column index of the table is the relationship R in the current cluster. The last column adds the interaction relationship r0, and the value in the table is the entity v l , define the equation ρ(i N ,r k )=v l , indicating that item i N In the relationship k The corresponding entity is v l , if there is no corresponding entity, the value in the table is 0, and the value of the r0 column is 0 or 1;
[0048] Table 1
[0049] <![CDATA[1r1]]> <![CDATA[1r2]]> <![CDATA[1r3]]> <![CDATA[r0]]> <![CDATA[i1]]> <![CDATA[v1]]> <![CDATA[v2]]> <![CDATA[v6]]> 1 <![CDATA[i2]]> <![CDATA[v3]]> <![CDATA[v4]]> 0 0 <![CDATA[i3]]> <![CDATA[v1]]> <![CDATA[v2]]> <![CDATA[v4]]> 0 <![CDATA[i4]]> <![CDATA[v5]]> <![CDATA[v4]]> 0 1 <![CDATA[i5]]> <![CDATA[v5]]> <![CDATA[v2]]> <![CDATA[v6]]> 0
[0050] Table 2
[0051] <![CDATA[2r4]]> <![CDATA[2r5]]> <![CDATA[r0]]> <![CDATA[i1]]> <![CDATA[v1]]> <![CDATA[v2]]> 1 <![CDATA[i2]]> <![CDATA[v4]]> <![CDATA[v2]]> 0 <![CDATA[i3]]> <![CDATA[v1]]> 0 0 <![CDATA[i4]]> 0 <![CDATA[v4]]> 1 <![CDATA[i5]]> <![CDATA[v5]]> <![CDATA[v2]]> 0
[0052] Table 1 can be described as follows: the items that the user has interacted with are i1 and i4. Item i1 has a 1r1 relationship with entity v1, a 1r2 relationship with entity v2, and a 1r3 relationship with entity v6; the items that the user has not interacted with are i2, i3, and i5. Item i2 has a 1r1 relationship with entity v3 and a 1r2 relationship with entity v4. Item i2 has no corresponding entity under relationship 1r3, so it is filled with "0"...
[0053] Step 4. Mining potential relationships based on every two relationships in the created table. The following steps are performed in each clustering table:
[0054] Step 4.1 According to the table, in the relationship r x and the relationship y Between corresponding entities, define a tuple set where x,y∈K and x≠y, Represents r x The entity set under the relationship, Represents r y The entity set under the relation, take all non-empty subsets of the tuple set as R″ xy , define R”(r x ,r y ) are two pairs of relations r x and r y The support set of all possible potential relations is expressed as follows:
[0055]
[0056] Taking relations 1r1 and 1r2 in Table 1 as examples, the tuple set V″ xy The set is {(v1,v2), (v3,v4), (v5,v4), (v5,v2)}, and its non-empty subset R″ xy They are: {(v1,v2)}, {(v3,v4)}, {(v5,v4)}, {(v5,v2)}, {(v1,v2), (v3,v4)}, {(v3,v4), (v5,v4)}, {(v5,v4), (v5,v2)}, {(v1,v2), (v3,v4), (v5,v4)}... The support sets R" (r1,r2) of the mutual relations of 1r1 and 1r2 are: {{i1,i3},{i2,i4,i5}}, {{i2},{i1,i3,i4,i5}}, {{i4},{i1,i2,i3,i5}}...
[0057] Step 4.2 Divide all items in the table into the following two steps:
[0058] Step 4.2.1: Based on the interaction relationship r0, a partitioning method B is formed to divide all items into two parts, namely, items that have interacted with the user and items that have not interacted with the user. The resulting B is a set, which contains two subsets. One subset is all items that have interacted with the user, and the other subset is the remaining items that have not interacted with the user. That is, the union of the two subsets is all items:
[0059] B = {{i1,i4},{i2,i3,i5}};
[0060] Step 4.2.2 Based on any two relations {r x ,r y}, according to all possible potential relationships R″ xy The value set of Q is different x,y The division is as follows:
[0061] Q x,y ={R″(r x ,r y ),IR″(r x ,r y )}
[0062] When taking R 12 = {(v1,v2)}, Q 1,2 ={{i1,i3},{i2,i4,i5}};
[0063] When taking R 12 ={(v1,v2),(v3,v4)}, W1,2 ={{i1,i2,i3Q,{i4,i5}};
[0064] When taking R 12 ={(v1,v2),(v5,v4)}, Q 1,2 ={{i1,i3,i4},{i2,i5}}; ......
[0066] Step 4.3 In order to mine useful potential relationships, the indicator sim is defined as follows to calculate Q x,y The similarity between A and B. A high similarity indicates a good quality of the potential relationship.
[0067]
[0068] When Q x,y The potential relationship R″ corresponding to the maximum similarity with B xy It is a useful potential relationship. If there is a situation with the same similarity, it is necessary to calculate the number of tuples in the potential relationship and select the potential relationship containing fewer tuples;
[0069] When taking R 12 ={(v1,v2)}:
[0070] Q 1,2 ={{i1,i3},{i2,i4,i5}};
[0071] Q 1,2 ∩B={{i1},{i3},{i4},{i2,i5}};
[0072]
[0073] When taking R 12 ={(v1,v2),(v3,v4)}:
[0074] Q 1,2 ={{i1,i2,i3},{i4,i5}};
[0075] Q 1,2 ∩B={{i2,i3},{i1},{i4},{i5}};
[0076]
[0077] When taking R 12 ={(v1,v2),(v5,v4)}:
[0078] Q 1,2 ={{i1,i3,i4},{i2,i5}};
[0079] Q 1,2 ∩B={{i1,i4},{i3},{i2,i5}};
[0080]
[0081] So R″ 12 ={(v1,v2),(v5,v4)} is the potential relationship we mined;
[0082] Step 4.4 Add the potential relationship to the table, and the item in the potential relationship R″ xy The corresponding values are:
[0083] ρ(i n ,R″ xy )=v' xy
[0084] That is, ρ(i1,R″ 12 )=v' 12 ,ρ(i3,R″ 12 )=v' 12 ,ρ(i4,R″ 12 )=v' 12 ;
[0085] Execute steps 4.1-4.4 repeatedly until the corresponding potential relationships in each cluster are mined;
[0086] Step 5: The mined potential relationship R″ xy are all connected to the knowledge graph G2, that is, if ρ(i n ,R″ xy )=v' xy , then add a new triple (i n ,R″ xy ,v′ xy ), v' xy It is a new virtual entity created. The subscript xy indicates that the original relationship r is used. x and the original relation r y The potential relationship R″ mined xy Finally, all potential relationships and virtual entities are linked to the knowledge graph to form a Figure 3 The knowledge graph shown.
Claims
1. A knowledge graph potential relationship mining algorithm based on semantic-aware clustering, characterized by Follow these steps: Step 1. Obtain the user-item interaction graph G1 = {(u, r0, i) | u∈U, i∈I}, where U and I represent the user set and item set respectively, r0 is the interaction relationship, and I = [i1, i2, i3…i N }, U={u1,u2,u3…u M }, r0 = 1 means that user u has interacted with item i, if not, r0 = 0; obtain the knowledge graph G2 = {(h,r,t)|h,t∈V,r∈R}, V and R represent the entity set and relationship set respectively, where V = {v1,v2,v3…v L }, R={r1,r2,r3…r K }, the triple (h, r, t) indicates that there is a relationship r between entity h and entity t; Step 2. In the knowledge graph G2, perform semantic-aware clustering on all relations r0: Step 2.1 First, initialize all virtual relations into a virtual centroid matrix O∈R n×d , where O=(o1,o2,…o n ) T , row n o n ∈R d is the representation of the nth virtual relationship, n is the number of virtual relationships; Step 2.2 Calculate the similarity between the original relation and the virtual relation in G2. For relation r K ∈R, construct similarity vector s k ∈R K ,in s k =(g(r k ,o1),g(r k ,o2),...g(r k ,o n )) g(r k ,o n )=r k To n r k ∈R d It is a relationship k embedding, g(·) is a similarity function; if the relationship r k With virtual relationship n The similarity is the highest, so the original relationship r k Clustering to virtual relations n When all relations are clustered, the relations in G2 are represented as follows: R = {1r1, 1r2, 2r3, 2r4, ... nr K }, where 1r1, 1r2 means r1, r2 are clustered into the virtual relation o1, and 2r3, 2r4 means r3, r4 are clustered into the virtual relation o2; Step 3. Based on the obtained user-item interaction graph G1 and knowledge graph G2, n tables are created for each user, that is, different tables are established according to the different relationships in each virtual relationship cluster. The row index of the table is the number of item I, the column index of the table is the relationship R in the current cluster, and the last column adds the interaction relationship r0, and the value in the table is the entity v l , define the equation ρ(i N ,r k )=v l , indicating that item i N In the relationship k The corresponding entity is v l , if there is no corresponding entity, the value in the table is 0, and the value of the r0 column is 0 or 1; Step 4. To mine potential relationships based on every two relationships in the created table, the following steps are performed separately in each clustering table: Step 4.1 According to the table, in the relationship r x and the relationship y Between corresponding entities, define a tuple set where x,y∈K and x≠y, Represents r x The entity set under the relationship, Represents r y The entity set under the relationship, take all non-empty subsets of the tuple set as R" xy , define R”(r x ,r y ) are two pairs of relations r x and r y The support set of all possible potential relations is expressed as follows: Step 4.2 Divide all items in the table into the following two steps: Step 4.2.1: Based on the interaction relationship r0, a partitioning method B is formed to divide all items into two parts, namely, items that have interacted with the user and items that have not interacted with the user. The resulting B is a set, which contains two subsets. One subset is all items that have interacted with the user, and the other subset is the remaining items that have not interacted with the user. That is, the union of the two subsets is all items. Step 4.2.2 Based on any two relations {r x ,r y }, according to all possible potential relationships R" xy The value set of Q is different x,y The division is as follows: Q x,y ={R”(r x ,r y ),I-R”(r x ,r y )} Step 4.3 Define the indicator sim to calculate Q according to the following formula x,y The similarity between A and B; When Q x,y The potential relationship R corresponding to the maximum similarity with B" xy It is a useful potential relationship. If there is a situation with the same similarity, it is necessary to calculate the number of tuples in the potential relationship and select the potential relationship containing fewer tuples; Step 4.4 Add the potential relationship to the table, and the items in the potential relationship R" xy The corresponding values are: p(i n "R" xy )=v' xy Execute steps 4.1-4.4 repeatedly until the corresponding potential relationships in each cluster are mined; Step 5: The mined potential relationship R" xy are all connected to the knowledge graph G2, that is, if ρ(i n ,R” xy )=v' xy , then add a new triple (i n ,R” xy ,v' xy ), v' xy It is a new virtual entity created. The subscript xy indicates that the original relationship r is used. x and the original relation r y The potential relationship R" xy Entity to link to.