A knowledge graph data retrieval method, device and equipment and storage medium

By constructing an initial weight distribution vector in knowledge graph data retrieval and employing a nonlinear sharpening mechanism, the graph retrieval problems caused by hard truncation and fixed thresholds are solved, achieving higher accuracy and recall, and improving the focus of graph propagation and adaptive noise reduction capabilities.

CN122309717APending Publication Date: 2026-06-30启元实验室
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
启元实验室
Filing Date
2026-06-02
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing knowledge graph data retrieval methods suffer from several problems when faced with complex graph structures and long-tailed data. These problems include hard truncation leading to insensitivity in recalling key nodes, fixed thresholds resulting in poor graph retrieval generalization ability, and long-tail noise from low-relevance nodes causing over-smoothing and drift in PPR (Progression Point Retrieval). These issues significantly reduce the effectiveness of the algorithms.

Method used

By constructing an initial weight distribution vector, a nonlinear sharpening mechanism is used to replace hard truncation, preserving the connectivity of all nodes, sharpening the weights of strong seed nodes and suppressing the initial weights of noisy nodes, and combining jump probabilities and transition matrix parameters to perform iterative weight distribution calculation, thereby improving the focus of graph propagation and adaptive noise reduction capabilities.

Benefits of technology

It effectively improves the accuracy and recall of graph retrieval in complex reasoning scenarios, avoids interference from noisy nodes, and maintains the connectivity of the graph structure and the integrity of multi-hop reasoning paths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122309717A_ABST
    Figure CN122309717A_ABST
Patent Text Reader

Abstract

This application provides a data retrieval method, apparatus, device, and storage medium for knowledge graphs, relating to the field of graph data retrieval technology. A data retrieval method for knowledge graphs includes: in response to a user's query, obtaining an initial candidate node set from a preset knowledge graph; calculating an initial semantic relevance score for each node in the initial candidate node set; constructing an initial weight distribution vector based on the initial semantic relevance score; performing a retrieval in the knowledge graph using a preset algorithm based on the initial weight distribution vector to obtain an iterative weight distribution for each node in the knowledge graph; and sorting each node in the knowledge graph according to the iterative weight distribution to obtain retrieval results corresponding to the query content. According to embodiments of this application, the accuracy and recall of graph retrieval in complex reasoning scenarios can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of graph data retrieval technology, and more specifically, to a data retrieval method, apparatus, device, and storage medium for knowledge graphs. Background Technology

[0002] Existing retrieval augmentation generation (RAG) schemes applied to large language models (LLM) (such as HippoRAG) typically follow a "retrieval-truncation-propagation" paradigm. First, a large number of candidate nodes are recalled through vector retrieval or keyword matching (coarse recall). Then, a reranking model is used to score the candidate nodes. Next, Top-K hard truncation or a fixed threshold is set based on the scores to select a small number of high-scoring nodes as "seed nodes." Finally, a personalized PageRank (PPR) algorithm is run starting from these seed nodes to discover related hidden knowledge by spreading weights through the graph structure.

[0003] When faced with complex graph structures and long-tailed distributed data, current mainstream technical solutions have significant drawbacks in the initial personalized vector generation stage of PPR. These include hard truncation (Top-K) leading to insensitivity of key nodes to recall, fixed threshold resulting in poor graph retrieval generalization ability, and "long-tail noise" from low-relevance nodes causing over-smoothing and drift in PPR. These drawbacks significantly reduce the effectiveness of the PPR algorithm. Summary of the Invention

[0004] According to one aspect of this application, a data retrieval method for a knowledge graph is provided, comprising: in response to a user's query, obtaining an initial candidate node set from a preset knowledge graph; calculating an initial semantic relevance score for each node in the initial candidate node set; constructing an initial weight distribution vector based on the initial semantic relevance score; performing a retrieval in the knowledge graph using a preset algorithm based on the initial weight distribution vector to obtain an iterative weight distribution for each node in the knowledge graph; and sorting each node in the knowledge graph according to the iterative weight distribution to obtain retrieval results corresponding to the query content.

