Similarity calculation method of affair atlas and related product
By introducing domain knowledge into the calculation of graph similarity, and utilizing the information similarity model and domain weight fusion features, a bipartite graph is constructed for maximum weight matching. This solves the problem of poor business relevance of the calculation results in the existing technology and achieves more accurate graph similarity calculation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies have failed to effectively incorporate domain knowledge into the calculation of the similarity of the reasoning graphs of conflict mediation cases, resulting in poor business relevance of the calculation results.
Domain knowledge is introduced as prior knowledge. The similarity of target information between the event graphs is analyzed through different types of information similarity models. Domain weights are used to fuse information similarity features, construct a bipartite graph and perform maximum weight matching to calculate graph similarity.
It improves the accuracy of graph similarity calculation and can more accurately reflect the degree of similarity between the graphs of things.
Smart Images

Figure CN121765397A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of graph similarity analysis technology, and in particular to a method for calculating the similarity of a conceptual graph and related products. Background Technology
[0002] Graph similarity calculation is a classic problem in graph theory. Graph similarity calculation includes graph edit distance, graph isomorphism algorithms, kernel function-based methods, and graph neural network embedding methods.
[0003] However, when these algorithms are directly applied to the reasoning graphs of conflict mediation cases, the graph similarity analysis results are poor due to the lack of prior knowledge. Summary of the Invention
[0004] To address or partially address the problems existing in related technologies, this application provides a method and related products for calculating the similarity of a context graph. This method can introduce domain knowledge as prior knowledge to guide the fusion process of information similarity features, which is beneficial for the accurate calculation of graph similarity.
[0005] The first aspect of this application provides a method for calculating the similarity of a reasoning graph, including: Obtain several logic diagrams; Based on different types of information similarity models, the similarity of target information between the aforementioned event graphs is analyzed to obtain information similarity features of different types. Based on domain weights, the similarity features of each piece of information are fused to obtain associated features, wherein the domain weights are determined based on domain knowledge; The weights of each matching edge under the maximum weight matching of the bipartite graph are fused to obtain the graph similarity; the bipartite graph is determined based on the association features.
[0006] The first aspect of this application provides a similarity calculation device for a logic graph, the device comprising: The graph acquisition module is used to acquire several logic graphs. The information extraction module is used to analyze the similarity of target information between the event graphs based on different types of information similarity models, and to obtain information similarity features of different types. The information fusion module is used to fuse the similarity features of each piece of information based on domain weights to obtain associated features; wherein the domain weights are determined based on domain knowledge. The similarity analysis module is used to fuse the weights of each matching edge under the maximum weight matching of the bipartite graph to obtain the graph similarity; the bipartite graph is determined based on the association features.
[0007] A third aspect of this application provides an electronic device, comprising: Processor; and A memory that stores executable code, which, when executed by the processor, causes the processor to perform the method described above.
[0008] A fourth aspect of this application provides a computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.
[0009] The fifth aspect of this application provides a computer program product comprising computer instructions that, when executed by a processor, implement the method described above.
[0010] The technical solution provided in this application may include the following beneficial results: Obtaining several event graphs, each including nodes and edges, with each edge connecting two dissimilar nodes to indicate a relationship between them; analyzing the similarity of target information between event graphs based on different types of information similarity models to obtain different types of information similarity features. Information similarity models can be of different types and are used to perform similarity analysis on target information between event graphs, extracting information similarity features to characterize the similarity of two event graphs in terms of target information. Different types of information similarity models analyze different target information, and after performing similarity analysis on different target information, information similarity features are obtained. Domain weights are determined based on domain knowledge. Based on these domain weights, the information similarity features are fused to obtain association features. These association features integrate the various information similarity features to associate at least two event graphs, characterizing the similarity between them; constructing a bipartite graph using the two event graphs; determining the relevant parameters of the bipartite graph based on the association features; and fusing the weights of each matching edge under the maximum weight matching of the bipartite graph to obtain graph similarity. This design allows for the introduction of domain knowledge as prior knowledge into graph similarity calculation. Domain knowledge includes an assessment of the importance of information involved in the context graph, which can be determined based on prior experience. Domain weights are determined through domain knowledge, guiding the fusion process of information similarity features. This improves the impact of key elements in information similarity features on associated features, making the relevant parameters of the bipartite graph more accurately reflect the degree of similarity between two context graphs, which is beneficial for the accurate calculation of graph similarity.
[0011] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0012] The above and other objects, features and advantages of this application will become more apparent from the more detailed description of exemplary embodiments thereof in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments thereof.
[0013] Figure 1 This is a flowchart illustrating the similarity calculation method for the reasoning graph shown in the embodiments of this application; Figure 2 This is another flowchart illustrating the similarity calculation method for the reasoning graph shown in the embodiments of this application. Figure 3 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation
[0014] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.
[0015] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0016] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0017] Graph similarity calculation is a classic problem in graph theory, encompassing graph edit distance, graph isomorphism algorithms, kernel-based methods, and graph neural network embedding methods. However, when these general algorithms are directly applied to the contextual graph of conflict mediation cases, prior knowledge of the conflict mediation field is not incorporated. For example, the matching weight for "conflict" should be much higher than that for the "parties' geographical location" attribute, resulting in poor business relevance of the calculation results.
[0018] To address the aforementioned issues, this application provides a method for calculating the similarity of a context graph. This method incorporates domain knowledge as prior knowledge to guide the fusion process of information similarity features, which is beneficial for the accurate calculation of graph similarity.
[0019] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.
[0020] Example 1 Figure 1 This is a flowchart illustrating the similarity calculation method for the reasoning graph shown in the embodiments of this application.
[0021] See Figure 1 In one embodiment of this application, a method for calculating the similarity of a reasoning graph is provided, comprising: Step S110: Obtain several logic diagrams.
[0022] The event graph is used to represent the logical process of event development. It includes nodes and edges. Nodes have various types and represent stages in the event development process, as well as the objects involved. For example, the event development process could be a conflict resolution process. Nodes with relationships are connected through edges. These relationships include, but are not limited to, causal relationships, matching relationships, and concurrent relationships.
[0023] Step S120: Based on different types of information similarity models, analyze the similarity of target information between the event graphs to obtain information similarity features of different types.
[0024] The event graph represents different types of target information. Target information includes, but is not limited to, textual and parameter information of the event graph, and can also include node and edge information. The information similarity model is used to calculate the similarity of target information of the same type between two event graphs. Different target information is represented differently in the event graph. For each type of target information, the corresponding information similarity model is used to evaluate the similarity between the target information of two event graphs, resulting in corresponding information similarity features. The information similarity model processes nodes as objects. For each node, the target information is determined from the node type and the edges connected to that node. Each node in one event graph is traversed, and the similarity between that node and each node in the other event graph regarding the target information is calculated, resulting in information similarity features between the two event graphs regarding that target information. Information similarity features are represented in matrix form, where each element of the matrix represents the similarity between a single node in one event graph and a single node in the other graph. Each node in the logic graph is labeled. The row labels of the matrix representing information similarity features are determined by the labels of nodes in one logic graph, and the column labels are determined by the labels of nodes in another logic graph. For example, logic graph G1 includes nodes ui, i=1,…,n, and logic graph G2 includes nodes vj, j=1,…,m. The element in the i-th row and j-th column of the matrix representing information similarity features includes the degree of similarity between nodes ui and vj regarding the target information.
[0025] Step S130: Based on domain weights, fuse the similar features of each piece of information to obtain associated features, wherein the domain weights are determined based on domain knowledge.
[0026] Domain knowledge includes an assessment of the importance of information involved in the event graph. The information involved in the event graph includes node information and / or edge information. Node information includes, for example, the type and / or name of a node. Edge information includes, for example, the type of an edge. The type of an edge can be determined based on the two nodes it connects to. For example, when the types of the two nodes connected by two edges are the same, the two edges are of the same type. If edge e1 connects node a1 and node b1, and e2 connects node a2 and node b2, and the types of nodes a1 and a2 are the same, then edge e1 and edge e2 are determined to be of the same type. Alternatively, one of the nodes connected by an edge can be used as the base node, and the other node connected by the edge can be used as the reference node. The type of an edge can be determined based on the reference node. If edge e1 connects base node a1 and reference node b1, and e2 connects base node a2 and reference node b2, then the types of reference nodes b1 and reference nodes b2 are determined to be the same.
[0027] The information similarity features corresponding to each target information are fused. These features are represented in matrix form, with all target information corresponding to the same matrix size. For two dissimilar information similarity features, such as matrices A and B, the element a in the i-th row and j-th column of matrix A... ij The element b in the i-th row and j-th column of matrix B represents the degree of similarity between node ui in the event graph G1 and node vj in the event graph G2 regarding a target information. ij This represents the similarity between node ui in the context graph G1 and node vj in the context graph G2 regarding another type of target information. Elements at the same position in the context graphs G1 and G2 are fused to obtain the elements with the same correlation feature. The correlation feature is represented in matrix form, such as matrix W. That is, element a... ij and element b ij By merging, we obtain the element w in the i-th row and j-th column of matrix W. ij element w ij It represents the comprehensive similarity between node ui of the event graph G1 and node vj of the event graph G2 when integrating the similarity features of various types of information.
[0028] Step S140 fuses the weights of each matching edge under the maximum weight matching of the bipartite graph to obtain the graph similarity; the bipartite graph is determined based on the association features.
[0029] The association feature has multiple elements wij, each representing the similarity between a node ui in one context graph and a node vj in another. A bipartite graph is constructed between the two context graphs, with one side of an edge connecting a node in one context graph to a node in the other. The weight of the edge is determined based on the wij element corresponding to the nodes on both sides in the association feature. The Kuhn-Munkres algorithm is used to search for the maximum weight matching in the bipartite graph. A matching edge is selected from the edges of the bipartite graph, and the weights of the matching edges are fused to obtain the graph similarity.
[0030] Two vertex sets of a bipartite graph are constructed using the nodes of two event graphs. The nodes ui (i=1,…,n) of event graph G1 are used as the vertex set on one side of the bipartite graph, with each node ui representing a vertex. The nodes vj (j=1,…,m) of event graph G2 are used as the vertex set on the other side of the bipartite graph, with each node vj representing a vertex. Edges connect the nodes ui of event graph G1 and vj of event graph G2, with one side of an edge connecting to a node ui of event graph G1 and the other side connecting to a node vj of event graph G2. The label of each edge is determined based on the nodes ui and vj on both sides, and the edge between nodes ui and vj is denoted as eij. The weights of the edges in the bipartite graph are determined based on the association feature W, where the element wij in the i-th row and j-th column of the association feature W is the weight of edge eij.
[0031] In summary, the technical solution of this application obtains several event graphs, each consisting of nodes and edges. Each edge connects two dissimilar nodes, indicating a relationship between them. Based on different types of information similarity models, the similarity of target information between the event graphs is analyzed, yielding different types of information similarity features. These information similarity models can be of different types and are used to perform similarity analysis on the target information between the event graphs. Information similarity features are extracted to characterize the similarity between two event graphs in terms of target information. Different types of information similarity models analyze different target information, and similarity features are obtained after performing similarity analysis on different target information. Domain weights are determined based on domain knowledge. Based on these domain weights, the information similarity features are fused to obtain association features. These association features integrate the various information similarity features to associate at least two event graphs, characterizing the similarity between them. A bipartite graph is constructed using the two event graphs. The relevant parameters of the bipartite graph are determined based on the association features. The weights of each matching edge under the maximum weight matching in the bipartite graph are fused to obtain the graph similarity. This design allows for the introduction of domain knowledge as prior knowledge into graph similarity calculation. Domain knowledge includes an assessment of the importance of information involved in the context graph, which can be determined based on prior experience. Domain weights are determined through domain knowledge, guiding the fusion process of information similarity features. This improves the impact of key elements in information similarity features on associated features, making the relevant parameters of the bipartite graph more accurately reflect the degree of similarity between two context graphs, which is beneficial for the accurate calculation of graph similarity.
[0032] Example 2 To further explain the similarity calculation method of the reasoning graph in this application, please refer to... Figure 2 The similarity calculation method includes: Step S210: Obtain several logic diagrams.
[0033] In this process, we obtain the event graph G1 and the event graph G2. Event graph G1 has n nodes and event graph G2 has m nodes. We can assume that n <= m.
[0034] Step S120: Based on different types of information similarity models, analyze the similarity of target information between the event graphs to obtain information similarity features of different types.
[0035] In one embodiment, based on different types of information similarity models, the similarity of target information between event graphs is analyzed to obtain different types of information similarity features, including at least: Based on the semantic similarity model, the similarity of semantic information between the event graphs is analyzed to obtain semantic similarity features; wherein, the information similarity model includes the semantic similarity model, the target information includes semantic information, and the information similarity features include semantic similarity features.
[0036] In this embodiment, a semantic similarity model is used to analyze the degree of similarity between semantic information. Word embedding is performed on the semantic information of two event graphs to obtain word vectors. The similarity between the word vectors of the two event graphs is calculated to evaluate the similarity of semantic information, resulting in semantic similarity features. Each node of the two event graphs is traversed, and word embedding is performed on each node individually. This can be done on the node's name and / or the type name of the edges connected to the node, resulting in the node's word vector. Each node of one event graph is traversed, and the similarity between the word vector of the currently traversed node and the word vectors of each node in the other event graph is calculated, resulting in semantic similarity features. Semantic similarity features are represented in matrix form. The elements of the matrix representing semantic similarity features represent the similarity of semantic information between a node in one event graph and a node in the other event graph. A semantic similarity model such as Word2Vec is used, trained with a large number of legal documents and mediation case texts.
[0037] Word2Vec is used to calculate the similarity of nodes in the context graphs G1 and G2, and the i×j order node similarity matrix S is output as semantic similarity feature.
[0038] In the Word2Vec model, each semantic information is represented as a fixed-length vector. These vectors not only effectively express the similarity and analogy relationships between different words but also carry semantic information and play a role in various NLP tasks. Nodes u and v from the context graph G1 and context graph G2 are input into the Word2Vec model. The Word2Vec model returns the semantic similarity, denoted as S(u,v). After matching the word vector similarity between all nodes in context graph G1 and all nodes in context graph G2 through the Word2Vec model, an i×j order node similarity matrix S is obtained as the semantic similarity feature.
[0039] In a context graph, nodes and edges contain different domain semantics and have varying degrees of importance. For example, the "contradiction" node and the "calm" node are completely different in terms of business importance. A semantic similarity model is needed to extract the domain semantics contained in nodes and edges to obtain semantic similarity features for calculating association features.
[0040] In multi-granularity node semantic matching, the semantic similarity of all node pairs in two context graphs is first calculated. This calculation is based on domain word vectors or semantic models. For example, the node "delayed payment" in one graph and the node "payment delay" in another graph, although literal different, are semantically highly similar, resulting in a high similarity score. After traversal processing, a node similarity matrix S is output, where S[i][j] represents the semantic similarity between node i in context graph G1 and node j in context graph G2.
[0041] In one embodiment, based on different types of information similarity models, the similarity of target information between event graphs is analyzed to obtain different types of information similarity features, including at least: Based on the structural similarity model, the similarity of structural information between the event graphs is analyzed to obtain structural similarity features; wherein, the information similarity model includes the structural similarity model, the target information includes structural information, and the information similarity features include structural similarity features.
[0042] In this embodiment, a structural similarity model is used to analyze the degree of similarity between structural information. This is achieved by analyzing the structural information of two logic graphs, where the structural information is represented by the types of edges connected to nodes. The similarity between the structural information of the two nodes is obtained by analyzing the similarity in terms of the weights of edge types and / or the number of edge types between the edges connected to a node in one logic graph and the edges connected to a node in another logic graph. For example, for a node in one logic graph and a node in another logic graph, the weights of each type of edge are obtained. The maximum and minimum values of the weights of each type of edge are calculated in both logic graphs. The minimum weights of each type of edge are summed to obtain the minimum edge weight sum, and the maximum weights of each type of edge are summed to obtain the maximum edge weight sum. The minimum edge weight sum is divided by the maximum edge weight sum, and the quotient is used as the degree of similarity in the structural information between the two nodes. By performing structural similarity analysis on each node in one logic graph and each node in another logic graph, structural similarity features are obtained. By traversing each node of a logic graph, calculating the similarity of structural information between each node and each node of another logic graph, structural similarity features are obtained.
[0043] Structural similarity features are represented in matrix form. The element in the i-th row and j-th column of a structural similarity feature represents the degree of similarity in structural information between the i-th node of one logic graph and the j-th node of another logic graph. For example, for node ui in logic graph G1 and node vj in logic graph G2, the edges connected to node ui and their weights are used to construct a first set, and the edges connected to node vj and their weights are used to construct a second set. The edges connected to node ui and the edges connected to node vj and their weights are taken as a union. Using this union as a reference, the missing edges in the first set are added, and the weights of the added edges are set to 0, resulting in an updated first set. The same process is repeated for the second set, where the missing edges in the second set are added, and the weights of the added edges are set to 0. The updated second set is obtained. The edges of each type in the union of the sets are traversed. For each traversed edge, the minimum and maximum weights of the edges are obtained from the first and second sets, respectively. The minimum and maximum weights of each type of edge are then summed to obtain the minimum edge weight sum, and the maximum weights of each type are summed to obtain the maximum edge weight sum. The minimum edge weight sum is divided by the maximum edge weight sum, and the quotient is used as the similarity of structural information between node ui and node vj. The process of traversing each node in one event graph and calculating the similarity of structural information between each traversed node and each node in another event graph yields structural similarity features.
[0044] Traverse the nodes of the logic graph G1 to obtain the edge set of each node and the weight corresponding to the edge type to construct the first set. Traverse the nodes of the logic graph G2 to obtain the edge set of each corresponding node and the weight corresponding to the edge type to construct the second set. Use the weighted Jaccard algorithm to calculate the node similarity with edge weights, and obtain the i×j order node similarity matrix J as the structural similarity feature. The specific steps include: Step (1): For each node ui in the event graph G1, traverse the edges connected to it to obtain the edge type and its weight, and construct the first set T(ui). For each node vj in the event graph G2, traverse the edges connected to it to obtain the edge type and its weight, and construct the second set T(vj). For any node in G1, denoted as ui, obtain its edges and edge weights to obtain T(ui). For any node in G2, denoted as ui, obtain its edges and edge weights T(vj).
[0045] Step (2), take the union of the edges in T(ui) and T(vj), denoted as .
[0046] Step (3), T(ui) completes its union with respect to the set. The missing edge element, T(ui) = T(ui) ∪ {e, 0}, when e T(ui) and e∈ When T(vj) completes its complement relative to the union, The missing edge element, T(vj) = T(vj) ∪ {e, 0}, when e T(vj) and e∈ In this context, the edges of each node are generally not identical. When the edges of two nodes are combined, one node ui will be missing elements from the other node vj. In {e,0}, e represents an edge, and 0 represents the weight. This means adding a virtual edge to a node. This edge does not exist in the node itself but comes from another node, and the weight of the added virtual edge is recorded as 0, so that the two nodes have the same edge, but the edge weights are different. For example, if T(ui) = {{A1,a1},{{A2,a2}}, T(vj) = {{A2,a3},{B1,b1}}, then after padding, T(ui) = {{A1,a1},{{A2,a2},{B1,0}}, T(vj) = {{A1,0},{A2,a3},{B1,b1}}.
[0047] Step (4), traverse For element e, in T(ui) and T(vj), respectively, obtain the minimum edge weight Min(e) and the maximum edge weight Max(e) of element e. For example, T(ui) = {{A1,a1}, {{A2,a2}, {B1,0}}, T(vj) = {{A1,0}, {A2,a3}, {B1,b1}}, for A1, min(e) = 0, max(e) = a1, for A2, min(e) = a2, max(e) = a3 (assuming a3 > a2), min(e) and max(e) are values taken for A1, A2, and B1 respectively.
[0048] Step (5), for For all elements in the array, sum up the minimum weights of each edge. Summing the maximum values of the weights on each side. ,Will Divide by The resulting quotient represents the edge weight node similarity, that is, the degree of similarity in structural information between node uii and node vjj. When ≠0, J(ui,vj) = Otherwise, J(ui,vj) = 0 Repeat steps (1) to (5) for the remaining nodes of the logic graphs G1 and G2 until all nodes of the logic graphs G1 and G2 have been traversed, and obtain the node similarity matrix J of order i×j as the structural similarity feature.
[0049] Let ui be the i-th node of the logic graph G1 and vj be the j-th node of the logic graph G2. Traverse i and j respectively to obtain J(1,1), J(1,2), ..., J(1,j), J(2,1), ..., J(i,j), ..., J(n,m).
[0050] In one embodiment, the weights of the edges are obtained by analyzing empirical estimates of the importance of the edges using the analytic hierarchy process (AHP).
[0051] In this embodiment, the empirical estimation of edge importance is obtained by experts estimating the importance of each type of edge. The empirical estimation of edge importance is the expert rating of the importance of each type of edge. Based on the Analytic Hierarchy Process (AHP), an edge judgment matrix is constructed using the expert ratings of the importance of each type of edge; an evaluation index judgment matrix is constructed using the expert ratings of the importance of each type of evaluation index; the evaluation index judgment matrix is processed using the sum-product method to obtain the weights of the edge evaluation indexes; the preliminary weights of each type of edge under different evaluation indexes are obtained by processing the edge judgment matrix using the sum-product method; and the preliminary weights of the edges and the weights of the edge evaluation indexes are weighted and fused to obtain the edge weights. Evaluation indexes include, for example, causal necessity and temporal tightness. Causal necessity represents the probability that a cause leads to a consequence, and temporal tightness represents the time interval between two events. The specific process of the AHP is as follows: 1) Construct the target layer. Target a is to evaluate the strength of causal / evolutionary relationship edges.
[0052] 2) Construct the criteria layer and select evaluation indicators b1 and b2. b1 represents causal necessity, and b2 represents temporal tightness: the time interval between the occurrence of two events.
[0053] 3) Construct the solution layer, which includes edge type E, with the following specific types: E1: (When a conflict arises, it is resolved through third-party mediation) E2: (From conflict to calm) E3: (Third-party mediation turns into calm) E4: (Calm down and resolve the conflict) 4) Obtain the weights of the criterion-level judgment matrix and evaluation indicators through expert scoring, as follows:
[0054] 5) Obtain the solution-level judgment matrix, such as matrix b1-E and matrix b2-E, through expert scoring. Matrix b1-E is shown below:
[0055] Matrix b2-E is shown below:
[0056] For the decision matrix of the scheme layer, the "sum-product method" is used to calculate the row sums and normalize them, and the preliminary weights of the edges under different evaluation indicators are calculated as follows:
[0057] The weight calculation process for edges of the same node type is shown in the table below, which yields the weights of edges of each type.
[0058]
[0059] Furthermore, the edge weights determined by the Analytic Hierarchy Process (AHP) are used as the initial edge weights. Machine learning is then used to optimize these initial weights, which are then used as the final edge weights. These AHP weights are used as the initial values for the model, allowing the model to adjust the weights based on real-world data during training.
[0060] A trainable scaling factor α and a trainable bias factor β are introduced to linearly transform the edge weights w0 determined by the analytic hierarchy process (AHP): Trainable weight = α * w0 + β, where α is initialized to 1.0 and β is initialized to 0.0. Initially, the edge weights w0 calculated by AHP are fully trusted. Learning rates for α and β are set to be less than preset thresholds, allowing α and β to adjust slowly to avoid prematurely "forgetting" expert knowledge. Through gradient descent, the model learns the optimal α and β.
[0061] Step S130: Based on domain weights, fuse the similar features of each piece of information to obtain associated features, wherein the domain weights are determined based on domain knowledge.
[0062] In this embodiment, the information similarity feature has multiple elements, and different elements evaluate different nodes. The domain weight is used to assign weights to each element in the information similarity feature, so that the elements of two different information similar features at the same position can be weighted and fused to obtain the elements of the associated feature.
[0063] Traverse the nodes of the context graphs G1 and G2, obtain the corresponding node type weights, and construct the domain weight N(u,v) = (W(u) + W(v)) / 2, where node u belongs to the context graph G1 and node v belongs to the context graph G2. Output the i×j-th order weighted node weights as the domain weight N. The element in the i-th row and j-th column of the weighted node weight matrix is N(i,j) = (Wi + Wj) / 2, where node ui belongs to G1 and node vj belongs to G2, Wi represents the node type weight of node ui, and Wj represents the node type weight of node vj.
[0064] Let \(S(i, j)\) be the semantic similarity feature, \(N(i, j)\) be the domain weight, and \(J(i, j)\) be the structural similarity feature. The weighted Jaccard algorithm is used to calculate the similarity between node \(i\) and node \(j\), and the similarity matrix \(J\) of the edge-connected nodes is output as the structural similarity feature. The formula \(W(i, j)=S(i, j)*N(i, j)*J(i, j)\) is used to fuse the information similarity features, and the node weight matrix \(W\) is constructed as the association feature. If \(i < j\), supplement \(W(i + 1, j)=0,\cdots,W(j, j)=0\) to obtain the \(j\)-order weight matrix \(W\) as the association feature. That is, if the number of nodes in \(G1\) and \(G2\) is different, it needs to be filled. The weights of the corresponding rows or columns of the filled nodes are 0. After filling, \(W\) is a square matrix. The calculation formula is as follows: \(S = , \(N = , \(J =
[0065] \(W = , if \(i < j\), supplement \(W(i + 1, j)=0\) to obtain the supplemented \(W\) as follows:
[0066] In one embodiment, the domain weight is obtained by processing domain knowledge through the analytic hierarchy process.
[0067] In this embodiment, the domain weight is used to characterize the importance of the nodes of one事理图谱 (事理图谱 can be translated as event ontology graph) and the nodes of another event ontology graph in the similarity analysis of the target information. Different nodes have different importance based on the similarity degree of the target information analyzed based on the nodes. For example, the domain weight is represented in the form of a matrix \(W\), and each element \(w\) in the matrix \(W\) ij represents the importance of the similarity analysis of the target information between the \(i\)-th node \(u_i\) of the event ontology graph \(G1\) and the \(j\)-th node \(v_j\) of the event ontology graph \(G2\). The elements in the domain weight are determined according to the weights of the two corresponding nodes of the two event ontology graphs. For example, the elements in the domain weight include the mean value of the weights of the two corresponding nodes of the two event ontology graphs. For example, the weight of the \(i\)-th node \(u_i\) of the event ontology graph \(G1\) is \(w_i\), the weight of the \(j\)-th node \(v_j\) of the event ontology graph \(G2\) is \(w_j\), and the element in the \(i\)-th row and \(j\)-th column of the domain weight \(W\) is \((w_i + w_j) / 2\).
[0068] Furthermore, the weight of the nodes of the event ontology graph is obtained by analyzing the empirical estimation of the importance degree of the nodes through the analytic hierarchy process.
[0069] The empirical estimation of node importance is obtained through expert evaluation of the importance of various node types. This empirical estimation is based on expert ratings of the importance of each node type. Using the Analytic Hierarchy Process (AHP), a node judgment matrix is constructed using expert ratings of node importance for each type. A judgment matrix for evaluation indicators is constructed using expert ratings of the importance of each type of evaluation indicator. The judgment matrix of node evaluation indicators is processed using a sum-product method to obtain the weights of the node evaluation indicators. The preliminary weights of each node type under different evaluation indicators are then processed using the sum-product method again. Finally, the preliminary weights of nodes and the weights of node evaluation indicators are weighted and fused to obtain the node weights. Evaluation indicators include at least one of the following: intensification level, turning point level, and severity of consequences. The specific steps of the AHP include: Step 1) Construct the target layer, target A: assess the criticality of conflict event node types. Step 2) Construct the criteria layer. Through evaluation by business experts in the field of conflict mediation, select three evaluation indicators as the main criteria B. The main criteria B are as follows: B1: Escalation level: The role of this event in promoting the escalation of the conflict.
[0070] B2: Transitional Level: The ability of the event to alter the course of the conflict (whether it worsens or eases).
[0071] B3: Severity of consequences: The severity of the direct consequences of the event.
[0072] Step 3) Construct the solution layer, using the main node type C as the solution layer. Node type C is as follows: C1: A contradiction arises C2: Third-party mediation C3: Calm C4: Conflict Resolution Step 4) Construct the judgment matrix of the criterion layer Based on the assessment of experts in the field of conflict mediation, a judgment matrix was obtained. The judgment matrix of the assessment indicators was constructed by the experts scoring the importance of each type of assessment indicator.
[0073]
[0074] Step 5) Calculate the weights of the criterion layer judgment matrix. The criterion layer judgment matrix is processed using the sum-product method. The row sum and normalization of the criterion layer judgment matrix are calculated to obtain the weights W_B1, W_B2, and W_B3 of the node evaluation index.
[0075]
[0076] Step 6) Construct the scheme layer judgment matrix and build three scheme layer judgment matrices.
[0077] Under B1, the importance comparison matrix B1-C4 between scheme layers C1-C4:
[0078] Under B2, the importance comparison matrix B2-C between schemes C1-C4:
[0079] Under B3, the importance comparison matrix B3-C between schemes C1-C4:
[0080] Step 7) Calculate the weights of the scheme layer judgment matrix The "sum-product method" is used to process the decision matrix of the scheme layer, which involves summing the rows of the decision matrix and normalizing it to obtain the preliminary weights of each type of node under different evaluation indicators.
[0081]
[0082] The initial weights of the nodes and the weights of the node evaluation metrics are weighted and fused to obtain the node's total weight. The total weight of node C is then calculated using the following formula: (W_C_B1 * W_B1) + (W_C_B2 * W_B2) + (W_C_B3 * W_B3) Calculate the final weight of the node type:
[0083] Furthermore, the node weights determined by the Analytic Hierarchy Process (AHP) are used as the initial weights of the nodes. Machine learning is then used to optimize these initial weights, which are then used as the final weights of the nodes. These AHP weights are used as the initial values for the model, allowing the model to adjust them based on real data during training.
[0084] A trainable scaling factor α and a trainable bias factor β are introduced to linearly transform the node weights w0 determined by the analytic hierarchy process (AHP): Trainable weights = α * w0 + β, where α is initialized to 1.0 and β is initialized to 0.0. Initially, the node weights w0 calculated by AHP are fully trusted. Learning rates for α and β are set to be less than preset thresholds, allowing α and β to adjust slowly to avoid prematurely "forgetting" expert knowledge. Through gradient descent, the model learns the optimal α and β.
[0085] In one embodiment, domain knowledge includes the degree of importance assessed by experts on preset attributes of the reasoning graph.
[0086] In this embodiment, preset attributes are used to characterize the types of objects in the event graph, such as nodes and / or edges. Domain knowledge includes expert ratings of the importance of different types of nodes. Domain knowledge also includes expert ratings of the importance of preset attributes between nodes in one event graph and nodes in another event graph. Furthermore, domain knowledge includes expert ratings of the importance of evaluation metrics for preset attributes. A judgment matrix for preset attributes and a judgment matrix for evaluation metrics are constructed using domain knowledge. After processing using the analytic hierarchy process (AHP), the final weights of the preset attributes are obtained as domain weights.
[0087] Step S140 fuses the weights of each matching edge under the maximum weight matching of the bipartite graph to obtain the graph similarity; the bipartite graph is determined based on the association features.
[0088] Using the Kuhn-Munkres algorithm, the maximum weight matching of the bipartite graph is obtained, and the graph similarity Sim(G1, G2) is output. Using the Kuhn-Munkres algorithm, the maximum weight matching of the bipartite graph is obtained, and the weights of the edges of the maximum weight matching of the bipartite graph are summed to output the graph similarity Sim(G1, G2).
[0089] Based on the calculation process of the weight matrix W, for any node u in graph G1, it is connected to all nodes in graph G2, with the edge being W(u,v), satisfying the definition of a complete bipartite graph. Therefore, the Kuhn-Munkres algorithm can be used to find a perfect matching that maximizes the total weight of all matching edges. The specific process is as follows: (1) Initialize the top label lx[i] = max W(i,j) (i.e., the maximum value in each row) ly[j] = 0 Thus, the initial feasibility condition is met: lx[i] + ly[j] >= W(i,j). (2) Use DFS / BFS to find augmenting paths in the equality subgraph (starting from each unmatched X point). (3) If a perfect match is found, end. (4) Otherwise, let S be the set of visited points in X, and T be the set of visited points in Y. (5) Calculate the adjustment amount α = min{lx[i] + ly[j]} w(i,j)∣i∈S,j T} That is: the minimum difference between the edges from S to Y\T and the equal subgraph. (6) Adjust the top marker For all i∈S, lx[i]←lx[i]-α; For all j∈T, ly[j]←ly[j]+α; This guarantees: 1) The edges between ST are still in the equal subgraph because the sum of lx[i] + ly[j] remains unchanged when α is both decreased and increased. 2) At least one new edge from S to Y\T will be added to the equal subgraph, because α is their minimum difference. 3) The other edges still satisfy the feasibility conditions. (7) Go back to (2) and use DFS / BFS to find augmenting paths in the equality subgraph. System Implementation: This method can be integrated into a graph computing engine, which takes two graphs as input and outputs a similarity score between 0 and 1.
[0090] In this embodiment, W(i,j) represents the weight relationship between the i-th node in G1 and the j-th node in G2. This weight relationship can be understood as an edge in a bipartite graph, where the left side is a node of G1 and the right side is a node of G2, and W is the edge between the two nodes. Constructing such a bipartite graph allows for perfect matching calculations using the Kuhn-Munkres algorithm, thus obtaining the maximum total weight between the two graphs. X is the set of nodes u in G1, and Y is the set of nodes v.
[0091] In one embodiment, the weights of each matching edge under the maximum weight matching of the bipartite graph are fused to obtain the graph similarity; the maximum weight matching of the bipartite graph is determined based on association features, including: A bipartite graph is constructed using the nodes of each principle graph, and the weights of the edges in the bipartite graph are determined based on the association features. Based on the matching algorithm, the maximum weight matching of a bipartite graph is analyzed to determine the matching edge. The weights of the matching edges are fused to obtain the graph similarity.
[0092] In this embodiment, the nodes of one event graph are used as the first vertex set of the bipartite graph, and the nodes of another event graph are used as the second vertex set. For each node in the first vertex set, the nodes of the first vertex set are connected to each node in the second vertex set via edges to obtain the bipartite graph. The edge weights are determined based on association features. The weight of the edge between the i-th node of the first vertex set and the j-th node of the second vertex set is determined based on the element in the i-th row and j-th column of the association features. For example, the weight of the edge between the i-th node of the first vertex set and the j-th node of the second vertex set is the value of the element in the i-th row and j-th column of the association features, or a multiple of the element's value. The association features have multiple elements, and each element represents the similarity between the two nodes corresponding to that element after comprehensive analysis of various target information. A matching algorithm is used to search for a path in the bipartite graph that maximizes the sum of the edge weights as the maximum weight matching. The edges traversed by the path are considered matching edges. An example matching algorithm is the Kuhn-Munkres algorithm. The graph similarity is obtained by summing the weights of the matching edges involved in the maximum weight matching.
[0093] In this embodiment, the similarity calculation method for the event graph integrates the structural information, semantic information, and domain knowledge of the event graph to achieve efficient and business-meaning-accurate case similarity assessment. Compared with existing technologies, this invention has the following advantages and effects: 1. Domain knowledge driven: By introducing node type weights and relationship weights, domain knowledge is deeply integrated into the calculation process, making the results more in line with business logic and highly practical.
[0094] 2. Semantic Awareness: Based on a deep learning model, the semantic similarity of nodes is calculated, which can effectively handle problems such as polysemy and synonyms, and is superior to traditional keyword matching.
[0095] 3. Connecting the past and the future: This method is the core bridge connecting "map construction" and "case recommendation". Its high-precision similarity output is the fundamental guarantee for the reliability of the subsequent recommendation system.
[0096] Corresponding to the aforementioned application function implementation method embodiments, this application also provides a similarity calculation device for a reasoning graph, an electronic device, and corresponding embodiments.
[0097] The similarity calculation device for the reasoning graph in this embodiment includes: The graph acquisition module is used to acquire several logic graphs. The information extraction module is used to analyze the similarity of target information between the event graphs based on different types of information similarity models, and to obtain information similarity features of different types. The information fusion module is used to fuse the similarity features of each piece of information based on domain weights to obtain associated features; wherein the domain weights are determined based on domain knowledge. The similarity analysis module is used to fuse the weights of each matching edge under the maximum weight matching of the bipartite graph to obtain the graph similarity; the bipartite graph is determined based on the association features.
[0098] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated further here.
[0099] Figure 3 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application.
[0100] See Figure 3 The electronic device 300 includes a memory 310 and a processor 320.
[0101] The processor 320 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. Memory 310 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by processor 320 or other modules of the computer. Permanent storage devices may be read-write storage devices. Permanent storage devices may be non-volatile storage devices that retain stored instructions and data even when the computer is powered off. In some embodiments, permanent storage devices use mass storage devices (e.g., magnetic or optical disks, flash memory) as permanent storage devices. In other embodiments, permanent storage devices may be removable storage devices (e.g., floppy disks, optical drives). System memory may be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory may store some or all of the instructions and data required by the processor during operation. Furthermore, memory 310 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (e.g., DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, memory 310 may include a removable storage device that is readable and / or writable, such as a laser disc (CD), a read-only digital multifunction optical disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-high density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired connections.
[0102] The memory 310 stores executable code, which, when processed by the processor 320, can cause the processor 320 to execute part or all of the methods described above.
[0103] Furthermore, the method according to this application can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing some or all of the steps in the method described above.
[0104] Alternatively, this application may be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium) storing executable code (or computer program or computer instruction code) that, when executed by a processor of an electronic device (or server, etc.), causes the processor to perform part or all of the steps of the methods described above according to this application.
[0105] This application also provides a computer program product, which includes computer instructions that, when executed by a processor, implement the method described above.
[0106] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for calculating the similarity of a conceptual graph, characterized in that, The method includes: Obtain several logic diagrams; Based on different types of information similarity models, the similarity of target information between the aforementioned event graphs is analyzed to obtain information similarity features of different types. Based on domain weights, the similarity features of each piece of information are fused to obtain associated features, wherein the domain weights are determined based on domain knowledge; The weights of each matching edge under the maximum weight matching of the bipartite graph are fused to obtain the graph similarity; the bipartite graph is determined based on the association features.
2. The method according to claim 1, characterized in that, The method, based on different types of information similarity models, analyzes the similarity of target information between the event graphs to obtain different types of information similarity features, including at least: Based on the semantic similarity model, the similarity of semantic information between the event graphs is analyzed to obtain semantic similarity features; wherein, the information similarity model includes the semantic similarity model, the target information includes the semantic information, and the information similarity features include the semantic similarity features.
3. The method according to claim 1, characterized in that, The method, based on different types of information similarity models, analyzes the similarity of target information between the event graphs to obtain different types of information similarity features, including at least: Based on the structural similarity model, the similarity of structural information between the event graphs is analyzed to obtain structural similarity features; wherein, the information similarity model includes the structural similarity model, the target information includes the structural information, and the information similarity features include the structural similarity features.
4. The method according to claim 1, characterized in that, The domain weights are obtained by processing the domain knowledge using the analytic hierarchy process.
5. The method according to claim 1, characterized in that, The domain knowledge includes the degree of importance assessed by experts on the preset attributes of the reasoning graph.
6. The method according to claim 1, characterized in that, The weights of each matching edge under the maximum weight matching of the bipartite graph are fused to obtain the graph similarity; the bipartite graph is determined based on the association features, including: The bipartite graph is constructed using the nodes of each of the aforementioned event graphs, and the weights of the edges of the bipartite graph are determined based on the associated features. Based on the matching algorithm, the maximum weight matching of the bipartite graph is analyzed to determine the matching edge; The weights of the matching edges are fused to obtain the graph similarity.
7. A similarity calculation device for a conceptual graph, characterized in that, The device includes: The graph acquisition module is used to acquire several logic graphs. The information extraction module is used to analyze the similarity of target information between the event graphs based on different types of information similarity models, and to obtain information similarity features of different types. The information fusion module is used to fuse the similarity features of each piece of information based on domain weights to obtain associated features; wherein the domain weights are determined based on domain knowledge. The similarity analysis module is used to fuse the weights of each matching edge under the maximum weight matching of the bipartite graph to obtain the graph similarity; the bipartite graph is determined based on the association features.
8. An electronic device, characterized in that, include: processor; as well as A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-6.
9. A computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, The computer program product includes computer instructions that, when executed by a processor, implement the method described in any one of claims 1 to 6.