Mixing retrieval method and system based on knowledge graph, medium and equipment

By employing a knowledge graph-based hybrid retrieval method that combines graph attention networks and Wasserstein distance for entity alignment and relation extraction, the problems of entity relation extraction and multi-source data fusion in the power industry are solved, achieving high-precision and fast retrieval result optimization.

CN120994816APending Publication Date: 2025-11-21SHANDONG LUNENG SOFTWARE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510881358.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing technologies for knowledge graph construction in the power sector suffer from difficulties in entity relationship extraction and entity disambiguation issues during multi-source data fusion. They also fail to effectively handle nested structures and semantic ambiguities of technical terms and have weak handling of data heterogeneity, resulting in insufficient retrieval accuracy and response speed.

Method used

A knowledge graph-based hybrid retrieval method is adopted, which combines ES inverted index and graph attention calculation. The query enhancement vector is generated through graph attention network, entity alignment and conflict resolution are performed using Wasserstein distance, and relation extraction is performed by combining multi-dimensional scoring model to optimize the ranking of retrieval results.

Benefits of technology

It improves retrieval accuracy and response speed, and can adaptively handle entity disambiguation and semantic ambiguity of multi-source data, thereby enhancing the accuracy of retrieval results and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994816A_ABST
    Figure CN120994816A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information retrieval, and discloses a mixed retrieval method and system based on a knowledge graph, a medium and equipment, and the method comprises the steps: obtaining a query statement, carrying out the feature extraction, and generating a query vector; based on the query vector, obtaining a plurality of preliminary retrieval results through full-text retrieval; based on the query vector, searching a plurality of knowledge graph paths related to the query statement in the knowledge graph through graph query; based on the query vector, the preliminary retrieval result and the knowledge graph path, generating a query enhancement vector through a graph attention network; for each preliminary retrieval result, calculating the similarity with the query enhancement vector to obtain a similarity score; for each knowledge graph path, calculating the correlation with the query enhancement vector to obtain a path weight; and combining the similarity score with the path weight, and reordering the preliminary retrieval result. And the retrieval precision is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of information retrieval, in particular to a hybrid retrieval method, system, medium and equipment based on a knowledge graph. BACKGROUND