[0005] According to some embodiments, in response to a user's query, an initial candidate node set is obtained from a preset knowledge graph, including: obtaining the node description text of each node in the knowledge graph; calculating the semantic similarity between the query content and the node description text; and obtaining the initial candidate node set based on the semantic similarity according to a preset coarse recall number.

[0006] According to some embodiments, calculating the initial semantic relevance score of each node in the initial candidate node set includes: concatenating the node description text of each node in the initial candidate node set with the query content to use as model input data; and calculating the initial semantic relevance score based on the model input data using a preset model.

[0007] According to some embodiments, an initial weight distribution vector is constructed based on an initial semantic relevance score, including: obtaining a preset temperature coefficient; normalizing the initial semantic relevance score based on the temperature coefficient to obtain the sharpening weight distribution of each node in the initial candidate node set; and constructing an initial weight distribution vector based on the sharpening weight distribution.

[0008] According to some embodiments, before searching the knowledge graph based on the initial weight distribution vector using a preset algorithm, strong seed nodes in the initial candidate node set are determined based on the initial semantic relevance score, wherein the sharpening weight of the strong seed nodes is close to 1 but not 1; nodes other than the strong seed nodes in the initial candidate node set are retained, wherein the sharpening weight of the nodes other than the strong seed nodes in the initial candidate node set is close to 0 but not 0.

[0009] According to some embodiments, based on the initial weight distribution vector, a preset algorithm is used to search the knowledge graph to obtain the iterative weight distribution of each node in the knowledge graph, including: obtaining preset jump probability parameters and transition matrix parameters; based on the initial weight distribution vector, a preset algorithm is used to search the network structure of the knowledge graph; during the search process, the iterative weight distribution is calculated using the jump probability parameters and transition matrix parameters.

[0010] According to some embodiments, each node in the knowledge graph is sorted according to the iterative weight distribution to obtain the retrieval results corresponding to the query content, including: after the preset algorithm converges, determining the final weight score of each node in the knowledge graph according to the iterative weight distribution; sorting each node in the knowledge graph based on the final weight score; and truncating the nodes in the sorted knowledge graph according to a preset truncation number as the retrieval results.

[0011] According to one aspect of this application, a data retrieval device for a knowledge graph is provided, comprising: a coarse recall module for obtaining an initial candidate node set from a preset knowledge graph in response to a user's query; a semantic calculation module for calculating an initial semantic relevance score for each node in the initial candidate node set; a weight sharpening module for constructing an initial weight distribution vector based on the initial semantic relevance score; a graph propagation module for performing a retrieval in the knowledge graph based on the initial weight distribution vector using a preset algorithm to obtain an iterative weight distribution for each node in the knowledge graph; and a result truncation module for sorting each node in the knowledge graph according to the iterative weight distribution to obtain retrieval results corresponding to the query content.

[0012] According to one aspect of this application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to perform the method as described above.

[0013] According to one aspect of this application, a computer-readable storage medium is provided that stores a computer program or instructions thereon, which, when executed by a processor, implement the method described above.

[0014] According to embodiments of this application, by canceling the hard truncation before PPR, the connectivity of all nodes is preserved, ensuring that the multi-hop inference path of PPR is not interrupted. Through the sharpening mechanism in the technical solution of this application, the initial weights of noisy nodes can be reduced to an extremely low level before PPR is initiated, avoiding interference from noisy nodes and improving the focus of graph propagation. Furthermore, the technical solution of this application possesses dynamic adaptive noise reduction capabilities, adaptable to the diversity of query complexity in graph retrieval.

[0015] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application.

[0017] Figure 1 A flowchart illustrating a data retrieval method for a knowledge graph according to an example embodiment of this application is shown.

[0018] Figure 2 This diagram illustrates a data retrieval apparatus for a knowledge graph according to an example embodiment of this application.

[0019] Figure 3 A schematic diagram of an electronic device according to an example embodiment of this application is shown. Detailed Implementation

[0020] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that this application will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.

