Knowledge graph-based semantic collaborative reasoning method
By generating cross-graph semantic anchors, combining the TransR and BERT models to calculate entity similarity, and using search algorithms to generate initial collaborative reasoning paths, the problem of ignoring semantic consistency in cross-knowledge graph reasoning is solved, improving accuracy and efficiency.
Patent Information
- Application Number
- CN202510994573.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-10-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies do not explicitly consider the character matching of entity attributes and entity names in cross-knowledge graph reasoning, resulting in the neglect of semantic consistency at the attribute level, affecting the accuracy of cross-graph reasoning.
By generating cross-graph semantic anchors, combining the TransR model and the BERT model to generate entity semantic feature vectors, calculating cosine similarity and edit distance, and combining the semantic consistency score and attribute similarity, cross-graph entity pairs with high comprehensive similarity are screened out, and the initial collaborative reasoning path is generated using the breadth-first or depth-first search algorithm.
It improves the accuracy and efficiency of cross-graph reasoning, reduces semantic deviations caused by graph heterogeneity, meets the efficiency requirements of real-time reasoning scenarios, and ensures the reliability of collaborative reasoning across multiple knowledge graphs.
Smart Images

Figure CN120806162A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graph technology, and in particular to a semantic collaborative reasoning method based on knowledge graph. Background Art
[0002] Knowledge graph is called knowledge domain visualization or knowledge domain mapping map in the library and information industry. It is a series of various graphics that show the development process and structural relationship of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and to mine, analyze, construct, draw and display knowledge and their interrelationships.
[0003] Publication No. CN112818137A discloses a method and apparatus for collaborative reasoning of multi-source heterogeneous knowledge graphs based on entity alignment. The method includes: determining equivalent relationship paths for the query relationship based on the entity pairs to be inferred and the query relationship between the entity pairs to be inferred; inputting the feature vectors corresponding to each equivalent relationship path into the relational reasoning model to obtain the reasoning result corresponding to the query relationship. The positive sample triples used to train the relational reasoning model are obtained from multiple knowledge graphs. At the same time, the equivalent relationship paths include equivalent relationship paths across knowledge graphs, achieving connectivity between different knowledge graphs. Thus, the relational reasoning model can learn semantic information from multiple knowledge graphs, avoiding the problem of low reasoning accuracy caused by traditional methods of knowledge reasoning on a single knowledge graph.
[0004] However, the above application still has the following problems: the generation of alignment anchor chains in the above application is only based on embedding vector distance and k-order neighbor negative sample training, and does not explicitly consider the character matching of entity attributes and entity names, resulting in the neglect of semantic consistency at the attribute level. When processing heterogeneous representations of the same concept in different graphs, it only relies on embedding vector distance to judge entity alignment, ignoring entity attribute differences and text context semantic deviations, which in turn affects the accuracy of cross-graph reasoning. Summary of the Invention
[0005] In order to solve the technical problems existing in the background technology, the present invention proposes a semantic collaborative reasoning method based on knowledge graph.
[0006] The present invention proposes a semantic collaborative reasoning method based on knowledge graph, which includes the following steps: S1. Obtain multiple knowledge graphs in the target domain. The knowledge graphs store entities, relationships, and attributes in the form of triples. Preprocess multiple knowledge graphs to achieve semantic unification of multiple knowledge graphs; S2. Establish semantic mapping relationships between cross-graph entities in multiple knowledge graphs and generate cross-graph semantic anchors; semantic anchors are semantic bridges connecting entities in different knowledge graphs; S3, acquire an inference task, and generate an initial collaborative inference path set based on the semantic mapping relationship; S4, acquire an inference confidence of an initial collaborative inference path in the initial collaborative inference path set, and take an initial collaborative inference path with an inference confidence greater than a set threshold as a final inference result.
[0007] Preferably, the semantic mapping relationship between the cross-graph entities in the multiple knowledge graphs is established in S2, and cross-graph semantic anchors are generated as follows: Extract entities belonging to different knowledge graphs from the multiple knowledge graphs, and construct cross-graph entity pairs between entities of different knowledge graphs; Suppose both entities of the cross-graph entity pair are cross-graph entities; Embedding representation is performed on the entities belonging to different knowledge graphs to generate entity semantic feature vectors; The purpose of the semantic feature vector is to make the cross-graph entity pair semantically comparable; Acquire the entity semantic feature vectors corresponding to the two entities in the cross-graph entity pair; According to the semantic feature vectors in the entity semantic feature vectors, the cosine similarity between the two entities in the cross-graph entity pair is acquired; The entity name character matching degree between the two entities in the cross-graph entity pair is acquired by using the edit distance algorithm; According to the cosine similarity and the entity name character matching degree, the name similarity between the two entities in the cross-graph entity pair is generated by using the weighted average method; Filter the cross-graph entity pairs with a name similarity greater than a set threshold as cross-graph entity candidate pairs to generate a candidate anchor set; Based on the entity semantic feature vectors, the semantic consistency score of each cross-graph entity candidate pair in the candidate anchor set is acquired by using a graph attention network; According to the multiple knowledge graphs, the attributes of each cross-graph entity in the candidate anchor set are extracted from the knowledge graph, and the attribute similarity score of each cross-graph entity candidate pair in the candidate anchor set is acquired; The semantic consistency score and the attribute similarity score are obtained by using the weighted average method to obtain a comprehensive similarity score; Filter the cross-graph entity candidate pairs in the candidate anchor set with a comprehensive similarity score greater than a set threshold to form an effective candidate pair set; Each cross-graph entity candidate pair in the effective candidate pair set corresponds to a semantic mapping, the semantic mapping relationship between the cross-graph entities in the multiple knowledge graphs is established, and each cross-graph entity candidate pair in the effective candidate pair set is taken as a cross-graph semantic anchor.
[0008] Preferably, the entity semantic feature vector in S2 includes a structural feature vector and a semantic feature vector; For the structural feature vector, the TransR model is used to map the entities and relations in the knowledge graph into a low-dimensional vector space, so that each entity or relation in the knowledge graph corresponds to a numerical vector, solving the problem of different representations of the same concept in different knowledge graphs; and the structural information of the connection of the entities in the knowledge graph through the relations is retained to generate the structural feature vector; The low-dimensional vector space is a 50-300 dimensional vector space; The structural feature generated by the knowledge graph embedding is extracted from the entities and relations in the knowledge graph, and is used to describe the connection relationship and position attribute of the entity in the graph; For the semantic feature vector, the text of the knowledge graph entity is encoded by the BERT model to generate a vector containing context semantics, and the semantic feature vector is obtained; The BERT word embedding feature of the entity text description is extracted from the text description of the knowledge graph entity, and is used to describe the semantic meaning and context association of the entity.
[0009] Preferably, in S2, the attributes of each cross-graph entity in the candidate anchor point set are extracted from the knowledge graph according to multiple knowledge graphs, and the attribute similarity score of each cross-graph entity candidate pair in the candidate anchor point set is obtained, as follows: Among the two attributes corresponding to the cross-graph entity candidate pair, the Jaccard coefficient is used to calculate the attribute set overlap degree; The attributes are divided into numerical attributes and text attributes; Among the two attributes corresponding to the cross-graph entity candidate pair, if both attributes are numerical attributes, the normalized Euclidean distance of the two attributes is obtained, and the attribute similarity score of the cross-graph entity candidate is obtained by weighted average of the normalized Euclidean distance and the attribute set overlap degree; Among the two attributes corresponding to the cross-graph entity candidate pair, if both attributes are text attributes, the cosine similarity of the two attributes is obtained, and the attribute similarity score of the cross-graph entity candidate is obtained by weighted average of the cosine similarity and the attribute set overlap degree; Among the two attributes corresponding to the cross-graph entity candidate pair, if both attributes exist simultaneously as numerical attributes and text attributes, the normalized Euclidean distance of the numerical attributes of the two attributes is obtained, and the cosine similarity of the text attributes of the two attributes is obtained, and the attribute similarity score of the cross-graph entity candidate is obtained by weighted average of the normalized Euclidean distance, the cosine similarity and the attribute set overlap degree.
[0010] Preferably, in S3, the reasoning task is obtained, and an initial collaborative reasoning path set is generated based on the semantic mapping relationship, as follows: Based on the effective candidate pair set and multiple knowledge graphs, a cross-graph association graph is generated; According to the reasoning task, cross-graph entities are screened out from the cross-graph association graph as seed entities through natural language processing technology, and a plurality of seed entities are obtained; A breadth-first search or depth-first search algorithm is adopted to generate an association sequence containing at least two cross-graph entities from the seed entities in the cross-graph association graph, a plurality of seed entities obtain a plurality of association sequences, and each seed entity corresponds to an association sequence; Each association sequence generates an initial collaborative reasoning path, and a plurality of initial collaborative reasoning paths are obtained to generate an initial collaborative reasoning path set.
[0011] Preferably, in the S3 cross-graph association graph, the nodes of the cross-graph association graph include cross-graph entities in the effective candidate pair set; The cross-graph association graph edge includes a cross-graph edge and an intra-graph edge; The cross-graph edge is a cross-graph entity candidate pair in which the cross-graph entity is located, and the edge weight is the semantic consistency score of the corresponding cross-graph entity candidate pair; The intra-graph edge is a direct association edge of the cross-graph entity in the knowledge graph to which the cross-graph entity belongs.
[0012] Preferably, in the S4, the reasoning confidence of the initial collaborative reasoning path in the initial collaborative reasoning path set is obtained, as follows: For a certain initial collaborative reasoning path in the initial collaborative reasoning path set, the edge sequence of the certain initial collaborative reasoning path is traversed, the cross-graph edge is identified, the edge weight of the cross-graph edge is obtained, the edge weight set is generated, and the smallest edge weight in the edge weight set is taken as the reasoning confidence of the initial collaborative reasoning path.
[0013] A semantic collaborative reasoning system based on a knowledge graph, comprising: A knowledge graph acquisition module: acquiring a plurality of knowledge graphs of a target field, the knowledge graphs storing entities, relationships and attributes in the form of triples; A cross-graph semantic anchor point generation module: establishing a semantic mapping relationship between cross-graph entities in the plurality of knowledge graphs to generate cross-graph semantic anchor points; An initial collaborative reasoning path set generation module: obtaining a reasoning task and generating an initial collaborative reasoning path set based on the semantic mapping relationship; A reasoning result output module: obtaining the reasoning confidence of the initial collaborative reasoning path in the initial collaborative reasoning path set, and taking the initial collaborative reasoning path with a reasoning confidence greater than a set threshold as the final reasoning result.
[0014] In the present application, the proposed semantic collaborative reasoning method based on a knowledge graph has the following beneficial technical effects: 1.The application embeds entities belonging to different knowledge graphs when generating cross-graph semantic anchor points, generates entity semantic feature vectors, and generates structure feature vectors through the TransR model and semantic feature vectors through the BERT model in the entity semantic feature vectors, thereby fusing the structural information and semantic information of the knowledge graph, enhancing the semantic comparability of cross-graph entities, and solving the representation difference problem of the same concept in different knowledge graphs; when calculating the similarity of cross-graph entity pairs, not only the cosine similarity of the semantic feature vectors is considered, but also the name character matching degree is calculated by introducing the edit distance algorithm, and the semantic consistency score and attribute similarity are combined, and finally the cross-graph semantic anchor points are obtained through the comprehensive similarity screening, the semantic deviation caused by the heterogeneity of the graph is reduced, and the accuracy of subsequent cross-graph reasoning is improved.
[0015] 2.The application obtains a reasoning task, generates a cross-graph association graph based on an effective candidate pair set and multiple knowledge graphs, filters out cross-graph entities as seed entities from the cross-graph association graph according to the reasoning task through natural language processing technology, uses a breadth-first search or depth-first search algorithm to generate an association sequence from the seed entities in the cross-graph association graph, generates an initial collaborative reasoning path for each association sequence, obtains multiple initial collaborative reasoning paths, does not need iterative training of reinforcement learning, can quickly generate a path set, avoids the time-consuming process of parameter updating in reinforcement learning, significantly shortens the reasoning path generation time consumption compared with reinforcement learning, and effectively meets the efficiency demand of real-time reasoning scenarios; the cross-graph association graph cross-graph edge weight is the semantic consistency score of the corresponding cross-graph entity candidate pair, and the smallest edge weight in the cross-graph edge is taken as the reasoning confidence of the initial collaborative reasoning path, directly reflecting the reliability of the weakest connection in the path, the calculation is simple and the result is highly interpretable, avoiding the complex parameter optimization process, improving the efficiency of multi-knowledge graph collaborative reasoning, and ensuring the reliability of multi-knowledge graph collaborative reasoning.
[0016] Additional aspects and advantages of the application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 A flowchart of a semantic collaborative reasoning method based on a knowledge graph; Figure 2 A principle block diagram of a semantic collaborative reasoning system based on a knowledge graph. DETAILED DESCRIPTION
[0018] Embodiments of the present application are described below in the accompanying drawings, of which examples are shown, wherein identical or similar symbols represent identical or similar elements or elements having identical or similar functions throughout. The embodiments described below by reference to the drawings are exemplary only, for the purpose of explaining the present application, and are not to be understood as a limitation of the present application.
[0019] As Figure 1 indicated, a semantic collaborative reasoning method based on a knowledge graph comprises the following steps: S1, obtaining multiple knowledge graphs of a target field, the knowledge graphs storing entities, relationships and attributes in the form of triples; Preprocessing the multiple knowledge graphs to realize semantic unification of the multiple knowledge graphs; S2, establishing a semantic mapping relationship between cross-graph entities in the multiple knowledge graphs to generate cross-graph semantic anchors; the semantic anchors are semantic bridges connecting entities in different knowledge graphs; S3, obtaining a reasoning task and generating an initial collaborative reasoning path set based on the semantic mapping relationship; S4, obtaining a reasoning confidence of an initial collaborative reasoning path in the initial collaborative reasoning path set, and taking an initial collaborative reasoning path with a reasoning confidence greater than a set threshold as a final reasoning result.
[0020] In an optional embodiment, the semantic mapping relationship between cross-graph entities in the multiple knowledge graphs is established in S2 to generate cross-graph semantic anchors, as follows: Extracting entities belonging to different knowledge graphs from the multiple knowledge graphs, and constructing cross-graph entity pairs between entities of different knowledge graphs; Supposing that both entities of the cross-graph entity pair are cross-graph entities; Embedding the entities belonging to different knowledge graphs to generate entity semantic feature vectors; The purpose of the semantic feature vectors is to make the cross-graph entity pairs semantically comparable; Obtaining entity semantic feature vectors corresponding to the two entities in the cross-graph entity pair; According to the semantic feature vectors in the entity semantic feature vectors, obtaining a cosine similarity between the two entities in the cross-graph entity pair; Using an edit distance algorithm to obtain an entity name character matching degree between the two entities in the cross-graph entity pair; According to the cosine similarity and the entity name character matching degree, generating a name similarity between the two entities in the cross-graph entity pair by using a weighted average method; Screening the cross-graph entity pairs with a name similarity greater than a set threshold as cross-graph entity candidate pairs to generate a candidate anchor set; Based on the entity semantic feature vector, the semantic consistency score of each cross-graph entity candidate pair in the candidate anchor point set is obtained through a graph attention network; According to the plurality of knowledge graphs, the attributes of each cross-graph entity in the candidate anchor point set are extracted from the knowledge graphs, and the attribute similarity score of each cross-graph entity candidate pair in the candidate anchor point set is obtained; The semantic consistency score and the attribute similarity score are obtained by weighted average method to obtain a comprehensive similarity score; The cross-graph entity candidate pairs in the candidate anchor point set with a comprehensive similarity score greater than a set threshold are screened to form an effective candidate pair set; Each cross-graph entity candidate pair in the effective candidate pair set corresponds to a semantic mapping, and a semantic mapping relationship between cross-graph entities in the plurality of knowledge graphs is established, and each cross-graph entity candidate pair in the effective candidate pair set is used as a cross-graph semantic anchor point.
[0021] The entity semantic feature vector in S2 includes a structural feature vector and a semantic feature vector; For the structural feature vector, the TransR model is used to map the entities and relationships in the knowledge graph to a low-dimensional vector space, so that each entity or relationship in the knowledge graph corresponds to a numerical vector, solving the problem of different representations of the same concept in different knowledge graphs; and the structural information of the entities connected by the relationships in the knowledge graph is retained to generate the structural feature vector; The TransR model is an existing model for knowledge graph representation learning, which maps entities and relationships to different spaces and uses a transformation matrix for mapping to solve the limitations of traditional models in handling complex relationships; The low-dimensional vector space is a 50-300 dimensional vector space; Specifically, the TransR model is used to map the entities and relationships in the knowledge graph to a 100-dimensional vector space.
[0022] The structural features generated by the knowledge graph embedding are extracted from the entities and relationships in the knowledge graph, and are used to describe the connection relationship and position attribute of the entity in the graph; For the semantic feature vector, the text of the knowledge graph entity is encoded by the BERT model to generate a vector containing the context semantics, and the semantic feature vector is obtained; The BERT word embedding features of the entity text description are extracted from the text description of the knowledge graph entity, and are used to describe the semantic meaning and context association of the entity; The BERT model is an existing pre-trained language model based on the Transformer encoder architecture, which simultaneously captures the context semantic dependency of words in the text through a bidirectional attention mechanism.
[0023] The TransR model is combined with the BERT model, the entity name character matching degree, the attribute similarity and the semantic consistency are considered synchronously, the mapping accuracy of the cross-graph entity is improved, and the limitation of only relying on the embedding vector in the prior art is broken through.
[0024] In S2, attributes of each cross-graph entity in the candidate anchor point set are extracted from the knowledge graphs according to the multiple knowledge graphs, and attribute similarity scores of each cross-graph entity candidate pair in the candidate anchor point set are obtained, as follows: In the two attributes corresponding to the cross-graph entity candidate pair, the attribute set overlap degree is calculated by using the Jaccard coefficient; The Jaccard coefficient is an existing index for measuring the similarity of two sets, and the calculation method is that the number of intersection elements of the two sets is divided by the number of union elements; The attributes are divided into numerical attributes and text attributes; In the two attributes corresponding to the cross-graph entity candidate pair, if the two attributes are both numerical attributes, the normalized Euclidean distance of the two attributes is obtained, and the attribute similarity score of the cross-graph entity candidate is obtained by weighted average of the normalized Euclidean distance and the attribute set overlap degree; In the two attributes corresponding to the cross-graph entity candidate pair, if the two attributes are both text attributes, the cosine similarity of the two attributes is obtained, and the attribute similarity score of the cross-graph entity candidate is obtained by weighted average of the cosine similarity and the attribute set overlap degree; In the two attributes corresponding to the cross-graph entity candidate pair, if the two attributes are both numerical attributes and text attributes, the normalized Euclidean distance of the numerical attributes of the two attributes is obtained, and the cosine similarity of the text attributes of the two attributes is obtained, and the attribute similarity score of the cross-graph entity candidate is obtained by weighted average of the normalized Euclidean distance, the cosine similarity and the attribute set overlap degree.
[0025] In the generation of the cross-graph semantic anchor point, the entities belonging to different knowledge graphs are embedded and represented to generate an entity semantic feature vector, in which a structure feature vector is generated by the TransR model and a semantic feature vector is generated by the BERT model, so that the structure information and semantic information of the knowledge graph can be fused, the semantic comparability of the cross-graph entity is enhanced, and the representation difference problem of the same concept in different knowledge graphs is solved; when calculating the similarity of the cross-graph entity pair, not only the cosine similarity of the semantic feature vector is considered, but also the name character matching degree is calculated by introducing the edit distance algorithm, and the semantic consistency score and the attribute similarity are combined, and finally the cross-graph semantic anchor point is obtained by screening the comprehensive similarity, the semantic deviation caused by the graph heterogeneity is reduced, and the accuracy of subsequent cross-graph reasoning is improved.
[0026] In an optional embodiment, in S3, the inference task is obtained, and an initial collaborative inference path set is generated based on the semantic mapping relationship, as follows: Based on the effective candidate pair set and the plurality of knowledge graphs, a cross-graph association graph is generated. According to the inference task, cross-graph entities are filtered from the cross-graph association graph as seed entities through natural language processing technology, and a plurality of seed entities are obtained. A breadth-first search or depth-first search algorithm is used to generate an association sequence containing at least two cross-graph entities from the seed entities in the cross-graph association graph, and a plurality of seed entities obtain a plurality of association sequences, each seed entity corresponding to an association sequence. Each association sequence generates an initial collaborative inference path, and a plurality of initial collaborative inference paths are obtained, generating an initial collaborative inference path set.
[0027] In the cross-graph association graph in S3, the nodes of the cross-graph association graph include the cross-graph entities in the effective candidate pair set; The edges of the cross-graph association graph include cross-graph edges and intra-graph edges; Among them, the cross-graph edge is the cross-graph entity candidate pair where the cross-graph entity is located, and the edge weight is the semantic consistency score of the corresponding cross-graph entity candidate pair; The intra-graph edge is the direct association edge of the cross-graph entity in the knowledge graph to which it belongs.
[0028] In an optional embodiment, in S4, the inference confidence of the initial collaborative inference path in the initial collaborative inference path set is obtained, as follows: For an initial collaborative inference path in the initial collaborative inference path set, the edge sequence of the initial collaborative inference path is traversed, the cross-graph edge is identified, the edge weight of the cross-graph edge is obtained, the edge weight set is generated, and the smallest edge weight in the edge weight set is taken as the inference confidence of the initial collaborative inference path.
[0029] This application obtains a reasoning task, generates a cross-graph association graph based on a valid candidate pair set and multiple knowledge graphs, and selects cross-graph entities as seed entities from the cross-graph association graph through natural language processing technology according to the reasoning task. A breadth-first search or depth-first search algorithm is used to generate an association sequence starting from the seed entity in the cross-graph association graph. Each association sequence generates an initial collaborative reasoning path, and multiple initial collaborative reasoning paths are obtained. No iterative training of reinforcement learning is required, and a path set can be quickly generated, avoiding the time-consuming process of parameter updating in reinforcement learning. Compared with reinforcement learning, the time consumption of reasoning path generation is significantly shortened, effectively meeting the efficiency requirements of real-time reasoning scenarios; the cross-graph edge weight of the cross-graph association graph is the semantic consistency score of the corresponding cross-graph entity candidate pair, and the smallest edge weight in the cross-graph edge is taken as the reasoning confidence of the initial collaborative reasoning path, which directly reflects the reliability of the weakest connection in the path. The calculation is simple and the results are highly interpretable, avoiding the complex parameter tuning process, improving the efficiency of multi-knowledge graph collaborative reasoning, and ensuring the reliability of multi-knowledge graph collaborative reasoning.
[0030] In an optional embodiment, in S4, the reasoning confidence of the initial collaborative reasoning path in the initial collaborative reasoning path set is obtained as follows: For a certain initial collaborative reasoning path in the initial collaborative reasoning path set, traverse the edge sequence of a certain initial collaborative reasoning path, identify cross-graph edges and intra-graph edges, and obtain the cross-graph edge set. and the edge set within the graph ,set up Each element e in represents a cross-graph edge; Let the number of cross-graph edges be ; is the semantic consistency score of the cross-graph edge e; the reciprocal sum of the cross-graph edge weights is ; Assume that the cross-graph edge weight coefficient is α, and the value range of α is 0.6-0.9; Compute the weighted harmonic mean of edge weights across the graph : ; Get the edge weight of the edge in the graph, set Each element S in represents an edge in the graph. is the edge weight of edge S in the graph; Assume the number of edges in the graph is ; β is the attenuation coefficient of the inner edge of the spectrum, β is a positive integer and the value range of β is 2-5; Calculate the exponential decay value of edge weights within the graph : ; is an exponential decay function, which decreases with the number of edges in the graph Increase and decrease; is the arithmetic mean of the edge weights within the graph; Calculate the reasoning confidence of the initial collaborative reasoning path : ; γ is the path length regularization factor; ; ; λ is the length penalty coefficient, and the value range of λ is 0.1-0.3; As a specific illustration: Let the cross-graph edge set , The corresponding semantic consistency score is ; Assume α = 0.7, then ; Edge Sets in Graph , The corresponding edge weights are 0.9 and 0.8; Assume β = 3, then ; At this time, the total number of path edges L=5; if λ=0.2, then ; Then the reasoning confidence of the initial collaborative reasoning path is ; The above method is used to generate the reasoning confidence of the initial collaborative reasoning path. By weighted harmonic averaging and aggregating the cross-graph edge weights to highlight the influence of low-reliability edges, using an exponential decay model to suppress the error accumulation caused by the number of edges within the graph, and combining the path length regularization factor to implement long path penalty, the reasoning accuracy and robustness can be significantly improved. At the same time, the parameters can be adjusted to adapt to the characteristics of multi-domain graphs. Its confidence calculation based on mathematical modeling not only conforms to the reasoning logic in cognitive science, but also forms a scheme that is different from the existing single weight calculation, effectively enhancing the reliability and accuracy of reasoning confidence.
[0031] like Figure 2 The semantic collaborative reasoning system based on knowledge graph shown in FIG includes: Knowledge graph acquisition module: acquires multiple knowledge graphs in the target domain. Knowledge graphs store entities, relationships, and attributes in the form of triples. Cross-graph semantic anchor generation module: establishes semantic mapping relationships between cross-graph entities in multiple knowledge graphs and generates cross-graph semantic anchors; Initial collaborative reasoning path set generation module: obtains reasoning tasks and generates an initial collaborative reasoning path set based on semantic mapping relationships; The reasoning result output module: obtains the reasoning confidence of the initial cooperative reasoning path in the initial cooperative reasoning path set, and takes the initial cooperative reasoning path with the reasoning confidence greater than a set threshold as the final reasoning result.
[0032] Meanwhile, the contents not described in detail in the specification are all the prior art known by the person skilled in the art.
[0033] In the embodiments provided by the present application, it should be understood that the disclosed system or method can be implemented in other manners. For example, the embodiments of the application described above are merely schematic, and the division of the modules is merely a logical function division. In actual implementation, another division manner can be adopted.
[0034] The modules illustrated as separated components can or can not be physically separated, and the components illustrated as modules can or can not be physical modules. They can be located in one position or distributed on a plurality of network modules. According to actual needs, some or all of the modules can be selected to implement the purpose of the embodiments of the present application.
[0035] In addition, each function module in each embodiment of the present application can be integrated in a processing module, or each module can be physically present alone, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of hardware plus software function module.
[0036] It is obvious for those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and the present application can be implemented in other specific forms without departing from the essential characteristics of the present application.
[0037] The above description is merely preferred specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any skilled person in the art can make equivalent replacements or changes to the technical solutions and the inventive concept of the present application within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.
Claims
1. A semantic collaborative reasoning method based on knowledge graph, characterized by: The following steps are involved: S1. Obtain multiple knowledge graphs in the target domain. The knowledge graphs store entities, relationships, and attributes in the form of triples. S2. Establish semantic mapping relationships between cross-graph entities in multiple knowledge graphs and generate cross-graph semantic anchors; S3. Obtain reasoning tasks and generate an initial collaborative reasoning path set based on semantic mapping relationships; S4. Obtain the reasoning confidence of the initial collaborative reasoning path in the initial collaborative reasoning path set, and take the initial collaborative reasoning path with a reasoning confidence greater than a set threshold as the final reasoning result.
2. The semantic collaborative reasoning method based on knowledge graph according to claim 1 is characterized in that: In S2, semantic mapping relationships between cross-graph entities in multiple knowledge graphs are established to generate cross-graph semantic anchors as follows: Extract entities belonging to different knowledge graphs from multiple knowledge graphs, and build cross-graph entity pairs between entities in different knowledge graphs; Assume that both entities of a cross-graph entity pair are cross-graph entities; Embed entities belonging to different knowledge graphs to generate entity semantic feature vectors; Obtain the entity semantic feature vectors corresponding to the two entities in the cross-graph entity pair; Obtain the cosine similarity between two entities in a cross-graph entity pair based on the semantic feature vector in the entity semantic feature vector; The edit distance algorithm is used to obtain the character matching degree of the entity name between two entities in the cross-graph entity pair; Based on the cosine similarity and entity name character matching, the weighted average method is used to generate the name similarity between two entities in the cross-graph entity pair; Filter cross-graph entity pairs whose name similarity is greater than a set threshold as candidate cross-graph entity pairs and generate a candidate anchor point set; Based on the entity semantic feature vector, the graph attention network is used to obtain the semantic consistency score of each cross-graph entity candidate pair in the candidate anchor set; According to multiple knowledge graphs, extract the attributes of each cross-graph entity in the candidate anchor set from the knowledge graph, and obtain the attribute similarity score of each cross-graph entity candidate pair in the candidate anchor set; The semantic consistency score and the attribute similarity score are weighted averaged to obtain a comprehensive similarity score; Filter the cross-graph entity candidate pairs whose comprehensive similarity scores are greater than the set threshold in the candidate anchor point set to form a valid candidate pair set; Each cross-graph entity candidate pair in the valid candidate pair set corresponds to a semantic mapping, and a semantic mapping relationship between cross-graph entities in multiple knowledge graphs is established. Each cross-graph entity candidate pair in the valid candidate pair set serves as a cross-graph semantic anchor.
3. The semantic collaborative reasoning method based on knowledge graph according to claim 2 is characterized in that: The entity semantic feature vector in S2 includes structural feature vector and semantic feature vector; For structural feature vectors, the TransR model is used to map entities and relationships in the knowledge graph into a low-dimensional vector space, so that each entity or relationship in the knowledge graph corresponds to a numerical vector, solving the problem of different representations of the same concept in different knowledge graphs. The structural information of the entities in the knowledge graph connected by relationships is retained to generate structural feature vectors. For semantic feature vectors, the text of the knowledge graph entity is encoded through the BERT model to generate a vector containing contextual semantics to obtain a semantic feature vector.
4. The semantic collaborative reasoning method based on knowledge graph according to claim 3 is characterized in that: In S2, based on multiple knowledge graphs, the attributes of each cross-graph entity in the candidate anchor set are extracted from the knowledge graph, and the attribute similarity score of each cross-graph entity candidate pair in the candidate anchor set is obtained as follows: The Jaccard coefficient is used to calculate the attribute set overlap between the two attributes corresponding to the cross-graph entity candidate pair; Divide attributes into numeric attributes and text attributes; For the two attributes corresponding to the cross-graph entity candidate pair, if both attributes are numerical attributes, obtain the normalized Euclidean distance between the two attributes, and obtain the attribute similarity score of the cross-graph entity candidate by weighted averaging the normalized Euclidean distance and the attribute set overlap; For the two attributes corresponding to the cross-graph entity candidate pair, if both attributes are text attributes, obtain the cosine similarity of the two attributes, and obtain the attribute similarity score of the cross-graph entity candidate by weighted average of the cosine similarity and attribute set overlap; For the two attributes corresponding to the cross-graph entity candidate pair, if both attributes have numerical attributes and textual attributes, the normalized Euclidean distance is obtained for the numerical attributes of the two attributes, and the cosine similarity is obtained for the textual attributes of the two attributes. The attribute similarity score of the cross-graph entity candidate is obtained by weighted averaging the normalized Euclidean distance, cosine similarity and attribute set overlap.
5. The semantic collaborative reasoning method based on knowledge graph according to claim 1 or 4, characterized in that: Obtain the reasoning task from S3 and generate the initial collaborative reasoning path set based on the semantic mapping relationship as follows: Generate a cross-graph association graph based on a valid candidate pair set and multiple knowledge graphs; According to the reasoning task, natural language processing technology is used to filter cross-graph entities from the cross-graph association graph as seed entities to obtain multiple seed entities; Using a breadth-first search or depth-first search algorithm, starting from a seed entity in the cross-graph association graph, a correlation sequence containing at least two cross-graph entities is generated. Multiple seed entities can generate multiple correlation sequences. Each association sequence generates an initial collaborative reasoning path, multiple initial collaborative reasoning paths are obtained, and an initial collaborative reasoning path set is generated.
6. The semantic collaborative reasoning method based on knowledge graph according to claim 5 is characterized in that: In the S3 cross-graph association graph, the nodes of the cross-graph association graph include the cross-graph entities in the valid candidate pair set; Cross-graph association graph edges include cross-graph edges and intra-graph edges; Among them, the cross-graph edge is the cross-graph entity candidate pair where the cross-graph entity is located, and the edge weight is the semantic consistency score of the corresponding cross-graph entity candidate pair; Intra-graph edges are direct association edges between cross-graph entities in the knowledge graph to which they belong.
7. The semantic collaborative reasoning method based on knowledge graph according to claim 6 is characterized in that: In S4, the reasoning confidence of the initial collaborative reasoning path in the initial collaborative reasoning path set is obtained as follows: For an initial collaborative reasoning path in the initial collaborative reasoning path set, traverse the edge sequence of the initial collaborative reasoning path, identify the cross-graph edges, obtain the edge weights of the cross-graph edges, generate an edge weight set, and take the smallest edge weight in the edge weight set as the reasoning confidence of the initial collaborative reasoning path.
8. A semantic collaborative reasoning system based on a knowledge graph, used to use a semantic collaborative reasoning method based on a knowledge graph according to any one of claims 1 to 7, characterized in that: include: Knowledge graph acquisition module: acquires multiple knowledge graphs in the target domain. Knowledge graphs store entities, relationships, and attributes in the form of triples. Cross-graph semantic anchor generation module: establishes semantic mapping relationships between cross-graph entities in multiple knowledge graphs and generates cross-graph semantic anchors; Initial collaborative reasoning path set generation module: obtains reasoning tasks and generates an initial collaborative reasoning path set based on semantic mapping relationships; Reasoning result output module: obtains the reasoning confidence of the initial collaborative reasoning path in the initial collaborative reasoning path set, and takes the initial collaborative reasoning path with a reasoning confidence greater than a set threshold as the final reasoning result.
Citation Information
Patent Citations
Multi-source heterogeneous knowledge graph collaborative reasoning method and device based on entity alignment
CN112818137A
Cited By
Target detection method, system and device based on hierarchical collaborative reasoning
CN121330440A