[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute prior art.

[0003] With the increasing informatization and digitization of enterprise human resource management, and the application of artificial intelligence technology in various professional modules, the retrieval method of human resource data has changed from the previous precise field query to fuzzy query or overall sentence query method, and the retrieval method has changed from the previous precise input to the input of colloquial sentences. In addition, the accuracy requirement of the retrieval result is getting higher and higher, and the response speed requirement is gradually improving.

[0004] Therefore, a retrieval method is needed to accurately and quickly meet the usage habits of users at different levels. The existing retrieval method has the following problems: (1) Insufficient knowledge graph construction: traditional entity relationship extraction relies on rule matching, which is difficult to handle the nested structure and semantic ambiguity of power domain professional terms (such as "pumped storage" being incorrectly segmented into "pumping" and "energy storage"); (2) Weak data heterogeneity processing: entity disambiguation relies on manual rules when fusing multi-source data, which cannot adaptively solve conflicts (such as the entity alignment problem of "Shandong University" and "Shandong" in different systems). SUMMARY

[0005] To solve the above problems, the present application provides a hybrid retrieval method, system, medium and equipment based on a knowledge graph, which combines knowledge graph reasoning and ES inverted index hybrid query mechanism, and performs graph attention calculation on query vectors, preliminary retrieval results and knowledge graph paths to capture the complex semantic relationship between queries, retrieval results and knowledge graph paths. The preliminary retrieval results of ES are optimized, which effectively improves the retrieval accuracy.

[0006] To achieve the above purpose, the present application adopts the following technical solutions: The first aspect of the present application provides a hybrid retrieval method based on a knowledge graph, which comprises: Obtaining a query sentence and performing feature extraction to generate a query vector; Based on the query vector, a plurality of preliminary retrieval results are obtained through full-text retrieval; Based on the query vector, a plurality of knowledge graph paths related to the query sentence are retrieved in the knowledge graph through graph query; Based on the query vector, the preliminary retrieval result and the knowledge graph path, a query enhancement vector is generated through a graph attention network; For each preliminary retrieval result, a similarity score is obtained by calculating the similarity with the query enhancement vector; for each knowledge graph path, a path weight is obtained by calculating the relevance with the query enhancement vector; and the preliminary retrieval result is re-ranked by combining the similarity score and the path weight.

[0007] Further, the entity recognition step in the knowledge graph comprises: For each entity, a character-level feature is extracted using a convolutional neural network; For each entity, a word-level feature is extracted using a bidirectional long short-term memory network; A cross-modal attention mechanism is used to fuse the character-level feature and the word-level feature to generate an entity representation.

[0008] Further, the entity recognition step in the knowledge graph further comprises: if the entities come from different data sources, the entity representations in different data sources are mapped to a unified semantic space, and then the entities are aligned by minimizing the Wasserstein distance.

[0009] Further, the relationship extraction in the knowledge graph uses a multi-dimensional scoring model and a bidirectional attention mechanism.

[0010] The second aspect of the application provides a hybrid retrieval system based on a knowledge graph, comprising: A query sentence is obtained and features are extracted to generate a query vector; Based on the query vector, a plurality of preliminary retrieval results are obtained through full-text retrieval; Based on the query vector, a plurality of knowledge graph paths related to the query sentence are retrieved in the knowledge graph through graph query; Based on the query vector, the preliminary retrieval result and the knowledge graph path, a query enhancement vector is generated through a graph attention network; For each preliminary retrieval result, a similarity score is obtained by calculating the similarity with the query enhancement vector; for each knowledge graph path, a path weight is obtained by calculating the relevance with the query enhancement vector; and the preliminary retrieval result is re-ranked by combining the similarity score and the path weight.

[0011] Further, the entity recognition step in the knowledge graph comprises: For each entity, a character-level feature is extracted using a convolutional neural network; For each entity, a word-level feature is extracted using a bidirectional long short-term memory network; A cross-modal attention mechanism is used to fuse the character-level feature and the word-level feature to generate an entity representation.

[0012] Further, the entity recognition step in the knowledge graph further comprises: if the entity is from different data sources, after mapping the entity representations in different data sources to a unified semantic space, aligning the entities by minimizing the Wasserstein distance.

[0013] Further, the relationship extraction in the knowledge graph adopts a multi-dimensional scoring model and a bidirectional attention mechanism.

[0014] The third aspect of the present application provides a computer readable storage medium, which stores a computer program, the program is executed by a processor, and the program realizes the steps of the knowledge graph-based hybrid retrieval method when executed by the processor.

[0015] The fourth aspect of the present application provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and running on the processor, and the processor realizes the steps of the knowledge graph-based hybrid retrieval method when executing the program.

[0016] Compared with the prior art, the present application has the following advantages: The present application provides a knowledge graph-based hybrid retrieval method, which designs a hybrid query mechanism of knowledge graph reasoning and ES inverted index, and performs graph attention calculation on query vectors, preliminary retrieval results and knowledge graph paths, captures the complex semantic relationship between queries, retrieval results and knowledge graph paths, optimizes the preliminary retrieval results of ES, and effectively improves the retrieval accuracy.

[0017] The present application provides a knowledge graph-based hybrid retrieval method, which realizes entity alignment by minimizing the Wasserstein distance, resolves conflicts, and realizes adaptive fusion of multi-source data. BRIEF DESCRIPTION OF DRAWINGS

[0018] The accompanying drawings, which form a part of this specification, are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification. The embodiments of these drawings illustrate the embodiments of the present application and, together with the description, serve to explain the present application.

[0019] Figure 1 A flowchart of the knowledge graph-based hybrid retrieval method of embodiment one of the present application; Figure 2 A flowchart of entity recognition of embodiment one of the present application; Figure 3 A flowchart of conflict resolution of embodiment one of the present application; Figure 4 A flowchart of the hybrid retrieval mechanism of embodiment one of the present application. DETAILED DESCRIPTION

[0020] The application will be further described below with reference to the drawings and embodiments.

[0021] It should be noted that the following detailed description is exemplary in nature and is intended to provide further description of the application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0022] The embodiments in the application and the features in the embodiments can be combined with each other without conflict. The application will be further described below with reference to the drawings and embodiments.

[0023] Embodiment one The purpose of this embodiment is to provide a hybrid retrieval method based on a knowledge graph.

[0024] The hybrid retrieval method based on a knowledge graph provided in this embodiment, as shown in Figure 1 includes the following steps: Step 1, data preprocessing.

[0025] Obtain multi-source data and perform cleaning, format conversion and feature extraction on the multi-source data to obtain a data set.

[0026] Step 2, knowledge graph construction.

[0027] Based on a multi-modal deep learning model, entity recognition, relationship extraction and knowledge fusion are realized.

[0028] Step 201, for each piece of data (a term) in the data set, perform entity recognition.