[0021] The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a full understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of these specific details, or other methods, components, materials, apparatus, or operations may be employed. In these cases, well-known structures, methods, apparatuses, implementations, materials, or operations will not be shown or described in detail.

[0022] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0023] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0024] This application provides a data retrieval method, apparatus, device, and storage medium for knowledge graphs. It can construct an initial personalized vector before the PPR algorithm starts, which can both preserve the connectivity of the graph structure and suppress long-tail noise interference to the extreme. By introducing a nonlinear sharpening mechanism, it realizes "soft selection" instead of "hard truncation", thereby improving the accuracy and recall of graph retrieval in complex reasoning scenarios.

[0025] The following will describe in detail, with reference to the accompanying drawings, a data retrieval method, apparatus, device, and storage medium for a knowledge graph according to embodiments of this application.

[0026] Figure 1A flowchart illustrating a data retrieval method for a knowledge graph according to an example embodiment of this application is shown.

[0027] like Figure 1 As shown, in step S100, in response to the user's query, an initial set of candidate nodes is obtained from a preset knowledge graph.

[0028] The retrieval device obtains the node description text of each node in the preset knowledge graph.

[0029] According to some embodiments, the pre-defined knowledge graph can be stored using a graph database (such as Neo4j or Nebula Graph). Vectors of the node description text in the knowledge graph are stored using a vector database (such as Milvus).

[0030] The retrieval device obtains the user's query content and calculates the semantic similarity between the user's query content and the node description text in the knowledge graph.

[0031] According to some embodiments, the semantic similarity between the query content and the node description text can be calculated using methods such as dot product and cosine similarity.

[0032] Based on the calculated semantic similarity, the retrieval device obtains an initial set of candidate nodes from the knowledge graph according to a preset coarse recall number.

[0033] According to some embodiments, the number of coarse recall nodes N is not strictly limited and can be set to a large value. For example, N can be set to 2000 or more, or even to all nodes in the knowledge graph (traditional retrieval systems typically set it to 50 or 100). The purpose is to retain as many potential bridge nodes in the knowledge graph as possible in the initial candidate node set, even if the semantic similarity with the user's query content is low. V candidate .

[0034] In step S200, the initial semantic relevance score of each node in the initial candidate node set is calculated.

[0035] The retrieval device concatenates the node description text of each node in the initial candidate node set with the user's query content, and inputs the concatenated data into a preset model to calculate the initial semantic relevance score of each node in the initial candidate node set.

[0036] According to some embodiments, the retrieval device concatenates node description text with query content to generate model input data. Then, the retrieval device inputs the model input data into a pre-tuned Cross-Encoder model (e.g., based on BGE-Reranker-v2), and outputs an initial candidate node set through the model. Vcandidate Each node v i Initial semantic relevance score S semantic ( v i The initial semantic relevance score is a non-normalized value, typically ranging from -10 to 10.

[0037] In step S300, an initial weight distribution vector is constructed based on the initial semantic relevance score.

[0038] The retrieval device obtains a preset temperature coefficient and uses it to normalize the initial semantic relevance score in order to obtain the sharpening weight distribution of each node in the initial candidate node set.

[0039] According to some embodiments, the temperature coefficient T An empirical parameter greater than 0 and less than 1, used to control the sharpening of the node weight distribution. T The closer a node's weight is to 0, the more pronounced the sharpening effect becomes.

[0040] According to some embodiments, the retrieval device uses the following formula to search the initial candidate node set. V candidate Each node v i Initial semantic relevance score S semantic ( v i Normalization is performed to obtain the sharpening weight distribution for each node in the initial candidate node set. p 0( v i ).

[0041] p 0( v i )=Softmax( S semantic ( v i ) / T (1) In the embodiments of this application, the temperature coefficient T The value can be set to 0.05. Through the calculation of formula (1), the weights of nodes with high initial semantic relevance scores in the initial candidate node set are close to 1, while the weights of other medium and low score nodes are extremely compressed but not 0, so that the weights of each node in the initial candidate node set are distributed in a "peak shape".

[0042] In step S400, based on the initial weight distribution vector, a preset algorithm is used to search the knowledge graph to obtain the iterative weight distribution of each node in the knowledge graph.

[0043] The retrieval device constructs an initial weight distribution vector corresponding to a preset algorithm based on the sharpening weight distribution of each node in the initial candidate node set, for use in knowledge graph retrieval.

[0044] According to some embodiments, the preset algorithm may employ the PPR algorithm.

[0045] Before performing a search using a preset algorithm, the search device determines the strong seed nodes in the initial candidate node set based on the initial semantic relevance score, and retains the nodes in the initial candidate node set other than the strong seed nodes.

[0046] According to some embodiments, in the initial candidate node set, the weights corresponding to nodes with high initial semantic relevance scores (e.g., 9.0 out of 10) are significantly amplified after sharpening (e.g., 0.999…), while the weights corresponding to nodes with medium scores (e.g., 5.0 out of 10) and low scores (e.g., 2.0 out of 10) are extremely compressed (e.g., 10…). -6 ).

[0047] Accordingly, the retrieval device identifies nodes with high initial semantic relevance scores as strong seed nodes, whose corresponding sharpening weights are close to 1 but not 1. The retrieval device retains nodes other than strong seed nodes in the initial candidate node set, whose corresponding sharpening weights are close to 0 but not 0, in order to maintain the connectivity of the knowledge graph structure and ensure that these nodes still have the possibility of being recalled during the iteration process.

[0048] The retrieval device acquires preset jump probability parameters and transition matrix parameters.

[0049] According to some implementations, the jump probability α This is a preset static parameter, ranging from 0 to 1, representing the probability of returning to the starting point when randomly searching among nodes in the knowledge graph. A higher value indicates a more concentrated search area around child nodes. In the embodiments of this application, the jump probability can be... α Setting it to 0.9 concentrates the search scope within the 1st and 2nd hop neighbor nodes of the seed node, avoiding the introduction of irrelevant noise from a wide-ranging search. At the same time, the weight of the seed node itself has a significant impact on the final ranking.

[0050] According to some embodiments, the transition matrix M is a preset static parameter matrix. If the nodes in the knowledge graph... j The out-degree is d out ( j If the transition matrix M is given by the formula below, then the value of the transition matrix M can be expressed by the following formula.

[0051] (2) In this case, if a node in the knowledge graph has no outgoing edges (i.e., a dangling node, the node's out-degree is...), then... d out =0), to ensure the randomness of the transition matrix M, the probability mass of this node can be evenly distributed to all nodes in the knowledge graph, or distributed according to preset distribution parameters.

[0052] Based on the initial weight distribution vector, the retrieval device performs retrieval in the network structure of the knowledge graph using a preset algorithm.

[0053] According to some embodiments, the retrieval device distributes the sharpening weights of each node in the initial candidate node set. p 0 is directly used as the initial weight distribution vector corresponding to the PPR algorithm, and the node energy is iteratively propagated in the network structure of the knowledge graph through the PPR algorithm to retrieve nodes in the knowledge graph.

[0054] During the retrieval process, the retrieval device calculates the iterative weight distribution of each node in the knowledge graph using jump probability parameters and transition matrix parameters.

[0055] According to some embodiments, the sharpening weight distribution of each node in the initial candidate node set is used. p With 0 as the initial distribution, the retrieval device can calculate the iterative weight distribution of each node in the knowledge graph during the iterative propagation process using the following formula. p k+1 .

[0056] p k+1 = α* p 0+ (1- α )* M * p k (3) According to some embodiments, based on formula (3), the iteration weights of strong seed nodes in the initial candidate node set, or "bridge nodes" with low weights but connected to multiple strong seed nodes, will gradually increase. Meanwhile, the iteration weights of noise nodes, due to their extremely low initial weights and lack of strong seed node support, will gradually decrease.

[0057] In step S500, each node in the knowledge graph is sorted according to the iterative weight distribution to obtain the retrieval results corresponding to the query content.

[0058] After the preset algorithm converges, the retrieval device determines the final weight score of each node in the knowledge graph based on the iterative weight distribution, and then sorts each node in the knowledge graph accordingly.

[0059] According to some embodiments, the error between two consecutive iterations is less than 10. -6 Afterwards, the PPR algorithm converges, and the retrieval device determines the final weight score of each node based on the iterative weight distribution of each node in the knowledge graph at this point. p final Furthermore, the retrieval device determines the final weight score based on the score. p final Sort each node in the knowledge graph from high to low.

[0060] The retrieval device extracts nodes from the sorted knowledge graph according to a preset truncation number to serve as the retrieval results corresponding to the user's query.

[0061] According to some embodiments, the retrieval device extracts the Top-K nodes from the sorted knowledge graph as the final context and provides it to a preset large language model to generate retrieval results corresponding to the user's query content.

[0062] The technical solution of this application will be further described below with reference to specific embodiments.

[0063] Scene setting stage: Suppose the user's query is: "Why did the order service response time out?", and the knowledge graph contains four nodes: A, B, C, and D.

[0064] Among them, node A corresponds to "OrderService," which has a high semantic relevance to the query content. Node B corresponds to "Database Connection Pool," which has a low semantic relevance to the query content (does not contain words such as "timeout"), but is a downstream dependency of node A. Node C corresponds to "Slow SQL Log," which has a moderate semantic relevance to the query content and is associated with node B. Node D corresponds to "Cafeteria Menu," which has no semantic relevance to the query content and is a noisy node.

[0065] Data retrieval stage: According to step S100, the retrieval device performs coarse recall on the knowledge graph based on semantic similarity and retrieves 2000 nodes as the initial candidate node set, which includes nodes A, B, C and D.

[0066] In traditional technical solutions (Top-50 truncation), the text of node B is not directly related to the "timeout" in the query content, and its ranking may be 150th or even lower, and it will be discarded directly. However, in the technical solution of this application, node B is retained.

[0067] According to step S200, the retrieval device calculates the initial semantic relevance score for each node in the initial candidate node set. The initial semantic relevance scores for nodes A, B, C, and D are S(A) = 9.0 (very high), S(B) = 2.0 (low, but within the top 2000), S(C) = 5.0 (medium), and S(D) = 1.0 (very low), respectively.

[0068] According to step S300, the retrieval device constructs a sharpened initial weight distribution vector. Among them, the temperature coefficient... T Set to 0.1.

[0069] The retrieval device calculates the sharpening weight distribution of each node in the initial candidate node set according to formula (1). The sharpening weight distributions corresponding to nodes A, B, C, and D are respectively... p 0(A)≈0.999… (Strong seed node, possessing the vast majority of initial energy) p 0(B)≈10 -31 (The initial energy is negligible, but it still exists in the computation matrix.) p 0(C)≈10 -18 (Initial energy is extremely low) and p 0(D)≈10 -35 (Background noise).

[0070] The retrieval device directly uses the sharpening weight distribution of each node as the initial weight distribution vector corresponding to the PPR algorithm.

[0071] According to step S400, the retrieval device performs PPR algorithm graph propagation in the structure of the knowledge graph based on the initial weight distribution vector.

[0072] The retrieval device performs iterative propagation, with energy primarily flowing out from node A.

[0073] In the first round of propagation, node A transfers energy to its neighbors. The knowledge graph shows the relationship: Node A (OrderService) — Call — Node B (DB_Pool), so a large amount of energy from node A flows into node B.

[0074] In the second round of propagation, although node B initially had a low weight, it received energy from node A, and its iterative weight rapidly increased. Subsequently, node B transferred energy to its neighbor node C, with the relationship being node B (DB_Pool) — producer — node C (Slow_SQL_Log).

[0075] Although node D is also being calculated, it has neither an initial high-scoring weight nor a high-scoring neighbor pointing to it (node ​​A does not point to node D). Therefore, the iterative weight of node D is always suppressed to a level close to 0.

[0076] According to step S500, the retrieval device sorts each node in the knowledge graph according to the iterative weight distribution.

[0077] After the PPR algorithm converges, the retrieval device determines the final weight score of each node based on the iterative weight distribution of each node in the knowledge graph at this point. p final And sort each node in descending order, the result may be as follows.

[0078] 1. Node A (OrderService) has a high initial score.

[0079] 2. Node C (Slow_SQL_Log), although its initial score was not high, obtained strong correlation transmission from node A through bridge node B.

[0080] 3. Node B (DB_Pool), a bridge node, also saw a significant improvement in its score.

[0081] ... Nodes N and D consistently rank at the bottom in scores.

[0082] Furthermore, the retrieval device extracts {A, B, C} as context based on the Top-3 criteria and provides it to the Large Language Model (LLM). Based on this context, the LLM successfully infers that "the order service response timeout was caused by slow SQL in the database connection pool."

[0083] Figure 2 This diagram illustrates a data retrieval apparatus for a knowledge graph according to an example embodiment of this application.

[0084] like Figure 2 As shown, the retrieval device 100 includes a coarse recall module 110, a semantic calculation module 120, a weight sharpening module 130, a graph propagation module 140, and a result truncation module 150.

[0085] The coarse recall module 110 obtains the node description text of each node in the preset knowledge graph.

[0086] The coarse recall module 110 obtains the user's query content and calculates the semantic similarity between the user's query content and the node description text in the knowledge graph.

[0087] Based on the calculated semantic similarity, the coarse recall module 110 obtains an initial set of candidate nodes from the knowledge graph according to a preset coarse recall number.

[0088] The semantic computing module 120 concatenates the node description text of each node in the initial candidate node set with the user's query content, and inputs the concatenated data into a preset model to calculate the initial semantic relevance score of each node in the initial candidate node set.

[0089] The weight sharpening module 130 obtains a preset temperature coefficient and uses it to normalize the initial semantic relevance score in order to obtain the sharpening weight distribution of each node in the initial candidate node set.

[0090] The graph propagation module 140 constructs an initial weight distribution vector corresponding to a preset algorithm based on the sharpening weight distribution of each node in the initial candidate node set, for use in knowledge graph retrieval.

[0091] Before performing the retrieval using a preset algorithm, the graph propagation module 140 determines the strong seed nodes in the initial candidate node set based on the initial semantic relevance score, and retains the nodes in the initial candidate node set other than the strong seed nodes.

[0092] The graph propagation module 140 acquires preset jump probability parameters and transition matrix parameters.

[0093] Based on the initial weight distribution vector, the graph propagation module 140 performs retrieval in the network structure of the knowledge graph using a preset algorithm.

[0094] During the retrieval process, the graph propagation module 140 calculates the iterative weight distribution of each node in the knowledge graph using the jump probability parameter and the transition matrix parameter.

[0095] After the preset algorithm converges, the result truncation module 150 determines the final weight score of each node in the knowledge graph based on the iterative weight distribution, and sorts each node in the knowledge graph accordingly.

[0096] The result truncation module 150 extracts nodes from the sorted knowledge graph according to a preset truncation number, which are then used as the search results corresponding to the user's query content.

[0097] Figure 3 A schematic diagram of an electronic device according to an example embodiment of this application is shown.

[0098] like Figure 3 As shown, the electronic device 600 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0099] like Figure 3As shown, the electronic device 600 is manifested in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc. The storage unit stores program code, which can be executed by the processing unit 610, causing the processing unit 610 to perform the methods described in this specification according to the various exemplary embodiments of this application. For example, the processing unit 610 can perform, for example... Figure 1 The method shown.

[0100] Storage unit 620 may include readable media in the form of volatile storage units, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include read-only memory (ROM) 6203.

[0101] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0102] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0103] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0104] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. The technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this application.