[0029] To solve the problem of term segmentation ambiguity in the power field, this embodiment designs a multi-modal entity recognition model, as shown in Figure 2 includes the following components: A character-level feature extraction network using CNN (Convolutional Neural Network) is used to capture local features of a term (such as "extract" and "store" in "pumped storage power station"); A word-level feature extraction network using BiLSTM (Bidirectional Long Short-Term Memory Network) is used to model the context semantic information of a term; A cross-modal attention mechanism is used to fuse character-level features and word-level features to generate the final entity representation.

[0030] Step 202, conflict resolution.

[0031] To handle the entity conflict problem in multi-source data, this embodiment proposes an entity alignment algorithm based on Wasserstein distance, as shown in Figure 3 includes: (1) Entity Embedding: Map entity representations from different data sources into a unified semantic space.

[0032] (2) Distribution Alignment: Calculate the Wasserstein distance between entity embedding distributions.

[0033] Suppose there are two entity sets E1 and E2, each consisting of several entities, each represented by its feature vector. Calculate the Wasserstein distance between each pair of entities.

[0034] Wasserstein distance measures the difference between two probability distributions, with the formula: ; where P and Q are the probability distributions of the entity sets, Γ(P, Q) is the set of joint distributions, d( , ) is the distance between entities and , and is the support set of probability distribution P, i.e., P is defined on the space , and is the support set of probability distribution Q, i.e., Q is defined on the space . The probability distribution of an entity set refers to a probability measure defined on a given set (which can be discrete or continuous), which describes the likelihood of each element (or subset) in the set.

[0035] (3) Conflict Resolution: Align entities by minimizing Wasserstein distance.

[0036] Convert the entity alignment problem into an optimization problem, with the goal of minimizing the Wasserstein distance: ; constraints include: ; in the context of Optimal Transport and Wasserstein distance, and represent the probability mass of two discrete probability distributions P and Q at their respective support points and .

[0037] (4) Use optimization algorithms to solve the optimization problem.

[0038] In this embodiment, the Sinkhorn algorithm is used to solve the above optimization problem, which updates the transport matrix γ={ } iteratively to approximate the optimal solution, with the following steps: Initialization: Set the initial transfer matrix ; Iterative updates: From Probability quality of departure or source distribution P exist Weight at each location; Convergence criterion: When Stop iterating when the value is less than the threshold.

[0039] Step 203: Relation extraction.

[0040] Among them, the relationship extraction in the knowledge graph adopts a multi-dimensional scoring model and a two-way attention mechanism.

[0041] (1) Data preprocessing in the power sector.

[0042] Terminology database construction: Collecting electrical engineering dictionaries (e.g., equipment name: transformer / circuit breaker, fault type: short circuit / overload, operation terminology: closing / insulation testing). Terms are automatically extracted using domain expert annotations or the BERT-CRF model to construct a term embedding layer.

[0043] Text annotation and vectorization: Entities (e.g., <equipment> circuit breaker) and relationships (e.g., <fault cause> overload → <equipment> cable) are labeled using the BIOES annotation system. Context-relevant word vectors are generated using a domain-adapted pre-trained model (e.g., ELECTRA-Power Edition).

[0044] (2) Construction of multi-dimensional scoring model.

[0045] Terminology dimension: Calculate whether candidate entity pairs belong to the power terminology library (e.g., "differential protection" vs. the generic term "action").

[0046] Syntactic dimension: Analyze the dependency paths unique to power texts (such as the verb-object relationship in "insulation aging [leads to] breakdown").

[0047] Semantic dimension: Entity type compatibility is calculated through domain knowledge graph (e.g., "protection device" cannot be directly associated with "weather conditions").

[0048] Context dimension: Capture the paragraph topics of power documents (such as entities under the "Relay Protection" section are more likely to have configuration relationships).

[0049] (3) Post-processing optimization in the power sector.

[0050] Rule validation: Application domain constraint rules (such as "voltage level" must match the equipment, otherwise the prediction result is rejected).

[0051] Uncertainty calibration: Trigger manual review process for low-confidence samples, continuously update the terminology library.

[0052] Step 204, based on entities and relationships, get knowledge graph through knowledge fusion.

[0053] Step 3, mixed retrieval.

[0054] Combined with Elastic Search (ES) and Cypher query, optimize semantic matching through Wasserstein distance.

[0055] Step 301, get query statement and perform format conversion and feature extraction to generate query vector.

[0056] For example, generate query vector through pre-training models such as BERT.

[0057] Step 302, semantic matching optimization.

[0058] Inject knowledge graph reasoning results into ES retrieval results, generate query enhancement vector through graph attention network (GAT), as shown in Figure 4 , including: (1) For query vector, perform keyword matching through ES to return several preliminary retrieval results.

[0059] Assuming the query is "application field of artificial intelligence", the preliminary retrieval results are: "application of artificial intelligence in medical field; application of artificial intelligence in financial field; application of artificial intelligence in education field".

[0060] (2) Semantic representation of preliminary retrieval results: generate vector representation of each retrieval result.

[0061] (3) Representation of knowledge graph path: for query vector, get knowledge graph path related to retrieval term through Cypher query (graph query), usually represented as graph structure data (vector representation of nodes and edges).

[0062] Assuming the query is "application field of artificial intelligence", the knowledge graph path is: "artificial intelligence → application field → medical; artificial intelligence → application field → financial; artificial intelligence → application field → education".

[0063] (4) Semantic enhancement: based on query vector, preliminary retrieval results and knowledge graph path, use GAT (graph attention network) to perform graph attention calculation and generate query enhancement vector to capture complex semantic relationships between query, retrieval results and knowledge graph path.

[0064] (5) Dynamic re-ranking: based on the query enhancement vector and the knowledge graph paths, the preliminary retrieval results are dynamically re-ranked to optimize the final ranking results, the specific steps include: (a) Calculate the relevance of the query enhancement vector and the preliminary retrieval results: use the vector representation (such as text embedding vector) of the query enhancement vector and the preliminary retrieval results to calculate the similarity score (such as cosine similarity).

[0065] (b) Calculate the path weight combined with the knowledge graph path: for each knowledge graph path, calculate its relevance to the query enhancement vector to obtain the path weight (such as the semantic similarity of the nodes in the path or the path length weight).

[0066] Path weight can be decomposed into: SemanticScore StructuralScore; where, + =1 is a hyperparameter that controls the weight of semantics and structure. SemanticScore (semantic score) and StructuralScore (structural score) are two components of path weight , which measure the importance of the path in semantics and structure respectively. SemanticScore reflects the relevance or importance of nodes or edges in the path in semantics. For example, in a knowledge graph, it may represent the semantic similarity between nodes (entities) or the semantic strength of edges (relationships). It can be obtained through text similarity-based, knowledge graph embedding-based, human annotation-based, etc. StructuralScore measures the importance of the path in the topological structure, such as path length, node degree, or path connectivity. It focuses on the structural features of the graph rather than the content. It can be calculated by path length, node centrality, path rarity, etc. For example, if the path “A→B→C” is shorter than “A→D→E→F→C”, its structural score may be higher.

[0067] (c) Dynamic re-ranking: combine the similarity score of step (a) and the path weight of step (b) to generate the final ranking score through Wasserstein distance.

[0068] The calculation formula of the final ranking score is as follows:

[0069] Wherein, ES_Score: the similarity score of the preliminary retrieval result obtained by ES and the query enhancement vector. W(q_vec, doc_vec): the Wasserstein distance between the query vector and the document vector.

[0070] (d) Output the final ranking result: re-rank the preliminary retrieval result according to the final ranking score, and output the optimized retrieval result.

[0071] For example, the query enhancement vector generated by GAT calculates the similarity score with the vector of the preliminary retrieval result (such as the scores are 0.9, 0.8, 0.7 respectively); combined with the knowledge graph path weight (such as the path weights are 0.95, 0.85, 0.75 respectively); through weighted summation (such as the weight ratio is 0.6:0.4:0.3), the final ranking score is obtained, and the re-ranked result is: "application of artificial intelligence in medical field; application of artificial intelligence in financial field; application of artificial intelligence in education field".

[0072] Step 4, the re-ranked result is displayed through the user interface or UI and returned to the user.

[0073] Embodiment two The purpose of this embodiment two is to provide a hybrid retrieval system based on knowledge graph, comprising: Obtain the query statement and perform feature extraction to generate the query vector; Based on the query vector, obtain several preliminary retrieval results through full-text retrieval; Based on the query vector, retrieve several knowledge graph paths related to the query statement in the knowledge graph through graph query; Based on the query vector, the preliminary retrieval result and the knowledge graph path, generate the query enhancement vector through the graph attention network; For each preliminary retrieval result, calculate the similarity with the query enhancement vector to obtain the similarity score; for each knowledge graph path, calculate the relevance with the query enhancement vector to obtain the path weight; combine the similarity score and the path weight to re-rank the preliminary retrieval result.

[0074] Further, the entity recognition step in the knowledge graph comprises: For each entity, extract character-level features using convolutional neural network; For each entity, extract word-level features using bidirectional long short-term memory network; Use cross-modal attention mechanism to fuse character-level features and word-level features to generate entity representation.