[0105] Software products may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0106] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0107] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0108] The aforementioned computer-readable medium carries one or more programs, which, when executed by a device, cause the computer-readable medium to perform the aforementioned functions.

[0109] Those skilled in the art will understand that the above modules can be distributed in the device as described in the embodiments, or they can be modified accordingly and placed in one or more devices that are unique to this embodiment. The modules in the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.

[0110] The embodiments of this application have been described in detail above. These descriptions are solely for the purpose of helping to understand the method and core ideas of this application. Furthermore, any changes or modifications made by those skilled in the art based on the ideas of this application, its specific implementation methods, and its application scope, are all within the scope of protection of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A data retrieval method for knowledge graphs, characterized in that, include: In response to the user's query, an initial set of candidate nodes is obtained from a pre-defined knowledge graph; Calculate the initial semantic relevance score for each node in the initial candidate node set; Based on the initial semantic relevance score, an initial weight distribution vector is constructed; Based on the initial weight distribution vector, a preset algorithm is used to search the knowledge graph to obtain the iterative weight distribution of each node in the knowledge graph; The nodes in the knowledge graph are sorted according to the iterative weight distribution to obtain the retrieval results corresponding to the query content.

2. The method according to claim 1, characterized in that, In response to the user's query, an initial set of candidate nodes is obtained from a pre-defined knowledge graph, including: Obtain the node description text for each node in the knowledge graph; Calculate the semantic similarity between the query content and the node description text; Based on the semantic similarity, the initial candidate node set is obtained according to a preset coarse recall number.

3. The method according to claim 1, characterized in that, Calculating the initial semantic relevance score for each node in the initial candidate node set includes: The node description text of each node in the initial candidate node set is concatenated with the query content to serve as model input data; Based on the input data of the model, the initial semantic relevance score is calculated using a preset model.

4. The method according to claim 1, characterized in that, Based on the initial semantic relevance score, an initial weight distribution vector is constructed, including: Obtain the preset temperature coefficient; Based on the temperature coefficient, the initial semantic relevance score is normalized to obtain the sharpening weight distribution of each node in the initial candidate node set. The initial weight distribution vector is constructed based on the sharpening weight distribution.

5. The method according to claim 4, characterized in that, Before performing a retrieval in the knowledge graph based on the initial weight distribution vector using a preset algorithm, the method further includes: Based on the initial semantic relevance score, strong seed nodes are determined in the initial candidate node set, wherein the sharpening weight of the strong seed nodes is close to 1 but not 1; Retain nodes in the initial candidate node set other than the strong seed node, wherein the sharpening weight of the nodes in the initial candidate node set other than the strong seed node is close to 0 but not 0.

6. The method according to claim 1, characterized in that, Based on the initial weight distribution vector, a preset algorithm is used to retrieve the iterative weight distribution of each node in the knowledge graph, including: Obtain the preset jump probability parameters and transition matrix parameters; Based on the initial weight distribution vector, a preset algorithm is used to perform retrieval within the network structure of the knowledge graph. During the retrieval process, the iterative weight distribution is calculated using the jump probability parameter and the transition matrix parameter.

7. The method according to claim 6, characterized in that, The knowledge graph is sorted according to the iterative weight distribution to obtain the retrieval results corresponding to the query content, including: After the preset algorithm converges, the final weight score of each node in the knowledge graph is determined according to the iterative weight distribution; Each node in the knowledge graph is sorted based on the final weight score; The nodes in the sorted knowledge graph are truncated according to a preset truncation number to serve as the retrieval results.

8. A data retrieval device for a knowledge graph, characterized in that, include: The coarse recall module is used to retrieve an initial set of candidate nodes from a pre-defined knowledge graph in response to user queries. The semantic calculation module is used to calculate the initial semantic relevance score of each node in the initial candidate node set; The weight sharpening module is used to construct an initial weight distribution vector based on the initial semantic relevance score; The graph propagation module is used to retrieve the iterative weight distribution of each node in the knowledge graph based on the initial weight distribution vector and a preset algorithm. The result truncation module is used to sort each node in the knowledge graph according to the iterative weight distribution in order to obtain the retrieval results corresponding to the query content.

9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the method as described in any one of claims 1-7.