[0075] Further, the entity recognition step in the knowledge graph further comprises: if the entity is from different data sources, after mapping the entity representations in different data sources to a unified semantic space, aligning the entities by minimizing the Wasserstein distance.

[0076] Further, the relationship extraction in the knowledge graph adopts a multi-dimensional scoring model and a bidirectional attention mechanism.

[0077] It should be noted that each module in the embodiment corresponds to each step in Embodiment One, and the specific implementation process is the same, which will not be repeated here.

[0078] Embodiment Three The embodiment provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor, and the program is executed by the processor to realize the steps in the knowledge graph-based hybrid retrieval method according to Embodiment One.

[0079] Embodiment Four The embodiment provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and running on the processor, and the processor realizes the steps in the knowledge graph-based hybrid retrieval method according to Embodiment One when executing the program.

[0080] The above only describes the preferred embodiments of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0081] The above describes the specific embodiments of the present application in combination with the accompanying drawings, but is not used to limit the protection scope of the present application. Those skilled in the art should understand that various modifications or changes made on the basis of the technical solutions of the present application without creative labor are still within the protection scope of the present application.

Claims

1. A hybrid retrieval method based on a knowledge graph, characterized in that, The method comprises the following steps: obtaining a query sentence and performing feature extraction to generate a query vector; based on the query vector, obtaining a plurality of preliminary search results through full-text search; based on the query vector, retrieving a plurality of knowledge graph paths related to the query sentence in the knowledge graph through graph query; based on the query vector, the preliminary search results and the knowledge graph paths, generating a query enhanced vector through a graph attention network; for each preliminary search result, calculating the similarity with the query enhanced vector to obtain a similarity score; for each knowledge graph path, calculating the relevance with the query enhanced vector to obtain a path weight; combining the similarity score and the path weight to reorder the preliminary search results. 2.The knowledge graph-based hybrid retrieval method of claim 1, wherein, The entity recognition step in the knowledge graph comprises the following steps: for each entity, extracting character-level features using a convolutional neural network; for each entity, extracting word-level features using a bidirectional long short-term memory network; using a cross-modal attention mechanism to fuse the character-level features and the word-level features to generate an entity representation. 3.The knowledge graph-based hybrid retrieval method of claim 1, wherein, The entity recognition step in the knowledge graph further comprises: if the entities come from different data sources, mapping the entity representations in different data sources to a unified semantic space, and then aligning the entities by minimizing the Wasserstein distance. 4.The knowledge graph-based hybrid retrieval method of claim 1, wherein, The relationship extraction in the knowledge graph adopts a multi-dimensional scoring model and a bidirectional attention mechanism. 5.A hybrid retrieval system based on a knowledge graph, characterized in that, The method comprises the following steps: obtaining a query sentence and performing feature extraction to generate a query vector; based on the query vector, obtaining a plurality of preliminary search results through full-text search; based on the query vector, retrieving a plurality of knowledge graph paths related to the query sentence in the knowledge graph through graph query; based on the query vector, the preliminary search results and the knowledge graph paths, generating a query enhanced vector through a graph attention network; for each preliminary search result, calculating the similarity with the query enhanced vector to obtain a similarity score; for each knowledge graph path, calculating the relevance with the query enhanced vector to obtain a path weight; combining the similarity score and the path weight to reorder the preliminary search results. 6.The knowledge graph-based hybrid retrieval system of claim 5, wherein, The entity recognition step in the knowledge graph comprises the following steps: for each entity, extracting character-level features using a convolutional neural network; for each entity, extracting word-level features using a bidirectional long short-term memory network; using a cross-modal attention mechanism to fuse the character-level features and the word-level features to generate an entity representation. 7.The knowledge graph-based hybrid retrieval system of claim 5, wherein, The entity recognition step in the knowledge graph further comprises: if the entities come from different data sources, mapping the entity representations in different data sources to a unified semantic space, and then aligning the entities by minimizing the Wasserstein distance. 8.The knowledge graph-based hybrid retrieval system of claim 5, wherein, The relationship extraction in the knowledge graph adopts a multi-dimensional scoring model and a bidirectional attention mechanism.

9. A computer readable storage medium having stored thereon a computer program, the program being executable by a processor, characterized in that, The program is executed by the processor to implement the steps of the knowledge graph-based hybrid retrieval method according to any one of claims 1-4.

10. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the steps of the knowledge graph-based hybrid retrieval method according to any one of claims 1-4.