Retrieval enhancement method and device based on graph search, equipment and program product

By performing knowledge augmentation on the initial multi-attribute graph, a target multi-attribute graph is generated, which solves the problem of insufficient retrieval generation accuracy of GraphRAG technology, realizes accurate search and feedback of large language models, and improves user experience.

CN120994853APending Publication Date: 2025-11-21CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing GraphRAG technology is insufficient in terms of retrieval generation accuracy, making it difficult to meet the needs of practical applications, especially in handling cross-document associations or high-level semantic reasoning, where it fails to provide satisfactory answers.

Method used

By obtaining an initial multi-attribute graph, knowledge enhancement processing is performed using semantic unit nodes and relation nodes to generate knowledge-enhanced nodes. These nodes are then connected to the initial multi-attribute graph to form a target multi-attribute graph. Graph search is then performed to determine associated nodes, and finally, the graph is input into a large language model to generate feedback content.

Benefits of technology

It improves the feedback accuracy of large language models, enables precise knowledge search and retrieval generation, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994853A_ABST
    Figure CN120994853A_ABST
Patent Text Reader

Abstract

The invention provides a retrieval enhancement method and device based on graph search, equipment and a program product, and relates to the technical field of computers and the Internet. The method comprises the steps of obtaining an initial multivariate attribute graph corresponding to an original corpus, wherein the initial multivariate attribute graph comprises entity nodes, relation nodes and semantic unit nodes; performing knowledge enhancement processing on the initial multivariate attribute graph through the original corpus, the semantic unit nodes and the relation nodes to obtain knowledge enhancement nodes; connecting the knowledge enhancement nodes with nodes of the initial multivariate attribute graph to obtain a target multivariate attribute graph; performing graph search in the target multivariate attribute graph, and determining an associated node matched with the query statement; and inputting the association nodes, the semantic unit nodes, the knowledge enhancement nodes and the query statements into a large language model, so that the large language model generates feedback contents aiming at the query statements. According to the embodiment of the invention, the graph structure can be optimized to accurately retrieve the content related to the query statement, so that the feedback accuracy of the large language model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of computer and Internet technologies, and particularly relates to a retrieval augmentation method and device based on graph search, electronic equipment, computer readable storage medium and computer program product. BACKGROUND

[0002] This section is intended to provide background or context to the embodiments of the disclosure recited in the claims. The description herein does not constitute admission that the prior art is prior art nor does it constitute an admission of any description in this section pertaining to background or context.

[0003] Although traditional retrieval augmentation generation (RAG) technology based on vector similarity performs well in text snippet retrieval, it mainly relies on surface semantic matching and is difficult to effectively capture the complex association relationship between entities. This limitation leads to large language models often failing to provide satisfactory answers when dealing with complex queries that require cross-document association or high-level semantic reasoning. To solve this problem, researchers have proposed retrieval augmentation generation technology based on graph structure (Graph RAG), which converts unstructured text into structured representation containing entities (Nodes) and relationships (Relations) by constructing a knowledge graph (KG), thereby optimizing the retrieval process and enhancing the understanding ability of large language to complex queries.

[0004] However, the current Graph RAG technology still has the problem of low retrieval generation accuracy, which leads to the final output result often difficult to meet the needs of practical applications. SUMMARY

[0005] The purpose of the present disclosure is to provide a retrieval augmentation method and device based on graph search, electronic equipment, computer readable storage medium and computer program product, which can improve the feedback accuracy of large language models.

[0006] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.

[0007] The embodiment of the present disclosure provides a retrieval enhancement method based on graph search, comprising: acquiring an initial multi-attribute graph corresponding to an original corpus, wherein the initial multi-attribute graph comprises entity nodes, relationship nodes and semantic unit nodes; the semantic unit node is the smallest logical fragment carrying independent and complete semantics in the original corpus; performing knowledge enhancement processing on the initial multi-attribute graph through the original corpus, the semantic unit node and the relationship node to obtain a knowledge enhancement node; connecting the knowledge enhancement node with the nodes of the initial multi-attribute graph to obtain a target multi-attribute graph; performing graph search in the target multi-attribute graph to determine an associated node matched with a query statement; inputting the associated node, the semantic unit node corresponding to the associated node, the knowledge enhancement node and the query statement into a large language model, so that the large language model generates feedback content for the query statement.

[0008] In some embodiments, the knowledge enhancement node comprises a local attribute abstract node; wherein the knowledge enhancement node is obtained by performing knowledge enhancement processing on the initial multi-attribute graph through the original corpus, the semantic unit node and the relationship node, comprising: performing K-core decomposition processing on the nodes in the initial multi-attribute graph to obtain at least one connected subgraph; wherein K is an integer greater than or equal to 1; performing betweenness calculation on the nodes in the initial multi-attribute graph; taking the node with the highest degree and the node with a betweenness higher than a betweenness threshold value in each connected subgraph as a hub node; acquiring the semantic unit node and the relationship node corresponding to the hub node; performing semantic abstract extraction on the semantic unit node and the relationship node corresponding to the hub node to generate the local attribute abstract node; wherein the target multi-attribute graph is obtained by connecting the local attribute abstract node with the corresponding hub node to generate the target multi-attribute graph.

[0009] In some embodiments, the knowledge enhancement node comprises a first community abstract node and a local attribute abstract node, and the local attribute abstract node is used for semantic description of the hub node in the initial multi-attribute graph; wherein the knowledge enhancement node is obtained by performing knowledge enhancement processing on the initial multi-attribute graph through the original corpus, the semantic unit node and the relationship node, comprising: performing community detection on the nodes in the initial multi-attribute graph through a community detection algorithm to obtain at least one community; the at least one community comprises a first community; performing abstract extraction on the entity nodes, the relationship nodes, the semantic unit nodes and the local attribute abstract nodes in the first community to generate the first community abstract node; wherein the target multi-attribute graph is obtained by connecting the first community abstract node with the nodes in the community to generate the target multi-attribute graph.

[0010] In some embodiments, connecting the first community summary node with the nodes in the community to generate the target multi-attribute graph comprises: vectorizing the first community summary node to obtain a first community summary vector; vectorizing the entity nodes, semantic unit nodes and local attribute summary nodes in the first community to obtain at least one entity node vector, at least one semantic unit node vector and at least one local summary vector; determining a target vector with the highest similarity to the first community summary vector from the at least one entity node vector, the at least one semantic unit node vector and the at least one local summary vector through similarity matching; and connecting the first community summary node with the node corresponding to the target vector to generate the target multi-attribute graph.

[0011] In some embodiments, the knowledge enhancement node comprises a text block node; wherein the knowledge enhancement node is obtained by performing knowledge enhancement processing on the initial multi-attribute graph based on the original corpus, the semantic unit nodes and the relationship nodes, comprising: performing block processing on the original corpus to obtain at least one text block; the at least one text block comprises a first text block; determining a target semantic unit node in which the semantic content is contained in the first text block from the semantic unit nodes in the initial multi-attribute graph; and connecting the knowledge enhancement node with the nodes of the initial multi-attribute graph to obtain a target multi-attribute graph, comprising: connecting the text block node corresponding to the first text block with the target semantic unit node to generate the target multi-attribute graph.

[0012] In some embodiments, the graph search is performed in the target multi-attribute graph to determine the associated nodes matching the query statement, comprising: determining a node matching a keyword of the query statement as an entry node in the target multi-attribute graph; performing random walk in the target multi-attribute graph based on the entry node to determine the relevance of each node to the entry node; and determining the nodes with the top N relevance degrees as the associated nodes, N being an integer greater than or equal to 1.

[0013] In some embodiments, the entry node comprises a first entry node; wherein the relevance of each node to the entry node is determined by performing random walk in the target multi-attribute graph based on the entry node, comprising: determining an initial probability of the first entry node; obtaining an iteration formula and a normalized adjacency matrix of the target multi-attribute graph; combining the normalized adjacency matrix and the initial probability to perform iteration processing according to the iteration formula to obtain a target distribution matrix; wherein the target distribution matrix is used to represent the relevance of each node in the target multi-attribute graph to the first entry node.

[0014] In some embodiments, determining the initial probability of the first entry node comprises: determining a sum of adjacent edge weights of each entry node; adding the sum of adjacent edge weights of each entry node to obtain a weight sum; and dividing the sum of adjacent edge weights of the first entry node by the weight sum to determine the initial probability of the first entry node.

[0015] In some embodiments, the target multi-attribute graph includes a first node and a second node, and the first node and the second node are connected; wherein performing random walk in the target multi-attribute graph based on the entry node comprises: obtaining an edge weight of an outgoing edge of the first node; adding the edge weight of the outgoing edge of the first node to obtain an outgoing edge weight sum of the first node; determining an edge weight between the first node and the second node; and dividing the edge weight between the first node and the second node by the outgoing edge weight sum to determine a transition probability from the first node to the second node.

[0016] In some embodiments, the target multi-attribute graph includes a third node and a fourth node; wherein the method further comprises: determining a cosine similarity between the third node and the fourth node; counting a co-occurrence frequency of the third node and the fourth node as a node pair in the target multi-attribute graph; and weightedly summing the cosine similarity and the co-occurrence frequency to determine an edge weight between the third node and the fourth node.

[0017] Embodiments of the present disclosure provide a retrieval enhancement device based on graph search, comprising: an attribute graph acquisition module, a knowledge enhancement node generation module, a labeled multi-attribute graph generation module, an associated node determination module, and a feedback generation module.

[0018] The attribute graph acquisition module is configured to acquire an initial multi-attribute graph corresponding to an original corpus, the initial multi-attribute graph including entity nodes, relationship nodes, and semantic unit nodes; the semantic unit node is the smallest logical fragment carrying independent and complete semantics in the original corpus; the knowledge enhancement node generation module can be configured to perform knowledge enhancement processing on the initial multi-attribute graph through the original corpus, the semantic unit node, and the relationship node to obtain a knowledge enhancement node; the labeled multi-attribute graph generation module can be configured to connect the knowledge enhancement node with the nodes of the initial multi-attribute graph to obtain a target multi-attribute graph; the associated node determination module can be configured to perform graph search in the target multi-attribute graph to determine associated nodes matching a query statement; and the feedback generation module can be configured to input the associated nodes, the semantic unit nodes and knowledge enhancement nodes corresponding to the associated nodes, and the query statement into a large language model, so that the large language model generates feedback content for the query statement.

[0019] The electronic device includes a memory and a processor. The memory is configured to store computer program instructions. The processor is configured to invoke the computer program instructions stored in the memory to implement the retrieval enhancement method based on graph search.

[0020] The computer-readable storage medium stores computer program instructions to implement the retrieval enhancement method based on graph search.

[0021] The computer program product or the computer program includes computer program instructions stored in a computer-readable storage medium. The computer program instructions are read from the computer-readable storage medium, and a processor executes the computer program instructions to implement the retrieval enhancement method based on graph search.

[0022] The retrieval enhancement method, the device, the electronic device, the computer-readable storage medium, and the computer program product based on graph search provided by the embodiments of the present disclosure first enrich the expression ability of the initial multi-attribute graph through semantic units capable of expressing complete semantics, and then perform knowledge enhancement on the initial multi-attribute graph through original corpus, semantic units, and relationships, to obtain a target multi-attribute graph capable of expressing the original corpus in a summary manner from a high level. Through the retrieval generation of the large language model based on the target multi-attribute graph, the knowledge can be accurately searched through the target multi-attribute graph, thereby improving the retrieval generation accuracy of the large language model and improving the user experience.

[0023] It should be understood that the above general description and the following detailed description are only exemplary and do not limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0024] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure. It is clear that the accompanying drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0025] Figure 1 A scene schematic diagram of the retrieval enhancement method based on graph search or the retrieval enhancement device based on graph search that can be applied to the embodiments of the present disclosure is shown.

[0026] Figure 2 is a flowchart of a retrieval enhancement method based on graph search according to an exemplary embodiment.

[0027] Figure 3is a graph search based retrieval enhancement logic diagram according to an example embodiment.

[0028] Figure 4 is a flowchart of a knowledge enhancement node determination method according to an example embodiment.

[0029] Figure 5 is a flowchart of a knowledge enhancement node determination method according to an example embodiment.

[0030] Figure 6 is a flowchart of a community summary node connection method according to an example embodiment.

[0031] Figure 7 is a flowchart of a knowledge enhancement node determination method according to an example embodiment.

[0032] Figure 8 is a flowchart of an associated node determination method according to an example embodiment.

[0033] Figure 9 is a flowchart of a random walk transition probability determination method according to an example embodiment.

[0034] Figure 10 is a flowchart of an edge weight determination method according to an example embodiment.

[0035] Figure 11 is a target multi-attribute graph generation logic diagram according to an example embodiment.

[0036] Figure 12 is a block diagram of a graph search based retrieval enhancement apparatus according to an example embodiment.

[0037] Figure 13 shows a structural schematic diagram of an electronic device suitable for implementing embodiments of the present disclosure. DETAILED DESCRIPTION

[0038] Example embodiments now will be described more fully hereinafter with reference to the accompanying drawings. Example embodiments, however, can be implemented in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. Like reference numerals refer to like elements throughout the figures, and thus description of the same will be omitted.

[0039] Those skilled in the art know that the embodiments of the present disclosure can be a system, a device, an apparatus, a method or a computer program product. Therefore, the present disclosure can be embodied as a whole hardware, a whole software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0040] The features, structures or characteristics described in the present disclosure can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the technology disclosed can be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the present disclosure.

[0041] In the embodiments of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented entirely or partially by using software, hardware (such as a processing circuit or a memory) or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an integral module or unit that includes the functions of the module or unit.

[0042] The accompanying drawings are merely schematic illustrations of the present disclosure, in which the same reference numerals refer to the same or similar parts, and thus repeated description thereof will be omitted. Some of the block diagrams shown in the drawings do not necessarily correspond to physically or logically independent entity nodes. These functional entity nodes can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0043] The flowcharts shown in the drawings are only exemplary illustrations, and do not necessarily include all contents and steps, nor do they necessarily have to be executed in the order described. For example, some steps can be further divided, and some steps can be combined or partially combined, so the actual execution order can be changed according to the actual situation.

[0044] In the description of the present disclosure, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" herein is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist together, and B exists alone. In addition, "at least one" means one or more, and "multiple" means two or more. "First", "second", and the like do not limit the quantity and execution order, and "first", "second", and the like do not necessarily mean different; the terms "include", "contain" and "have" are used to mean open inclusion and mean that in addition to the listed elements / components / etc. There can be other elements / components / etc.

[0045] In order to enable more clear understanding of the above-mentioned purposes, features and advantages of the present application, the present application will be further described in detail below in combination with the drawings and specific embodiments, and it should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0046] It should be noted that in the technical solutions of the present disclosure, the collection, collection, updating, analysis, processing, use, transmission, storage, etc. of user personal information involved in the technical solutions comply with relevant laws and regulations, are used for legal purposes, and do not violate public order and good customs. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain user personal information security and network security.

[0047] First, some of the terms involved in the embodiments of the present disclosure will be explained below to facilitate understanding by those skilled in the art.

[0048] RAG(Retrieval Augmented Generation, Retrieval Augmented Generation): This technology retrieves relevant information from an external knowledge base and inputs it as a prompt to a large language model (LLM) to enhance the ability of the large language model to handle knowledge-intensive tasks such as question answering, text summarization, content generation, etc.

[0049] GraphRAG(Graph Retrieval Augmented Generation, Graph Retrieval Augmented Generation): Based on a knowledge graph to realize information retrieval and input it as a prompt to a large language model (LLM) to improve the generation effect of the large language model.

[0050] LLM(Large Language Model, Large Language Model): A deep learning model trained based on massive text data, capable of understanding, generating and reasoning natural language.

[0051] The foregoing introduces some concepts of terms related to the embodiments of the present disclosure, and the technical features related to the embodiments of the present disclosure are introduced as follows.

[0052] The example embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0053] Figure 1 A scenario schematic diagram of a graph search-based retrieval enhancement method or a graph search-based retrieval enhancement device that can be applied to the embodiments of the present disclosure is shown.

[0054] Reference is made to Figure 1 which shows a schematic diagram of an implementation environment provided by an example embodiment of the present disclosure.

[0055] As Figure 1 shown, the system architecture 100 can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a communication link medium between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0056] A user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Among them, the terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, wearable devices, virtual reality devices, smart home devices, etc.

[0057] The server 105 can be a server that provides various services, such as a background management server that provides support for the operation of the device performed by the user using the terminal devices 101, 102, 103. The background management server can analyze and process the received request data, etc., and feed back the processing result to the terminal device.

[0058] The server can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms, etc. The present disclosure does not limit this.

[0059] The server 105 can obtain, for example, an initial multi-attribute graph corresponding to the original corpus, the initial multi-attribute graph including entity nodes, relationship nodes, and semantic unit nodes; the semantic unit node is the smallest logical fragment that carries independent and complete semantics in the original corpus; the server 105 can perform, for example, knowledge enhancement processing on the initial multi-attribute graph through the original corpus, the semantic unit node, and the relationship node to obtain a knowledge enhanced node; the server 105 can connect, for example, the knowledge enhanced node with the nodes of the initial multi-attribute graph to obtain a target multi-attribute graph. The server 105 can perform, for example, graph search in the target multi-attribute graph to determine an associated node matching the query statement; the server 105 can input, for example, the associated node, the semantic unit node corresponding to the associated node, the knowledge enhanced node, and the query statement into the large language model to generate feedback content for the query statement by the large language model.

[0060] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the above-mentioned embodiments is only illustrative, and the server 105 can be a server of one entity node, or can be composed of multiple servers. According to actual needs, the server 105 can have any number of terminal devices, networks, and servers.

[0061] Figure 2 FIG. 1 is a flowchart of a retrieval enhancement method based on graph search according to an example embodiment. The method provided by the embodiments of the present disclosure can be executed by any electronic device with computing processing capability, for example, the method can be executed by the server or the terminal device in the above-mentioned embodiments, or can be executed by the server and the terminal device together. In the following embodiments, the server is taken as an example for illustration, but the present disclosure is not limited thereto. Figure 1

[0062] Referring to Figure 2 The retrieval enhancement method based on graph search provided by the embodiments of the present disclosure can include the following steps.

[0063] In step S202, an initial multi-attribute graph corresponding to the original corpus is obtained, the initial multi-attribute graph including entity nodes, relationship nodes, and semantic unit nodes; the semantic unit node is the smallest logical fragment that carries independent and complete semantics in the original corpus.

[0064] The above-mentioned original corpus can refer to original text data without processing, which can be text information collected from books, articles, or dialogues, etc. It can also be text data in a database. The database can be used to construct graph structure data, and the database can include multiple texts.

[0065] The above-mentioned original multi-attribute graph can include three main node types: entity (N), relationship (R), and semantic unit (S).

[0066] ​An entity refers to an objective thing or an abstract concept that can exist independently and be uniquely identified, and is a basic unit of knowledge expression.

[0067] A semantic unit can be the smallest logical fragment in the original corpus that carries independent and complete semantics. The semantic unit can be a semantic carrier carrying an entity (such as the sentence “Newton discovered the universal gravitation”), and the entity is a specific object extracted therefrom (such as “Newton” or “universal gravitation”).

[0068] A relationship node can be an abstract unit representing a specific semantic association between entities, used to structurally describe the interaction logic of the objective world.

[0069] In some embodiments, the text in the original corpus can be divided into text blocks (such as a piece of text content as a text block), and then the text blocks are segmented to obtain semantic units, and finally the entities and entity relationships are extracted from the semantic units.

[0070] In some embodiments, the text blocks in the original corpus can also be decomposed into three main node types: entities (N), relationships (R), and semantic units (S) by using an LLM.

[0071] Since entities in different texts can generate similar semantic units (such as “Newton discovered the universal gravitation” and “The universal gravitation was proposed by Newton”), the same entity can also have different expressions (such as LLM, large language model, etc.). Therefore, two-stage deduplication operations are needed to reduce redundant nodes. The first stage is coarse-grained deduplication, which maps variants to standard entities, constructs links between entities, and replaces the same entity with the same expression. The second stage is fine-grained deduplication, which vectorizes all semantic units, clusters similar nodes, and for each cluster, selects a representative node (such as the longest text node) as the core node of the class of nodes, which is used to connect the edges of other nodes in the class.

[0072] Among them, the variant refers to the non-standardized expression of the same entity in different data sources or contexts, which may have differences in spelling, format, alias, etc. The standard entity can refer to the normalized and authoritative entity representation, which is the unique reference node in the knowledge graph.

[0073] In some embodiments, the deduplicated entities, relationships, and semantic units can be connected to each other to construct an initial multi-attribute graph Specifically, reference can be made to formula (1)

[0074]

[0075] Among them, υ represents a node, is a set of nodes; e d ,e rrespectively represent edges between entities and semantic units and edges between entities and relations, and the initial weight of the edges is 1 by default; and represents the attributes of node v.

[0076] As shown in Figure 11 , the entity N, the relation R, and the semantic unit S can be obtained separately by text separation, so as to generate an initial multi-attribute graph (N, R, S).

[0077] In step S204, the initial multi-attribute graph is processed by the original corpus, the semantic unit node, and the relation node to obtain a knowledge enhanced node.

[0078] The knowledge enhancement technology is a technology for enriching semantics and strengthening logic of the initial multi-attribute graph by fusing multi-source information, inferring implicit knowledge, and optimizing knowledge structure. The core goal is to improve the depth, breadth, completeness, inferability, and application value of knowledge.

[0079] The knowledge enhancement technology can be implemented by local abstract enhancement, community abstract enhancement, and text block enhancement.

[0080] Generally, after the knowledge enhancement processing of the initial multi-attribute graph, a node with enhanced semantic information (such as a knowledge enhanced node) can be obtained. The essence is to make the node obtain additional value beyond the original corpus by external knowledge injection, context analysis, and logical reasoning.

[0081] The above knowledge enhanced node can include a local attribute abstract node, a community abstract node, and a text block node.

[0082] The local attribute abstract is obtained by abstracting the pivot node in the target multi-attribute graph; the community abstract is obtained by abstracting each community after the multi-attribute graph is divided into communities; and the text block in the text block node is a text block related to the semantic unit.

[0083] In some embodiments, the knowledge enhancement technology can enable the target multi-attribute graph to distinguish nodes of different semantic levels (such as original text blocks, semantic units, attributes, high-level summaries, etc.). More information can be included in the graph and deeper insights can be extracted, thereby improving retrieval efficiency and accuracy, and then accurately positioning the key content.

[0084] The above method can explicitly model diversified information such as semantic units, attributes, and high-level summaries.

[0085] In step S206, the knowledge enhanced node is connected with the nodes of the initial multi-attribute graph to obtain a target multi-attribute graph.

[0086] Step S208, performing graph search in the target multi-attribute graph to determine the associated node matched with the query statement.

[0087] Step S210, inputting the associated node, the semantic unit node corresponding to the associated node, the knowledge enhancement node, and the query statement into the large language model, so that the large language model generates feedback content for the query statement.

[0088] In some embodiments, the specific scheme of querying content by the user to the large language model through the query statement can be divided into three stages as shown in Figure 3 The first stage: constructing a multi-attribute graph based on the input original text. The second stage: based on the input question (i.e. the query statement), realizing efficient and accurate retrieval of the multi-attribute graph (obtaining the query node as shown in Figure 3 The third stage: based on the retrieval result, combining the powerful generation ability of the large language model to summarize and reply to the input question.

[0089] The above method can first enrich the expression ability of the initial multi-attribute graph through the semantic unit capable of expressing complete semantics, and then perform knowledge enhancement on the initial multi-attribute graph through the original corpus, semantic units, and relationships, etc. to obtain a target multi-attribute graph capable of expressing the original corpus from a high level. Through the retrieval generation of the large language model based on the above target multi-attribute graph, the knowledge can be accurately searched through the target multi-attribute graph, thereby improving the retrieval generation accuracy of the large language model to improve the user experience.

[0090] In the above graph-based retrieval enhancement generation method, the graph structure design can be enriched to ensure more retrieval nodes, and the retrieval process can be optimized to improve the retrieval accuracy and precision.

[0091] Current RAG methods based on graphs rarely prioritize the design of graph structures. Inadequately designed graphs not only hinder the seamless integration of various graph algorithms, but also lead to inconsistent workflows and performance degradation. The graph retrieval enhancement generation algorithm of the present embodiment can realize accurate and efficient retrieval of knowledge graphs. This algorithm can be applied to large language model question answering, AI search, and other fields to improve the accuracy of knowledge retrieval and ensure the correctness of the large language model generation. The technology disclosed in the present embodiment does not involve hardware modifications.

[0092] Figure 4 is a flowchart of a knowledge enhancement node determination method according to an exemplary embodiment.

[0093] In some embodiments, the knowledge enhancement node can include a local attribute abstract node.

[0094] Referring to Figure 4 , the above knowledge enhancement node determination method can include the following steps.

[0095] In step S402, K-core decomposition is performed on the nodes in the initial multi-attribute graph to obtain at least one connected subgraph; K is an integer greater than or equal to 1.

[0096] The K-core decomposition can be performed on the entity nodes.

[0097] K-core refers to the largest subgraph composed of all nodes in the graph with a degree greater than or equal to k. The K-core decomposition process is to gradually remove nodes with a degree less than k in the graph until the remaining nodes all satisfy the condition of degree ≥ k.

[0098] K-core decomposition can be used to analyze the hierarchical structure of the graph and reveal its internal structural characteristics. High K-core (e.g., K = 5, 10): represents the most tightly connected core nodes in the graph (e.g., key figures in social networks, important servers on the Internet); low K-core (e.g., K = 1, 2): represents edge nodes (e.g., ordinary users in social networks, secondary devices). Therefore, K-core decomposition can be used to find important entity nodes in the initial multi-attribute graph.

[0099] In step S404, betweenness is calculated for the nodes in the initial multi-attribute graph.

[0100] The betweenness can be calculated for the entity nodes.

[0101] Calculating the betweenness of nodes in the multi-attribute graph can help identify key nodes that act as "bridges" in the graph.

[0102] Betweenness measures the frequency of a node appearing in all shortest paths, which can be calculated using formula (2).

[0103]

[0104] where σ st represents the total number of shortest paths from node s to node v. σ st (v) represents the number of shortest paths passing through node v.

[0105] In step S406, the node with the highest degree and the node with a betweenness higher than a betweenness threshold in each connected subgraph are selected as pivot nodes.

[0106] The node with the highest degree (high degree centrality) and the node with a betweenness higher than a betweenness threshold (high betweenness centrality) in each connected subgraph are selected as pivot nodes. The pivot nodes can be nodes that can connect multiple nodes, and these pivot nodes are important in the multi-attribute graph.

[0107] In step S408, semantic unit nodes and relationship nodes corresponding to the pivot nodes are obtained.

[0108] Step S410, a semantic summary is extracted from the semantic unit node and the relationship node corresponding to the hub node to generate a local attribute summary node.

[0109] The knowledge enhancement node is connected with the node of the initial multi-attribute graph to obtain a target multi-attribute graph, including connecting the local attribute summary node with the corresponding hub node to generate the target multi-attribute graph.

[0110] In some embodiments, the hub nodes in the graph can be identified by the k-core decomposition and the betweenness centrality algorithm respectively, and then the hub nodes obtained by the two algorithms are merged as important nodes. The important nodes and related semantic units and relationships are processed (such as abstract extraction by LLM) to obtain a local attribute summary (A), and are connected to the corresponding entity node with an edge e a . At this time, the multi-attribute graph is updated to Specifically, the formula (3) can be referred to

[0111]

[0112] As shown in Figure 11 , the important nodes can be identified by the k-core decomposition and the betweenness centrality, and then the local attribute summary A of the important nodes is obtained to generate the multi-attribute graph (N, R, S, A).

[0113] The above method first separates low connection nodes by k-core decomposition hierarchical, retains core nodes (such as key figures in social networks) with high k-core, and ensures that the topological structure most closely and the entity with the greatest influence in the graph are identified; then the betweenness centrality is used to supplement the identification of “bridge nodes” (such as cross-community connection nodes), which may not be in the high k-core but are crucial to information flow.

[0114] Through the complementation of the above two algorithms, the limitations of a single method are avoided, and the structure importance and function criticality nodes are comprehensively covered.

[0115] Figure 5 is a flowchart of a knowledge enhancement node determination method according to an exemplary embodiment.

[0116] In some embodiments, the knowledge enhancement node can include a first community summary node and a local attribute summary node, and the local attribute summary node can be used for semantic description of the hub node in the initial multi-attribute graph.

[0117] Referring to Figure 5 , the knowledge enhancement node determination method can include the following steps.

[0118] Step S502, community detection is performed on the nodes in the initial multi-attribute graph by a community detection algorithm to obtain at least one community; the at least one community includes a first community.

[0119] In some embodiments, community detection can be performed on the nodes (including entity nodes, relationship nodes, semantic unit nodes, and local attribute summary nodes, etc.) in the initial multi-attribute graph by a community detection algorithm to obtain at least one community; the at least one community includes a first community.

[0120] Step S504, abstract extraction is performed on the entity nodes, relationship nodes, semantic unit nodes, and local attribute summary nodes in the first community to generate a first community summary node.

[0121] In some embodiments, abstract extraction can be performed on the entity nodes, relationship nodes, semantic unit nodes, and local attribute summary nodes in the first community by a large language model to generate a first community summary node.

[0122] In some embodiments, an abstract keyword can also be extracted from the first community summary to generate an abstract keyword node (O).

[0123] In some embodiments, the abstract keyword (O) corresponding to the first community summary node can be connected (T) to the first community summary.

[0124] In some embodiments, the first community summary node can be connected to the nodes (such as all nodes, or entity nodes, or nodes with a higher relevance to the first community summary) in the community to generate a target multi-attribute graph.

[0125] Figure 6 is a flowchart of a community summary node connection method according to an exemplary embodiment.

[0126] Reference Figure 6 The community summary node connection method described above can include the following steps.

[0127] Step S602, vectorization is performed on the first community summary node to obtain a first community summary vector.

[0128] Step S602, vectorization is performed on the entity nodes, semantic unit nodes, and local attribute summary nodes in the first community to obtain at least one entity node vector, at least one semantic unit node vector, and at least one local summary vector.

[0129] Step S606, similarity matching is performed on the at least one entity node vector, the at least one semantic unit node vector, and the at least one local summary vector to determine a target vector with the highest similarity to the first community summary vector.

[0130] Step S608, connect the first community summary node with the node corresponding to the target vector to generate a target multi-attribute graph.

[0131] In some embodiments, in order to further fuse higher level information and expand the search range, the Leiden algorithm can be applied to perform community detection to decompose the graph into a combination of multiple communities. Then, based on the large language model, the content of the community is analyzed to generate a corresponding community summary (H) as the core information of the community. In order to maintain the structural coherence of the graph, the community summary is vectorized, and the similarity matching with A and S in the community is performed to obtain the most relevant node. The community summary is connected with the node, and the edge is e h In addition, in order to further enrich the search content, the keywords (O) of the community summary are extracted based on the LLM, and are connected with the community summary, and the edge is e o , the multi-attribute graph can be further updated to For details, please refer to formula (4).

[0132]

[0133] As shown in Figure 11 , the community summary node can be obtained through community detection, and then the multi-attribute graph (N, R, S, A, H, O) is generated.

[0134] Figure 7 is a flowchart of a knowledge enhanced node determination method according to an exemplary embodiment.

[0135] In some embodiments, the knowledge enhanced node can include a text block node.

[0136] In the following, the present application will combine specific embodiments to explain how the multi-attribute graph is knowledge enhanced through the text block node.

[0137] Referring to Figure 7 , the above knowledge enhanced node determination method can include the following steps.

[0138] Step S702, block processing is performed on the original corpus to obtain at least one text block; the at least one text block includes a first text block.

[0139] Step S704, in the semantic unit node in the initial multi-attribute graph, determine a target semantic unit node whose semantic content is contained in the first text block.

[0140] In some embodiments, the text block node corresponding to the first text block can be connected with the target semantic unit node to generate a target multi-attribute graph.

[0141] In some embodiments, since the initial multi-attribute graph is based on node extraction based on the text block, the original text block contains more complete and detailed information, in order to ensure that the original information can still be retrieved in the graph, the original text block (T) needs to be connected with the semantic unit, and the corresponding edge is e s . Then the multi-attribute graph can be further updated as Specifically, refer to formula (5).

[0142]

[0143] As shown in Figure 11 , the target multi-attribute graph (N, R, S, A, H, O, T) can be obtained by linking the text blocks.

[0144] Figure 8 is a flowchart of a method for determining associated nodes according to an exemplary embodiment.

[0145] Referring to Figure 8 , the method for determining associated nodes can include the following steps.

[0146] Step S802, determining a node matching the keyword of the query statement as an entry node in the target multi-attribute graph.

[0147] Since the target multi-attribute graph contains a large number of nodes, it is necessary to first find the entry node related to the input question (i.e., the query statement).

[0148] In some embodiments, a text matching + vector query method can be used to achieve this. Then, according to the entry node, a global search is performed to expand the search range.

[0149] The implementation process of the entry node query can be as follows.

[0150] (1) Based on LLM, extract the entities contained in the input query, and on the basis of string matching, introduce the use of LLM or synonym library to expand the entities in the query, and at the same time use fuzzy matching algorithm to standardize the entity name, improve the recall rate of query entities and node entities (N, O).

[0151] Specifically, entity node searching can be performed first, but this searching method is too general and cannot accurately find the target, and the retrieval amount is huge, so the retrieval efficiency is low. Then, the community keyword matching query statement can be used to find the community closest to the query statement, and then the entity node searching can be performed in the corresponding community, so that the entry node that can match the query statement can be found more targetedly.

[0152] Through the above method, the retrieval efficiency can be improved, and the retrieval can be targeted (in the matching community), and the retrieval accuracy can be improved.

[0153] (2) using BM25 or inverted index to screen candidate nodes (S, A, H), then vectorizing the input query and the candidate nodes, and calculating the vector similarity between the candidate nodes and the query statement to obtain Top-K nodes. Since the complexity of the query problem is uncertain, the range of K is dynamically adjusted according to the complexity of the input query, and the query complexity is determined by the large language model to output the value of K.

[0154] In step S804, random walk is performed based on the entry node in the target multi-attribute graph to determine the relevance of each node to the entry node.

[0155] In some embodiments, the nodes obtained by text matching and vector query can be combined, which are used as entry nodes to realize global query.

[0156] In step S806, the nodes with the top N relevance are determined as the associated nodes, and N is an integer greater than or equal to 1.

[0157] In some embodiments, random walk can be performed based on the entry node to identify nodes closely related to the entry node as cross nodes for inclusion in the search results.

[0158] Through the above method, information with high relevance to the query statement can be accurately identified.

[0159] In some embodiments, the entry node can include a first entry node.

[0160] In the following, the present application will take the first entry node as an example to explain how to determine the relevance of each node to the first entry node.

[0161] In some embodiments, the relevance of each node to the entry node in the target multi-attribute graph based on random walk can be determined by: determining the initial probability of the first entry node; obtaining an iteration formula and a normalized adjacency matrix of the target multi-attribute graph; combining the normalized adjacency matrix and the initial probability, and performing iteration processing according to the iteration formula to obtain a target distribution matrix. The target distribution matrix is used to represent the relevance of each node in the target multi-attribute graph to the first entry node.

[0162] In some embodiments, the initial probability of the first entry node can be determined based on the following method, which includes: determining the sum of the adjacent edge weights of each entry node; adding the adjacent edge weights of each entry node to obtain a weight sum; and dividing the sum of the adjacent edge weights of the first entry node by the weight sum to determine the initial probability of the first entry node.

[0163] The initial probability of other entry nodes can also be determined by referring to the above method, which will not be described here.

[0164] Specifically, the initial probability of the entry node can be determined by formula (6).

[0165]

[0166] where deg(v) represents the sum of all weights of edges connected to node v. entry represent all the associated nodes.

[0167] In some embodiments, the score value in the iterative query process can be calculated, which can be specifically referred to formula (7).

[0168] π (t) = αP + (1- α)P T π (t-1) (7)

[0169] where P is the normalized adjacency matrix of the target multi-attribute graph, and p represents the transition probability between node i and node j. After t iterations, the importance value of the node can be obtained. The Top-n nodes as the cross nodes are obtained by sorting according to the importance value.

[0170] For the entry node and the cross node, based on the node type filtering, the high information nodes (S, H, A, T) are preferentially returned; for the longer T, the summary is generated based on the LLM, and the token number is reduced. The above nodes are the retrieval results of the multi-attribute graph. The retrieval results are sent into the large language model to generate the feedback content for the input query.

[0171] Figure 9 is a flowchart of a random walk transition probability determination method according to an exemplary embodiment.

[0172] In some embodiments, the target multi-attribute graph can include a first node and a second node, and the first node and the second node are connected.

[0173] Referring to Figure 9 , the random walk transition probability determination method can include the following steps.

[0174] Step S902, the edge weight of the outgoing edge of the first node is obtained.

[0175] Step S904, the edge weights of the outgoing edges of the first node are added to obtain the outgoing edge weight sum of the first node.

[0176] Step S906, the edge weight between the first node and the second node is determined.

[0177] Step S908, the edge weight between the first node and the second node is divided by the outgoing edge weight sum to determine the transition probability from the first node to the second node.

[0178] Specifically, first, since each edge has its weight, reflecting the strength of the relationship between nodes. Therefore, first, the edge weight of each node is normalized, and the normalized weight represents the probability of transition between node i and node j. For details, please refer to formula (8).

[0179]

[0180] where p ij represents the weight between the normalized node pair (v i ,v j ); k is all the connected nodes of node i.

[0181] Figure 10 is a flow chart of an edge weight determination method according to an exemplary embodiment.

[0182] In some embodiments, the target multi-attribute graph includes a third node and a fourth node. In the following, the present application will take the third node and the fourth node as an example to explain how to determine the weight of the edge between the two nodes.

[0183] Referring to Figure 10 , the above edge weight determination method can include the following steps.

[0184] Step S1002, determine the cosine similarity between the third node and the fourth node.

[0185] Step S1004, count the co-occurrence frequency of the third node and the fourth node as a node pair in the target multi-attribute graph.

[0186] Step S1006, weighted sum of the cosine similarity and the co-occurrence frequency to determine the edge weight between the third node and the fourth node.

[0187] Specifically, since the initial value of the edge weight is 1, it cannot reflect the strength of the relationship between nodes. For example, nodes with similar semantics but low co-occurrence (such as "deep learning" and "neural network") may have higher weights, while nodes with high co-occurrence but weak semantics (such as "apple" (fruit) and "apple" (company)) may be incorrectly assigned higher weights. Therefore, the weight of the edge needs to be dynamically adjusted. For v i , use the pre-trained model to calculate the embedding vector e i . Calculate the cosine similarity, refer to formula (9):

[0188]

[0189] Next, traverse all the connected nodes and count the frequency of the co-occurring node pair (v i ,v j ).

[0190] The normalized co-occurrence frequency can be specifically referred to formula (10).

[0191]

[0192] The edge weight is dynamically updated as:

[0193] ω ij = a sim(v i , v j ) + b f(v i , v j ) (11) Wherein, the node pairs in the target multi-attribute graph can be clustered first, and then the clusters with high similarity to the node pair (v i , v j ) are screened as similar clusters (such as the vector similarity can be used for judgment), and then the number of node pairs in the similar cluster is counted as the co-occurrence frequency of the node pair (v i , v j ).

[0194] Figure 11 is a target multi-attribute graph generation logic diagram according to an example embodiment.

[0195] Referring to Figure 11 , the initial multi-attribute graph (S, N, R) can be constructed by decomposing the text, and then the knowledge intermediate multi-attribute graph (S, N, R, A) is constructed based on K-core decomposition and betweenness centrality calculation, and then the multi-attribute graph (S, N, R, A, H, O) is constructed based on community detection technology, and finally the target multi-attribute graph (S, N, R, A, H, O, T) is generated by linking the text blocks. The construction process of the above target multi-attribute graph can be implemented by integrating the embodiments shown in Figures 2-7 , which will not be described here.

[0196] According to the embodiments shown in the present application Figures 2-7 , a multi-attribute graph construction module is proposed, which connects nodes with different attributes through hierarchical construction. First, the basic semantic layer is constructed, and the original text is decomposed into entities, relationships and semantic units based on a large language model; then the nodes are expanded through the knowledge enhancement layer, connecting local attribute summary nodes, community summaries and community keyword nodes; then the original text nodes are further linked through the node enrichment layer, and the edge weight of the graph is dynamically updated based on semantic similarity and co-occurrence frequency, realizing cross-layer accurate retrieval from entities to global semantics.

[0197] In addition, according to the embodiments shown in the present application Figures 8-10The proposed double retrieval mechanism first finds an entry node matching the problem in the multi-source heterogeneous attribute graph based on the input question, then iteratively retrieves based on the entry node to obtain a cross node, and then filters the entry node and the cross node based on node type filtering and other strategies and generates a dynamic summary to obtain the final retrieval result. The double retrieval mechanism proposed by the above method can further integrate coarse and fine-grained retrieval and reduce human intervention.

[0198] The present application can enrich the multi-level knowledge expression ability of the graph structure by constructing a multi-source heterogeneous attribute graph (target multi-element attribute graph) and a double retrieval mechanism, further improve the retrieval accuracy, and reduce the calculation overhead and the number of retrieval tokens.

[0199] It should be particularly pointed out that each step in each embodiment of the above-mentioned retrieval enhancement method based on graph search can be crossed, replaced, added, deleted. Therefore, these reasonable permutations and combinations of the retrieval enhancement method based on graph search should also belong to the protection scope of the present disclosure, and the protection scope of the present disclosure should not be limited to the embodiments.

[0200] Based on the same inventive concept, the present disclosure also provides a retrieval enhancement device based on graph search, as follows. Since the principles of the device embodiments solve problems similar to the above-mentioned method embodiments, the implementation of the device embodiments can be referred to the implementation of the above-mentioned method embodiments, and the repeated parts will not be repeated.

[0201] Figure 12 is a block diagram of a retrieval enhancement device based on graph search according to an exemplary embodiment. Referring to Figure 12 The retrieval enhancement device based on graph search 1200 provided by the present disclosure can include an attribute graph acquisition module 1201, a knowledge enhancement node generation module 1202, a multi-element attribute graph generation module 1203, an associated node determination module 1204, and a feedback generation module 1205.

[0202] The attribute graph obtaining module 1201 can be configured to obtain an initial multi-attribute graph corresponding to the original corpus, the initial multi-attribute graph including entity nodes, relationship nodes and semantic unit nodes; the semantic unit node is the smallest logical fragment carrying independent and complete semantics in the original corpus; the knowledge enhanced node generation module 1202 can be configured to perform knowledge enhancement processing on the initial multi-attribute graph through the original corpus, the semantic unit node and the relationship node to obtain a knowledge enhanced node; the labeled multi-attribute graph generation module 1203 can be configured to connect the knowledge enhanced node with the nodes of the initial multi-attribute graph to obtain a target multi-attribute graph; the associated node determination module 1204 can be configured to perform graph search in the target multi-attribute graph to determine an associated node matched with the query statement; and the feedback generation module 1205 can be configured to input the associated node, the semantic unit node corresponding to the associated node, the knowledge enhanced node and the query statement into the large language model, so that the large language model generates feedback content for the query statement.

[0203] It should be noted that the attribute graph obtaining module 1201, the knowledge enhanced node generation module 1202, the labeled multi-attribute graph generation module 1203, the associated node determination module 1204 and the feedback generation module 1205 correspond to S202-S210 in the method embodiment, and the above modules have the same examples and application scenarios as the corresponding steps, but are not limited to the contents disclosed in the above method embodiment. It should be noted that the above modules as part of the device can be executed in a computer system such as a group of computer executable instructions.

[0204] In some embodiments, the knowledge enhanced node includes a local attribute abstract node; the knowledge enhanced node generation module 1202 can include a decomposition processing submodule, a betweenness calculation submodule, a hub node determination submodule, a hub node information obtaining submodule and an abstract extraction submodule.

[0205] The decomposition processing submodule can be configured to perform K-core decomposition processing on the nodes in the initial multi-attribute graph to obtain at least one connected subgraph; K is an integer greater than or equal to 1; the betweenness calculation submodule can be configured to perform betweenness calculation on the nodes in the initial multi-attribute graph; the hub node determination submodule can be configured to determine the node with the highest degree and the node with a betweenness higher than a betweenness threshold value in each connected subgraph as a hub node; the hub node information obtaining submodule can be configured to obtain the semantic unit node and the relationship node corresponding to the hub node; and the abstract extraction submodule can be configured to perform semantic abstract extraction on the semantic unit node and the relationship node corresponding to the hub node to generate a local attribute abstract node.

[0206] The labeled multi-attribute graph generation module 1203 can include a first connection submodule.

[0207] The first connection submodule can be configured to connect the local attribute summary node with the corresponding pivot node, so as to generate the target multi-attribute graph.

[0208] In some embodiments, the knowledge enhancement node includes a first community summary node and a local attribute summary node, and the local attribute summary node is configured to semantically describe the pivot node in the initial multi-attribute graph; the knowledge enhancement node generation module 1202 can include a community detection submodule and an abstract extraction submodule.

[0209] The community detection submodule can be configured to perform community detection on the nodes in the initial multi-attribute graph by using a community detection algorithm, to obtain at least one community; the at least one community includes the first community; and the abstract extraction submodule can be configured to perform abstract extraction on the entity nodes, the relationship nodes, the semantic unit nodes, and the local attribute summary nodes in the first community, to generate the first community summary node.

[0210] The multi-attribute graph generation module 1203 can include a second node connection submodule.

[0211] The second node connection submodule can be configured to connect the first community summary node with the nodes in the community, to generate the target multi-attribute graph.

[0212] In some embodiments, the second node connection submodule can include a community summary vectorization unit, an entity node vectorization unit, a similarity matching unit, and a second connection unit.

[0213] The community summary vectorization unit can be configured to perform vectorization processing on the first community summary node, to obtain a first community summary vector; the entity node vectorization unit can be configured to perform vectorization on the entity nodes, the semantic unit nodes, and the local attribute summary nodes in the first community, to obtain at least one entity node vector, at least one semantic unit node vector, and at least one local attribute vector; the similarity matching unit can be configured to determine, by similarity matching, a target vector with the highest similarity to the first community summary vector from the at least one entity node vector, the at least one semantic unit node vector, and the at least one local attribute vector; and the second connection unit can be configured to connect the first community summary node with the node corresponding to the target vector, to generate the target multi-attribute graph.

[0214] In some embodiments, the knowledge enhancement node includes a text block node; the knowledge enhancement node generation module 1202 can include a text block determination submodule and a containing relationship determination submodule.

[0215] The text block determination submodule can be configured to perform block processing on the original corpus to obtain at least one text block; the at least one text block includes a first text block; the containment relationship determination submodule can be configured to determine, in the semantic unit nodes in the initial multi-element attribute graph, a target semantic unit node whose semantic content is contained in the first text block; the multi-element attribute graph generation module 1203 can include a third connection submodule.

[0216] The third connection submodule can be configured to generate a target multi-element attribute graph by connecting a text block node corresponding to the first text block and the target semantic unit node.

[0217] In some embodiments, the association node determination module 1204 can include an entry node determination submodule, a relevance determination submodule, and an association node determination submodule.

[0218] The entry node determination submodule can be configured to determine, in the target multi-element attribute graph, a node matching a keyword of the query statement as an entry node; the relevance determination submodule can be configured to determine, based on the entry node, a relevance of each node in the target multi-element attribute graph to the entry node; and the association node determination submodule can be configured to determine, as association nodes, nodes with top N association degrees, where N is an integer greater than or equal to 1.

[0219] In some embodiments, the entry node includes a first entry node; the relevance determination submodule can include an initial probability determination unit, an adjacency matrix determination unit, and a distribution matrix determination unit.

[0220] The initial probability determination unit can be configured to determine an initial probability of the first entry node; the adjacency matrix determination unit can be configured to obtain an iteration formula and a normalized adjacency matrix of the target multi-element attribute graph; and the distribution matrix determination unit can be configured to combine the normalized adjacency matrix and the initial probability, and perform iteration processing according to the iteration formula to obtain a target distribution matrix; the target distribution matrix is used to represent the relevance of each node in the target multi-element attribute graph to the first entry node.

[0221] In some embodiments, the initial probability determination unit can include an adjacent edge weight sum determination submodule, a weight sum determination submodule, and an initial probability determination submodule.

[0222] The adjacent edge weight sum determination submodule can be configured to determine a sum of adjacent edge weights of each entry node; the weight sum determination submodule can be configured to add the sum of adjacent edge weights of each entry node to obtain a weight sum; and the initial probability determination submodule can be configured to divide the sum of adjacent edge weights of the first entry node by the weight sum to determine the initial probability of the first entry node.

[0223] In some embodiments, the target multi-element attribute graph includes the first node and the second node, and the first node and the second node are connected; wherein the correlation degree determination submodule includes: an out-edge weight acquisition unit, a weight adding unit, an edge weight determination unit, and a transition probability determination unit.

[0224] The out-edge weight acquisition unit can be configured to acquire the edge weights of the out-edges of the first node; the weight adding unit can be configured to add the edge weights of the out-edges of the first node to obtain the out-edge weight sum of the first node; the edge weight determination unit can be configured to determine the edge weight between the first node and the second node; and the transition probability determination unit can be configured to divide the edge weight between the first node and the second node by the out-edge weight sum to determine the transition probability from the first node to the second node.

[0225] In some embodiments, the target multi-element attribute graph includes a third node and a fourth node; and the graph search-based retrieval enhancement apparatus 1200 further includes: a cosine similarity determination module, a co-occurrence frequency determination module, and a weighted sum module.

[0226] The cosine similarity determination module can be configured to determine the cosine similarity between the third node and the fourth node; the co-occurrence frequency determination module can be configured to count the co-occurrence frequency of the third node and the fourth node as a node pair in the target multi-element attribute graph; and the weighted sum module can be configured to weighted sum the cosine similarity and the co-occurrence frequency to determine the edge weight between the third node and the fourth node.

[0227] Since the functions of the apparatus 1200 have been described in detail in the corresponding method embodiments, the present disclosure will not repeat them here.

[0228] The modules and / or sub-modules and / or units described in the embodiments of the present disclosure can be implemented in the form of software or hardware. The described modules and / or sub-modules and / or units can also be arranged in a processor. In some cases, the names of these modules and / or sub-modules and / or units do not constitute a limitation on the modules and / or sub-modules and / or units themselves.

[0229] The computer program instructions can also be loaded onto a computer or other programmable information processing apparatus to cause a series of operations to be performed on the computer or other programmable information processing apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable information processing apparatus implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0230] Further, the above-described diagrams are merely schematic illustrations of processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended for limiting purposes. It is readily understood that the processes shown in the above-described diagrams do not indicate or limit the time sequence of the processes. In addition, it is readily understood that the processes can be executed synchronously or asynchronously, for example, in a plurality of modules.

[0231] Figure 13 A structural schematic of an electronic device suitable for implementing the embodiments of the present disclosure is shown. It should be noted that Figure 13 The electronic device 1300 shown is merely an example, and should not bring any limitation to the functions and usage range of the embodiments of the present disclosure.

[0232] As Figure 13 shown, the electronic device 1300 includes a central processing unit (CPU) 1301, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1302 or loaded from a storage section 1308 into a random access memory (RAM) 1303. In the RAM 1303, various programs and data required for operations of the electronic device 1300 are also stored. The CPU 1301, the ROM 1302, and the RAM 1303 are connected to each other through a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.

[0233] The following components are connected to the I / O interface 1305: an input part 1306 including a keyboard, a mouse, etc.; an output part 1307 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage part 1308 including a hard disk, etc.; and a communication part 1309 including a network interface card such as a LAN card, a modem, etc. The communication part 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as necessary. A removable media 1311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 1310 as necessary, so that a computer program read out therefrom is installed in the storage part 1308 as necessary.

[0234] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing computer program instructions for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication part 1309, and / or installed from the removable media 1311. When the computer program is executed by the central processing unit (CPU) 1301, the above-described functions defined in the system of the present disclosure are executed.

[0235] It should be noted that the computer readable storage medium shown in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the above two. The computer readable storage medium may, for example, be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or instrument, or any combination of the above. More specific examples of computer readable storage medium can include, but are not limited to, electrical connection with one or more conductive wires, portable computer disk, hard disk, 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 device, magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer readable storage medium can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, device or instrument. In the present disclosure, the computer readable signal medium can include a data signal carrying computer readable computer program instructions in a baseband or as part of a carrier wave. Such a propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals or any suitable combination of the above. The computer readable signal medium can also be any computer readable storage medium other than the computer readable storage medium, which can send, propagate or transmit programs for use by or in combination with an instruction execution system, device or instrument. The computer program instructions contained on the computer readable storage medium can be transmitted in any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0236] As another aspect, the present disclosure also provides a computer readable storage medium, which can be contained in the device described in the above embodiments, or can exist separately without being assembled into the device. The above computer readable storage medium carries one or more programs, which, when executed by the device, enable the device to implement functions including: obtaining an initial multi-attribute graph corresponding to the original corpus, the initial multi-attribute graph including entity nodes, relationship nodes and semantic unit nodes; the semantic unit node is the smallest logical fragment carrying independent and complete semantics in the original corpus; performing knowledge enhancement processing on the initial multi-attribute graph through the original corpus, the semantic unit node and the relationship node to obtain a knowledge enhanced node; connecting the knowledge enhanced node with the nodes of the initial multi-attribute graph to obtain a target multi-attribute graph; performing graph search in the target multi-attribute graph to determine associated nodes matched with the query statement; inputting the associated nodes, the semantic unit nodes corresponding to the associated nodes and the knowledge enhanced nodes and the query statement into the large language model, so that the large language model generates feedback content for the query statement.

[0237] According to an aspect of the present disclosure, a computer program product or computer program is provided, which includes computer program instructions stored in a computer readable storage medium. The computer program instructions are read from the computer readable storage medium and executed by a processor to implement the method provided in various optional implementation manners of the above-described embodiments.

[0238] Through the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions of the embodiments of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.), and includes a plurality of computer program instructions for causing an electronic device (which can be a server or a terminal device, etc.) to execute the method according to the embodiments of the present disclosure.

[0239] Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon considering the description of the embodiments herein and the disclosure contained herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure following the general principles thereof and including other known or customary features. The description and embodiments are to be regarded as illustrative only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0240] It should be understood that the present disclosure is not limited to the detailed structure, drawing manner or implementation method shown herein, but rather the present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims

1. A retrieval enhancement method based on graph search, characterized in that, include: Obtain the initial multi-attribute graph corresponding to the original corpus, wherein the initial multi-attribute graph includes entity nodes, relation nodes, and semantic unit nodes; The semantic unit node is the smallest logical segment in the original corpus that carries independent and complete semantics; The initial multi-attribute graph is augmented with knowledge using the original corpus, the semantic unit nodes, and the relation nodes to obtain knowledge-enhanced nodes. Connect the knowledge-enhancing nodes to the nodes of the initial multi-attribute graph to obtain the target multi-attribute graph; A graph search is performed in the target multi-attribute graph to determine the associated nodes that match the query statement; The associated node, the semantic unit node and knowledge enhancement node corresponding to the associated node, and the query statement are input into the large language model so that the large language model can generate feedback content for the query statement.

2. The method according to claim 1, characterized in that, The knowledge enhancement nodes include local attribute summary nodes; wherein, the knowledge enhancement nodes are obtained by performing knowledge enhancement processing on the initial multi-attribute graph through the original corpus, the semantic unit nodes, and the relation nodes, including: The nodes in the initial multi-attribute graph are subjected to K-kernel decomposition to obtain at least one connected subgraph; where K is an integer greater than or equal to 1. Betweenness calculation is performed on the nodes in the initial multivariate attribute graph; The node with the highest degree and the node with a betweenness higher than the betweenness threshold in each connected subgraph are designated as hub nodes. Obtain the semantic unit node and relation node corresponding to the hub node; Semantic summaries are extracted from the semantic unit nodes and relation nodes corresponding to the hub node to generate the local attribute summary nodes; Connecting the knowledge-enhancing nodes to the nodes of the initial multivariate attribute graph to obtain the target multivariate attribute graph includes: The local attribute summary nodes are connected to the corresponding hub nodes to generate the target multi-attribute graph.

3. The method according to claim 1, characterized in that, The knowledge enhancement nodes include a first community summary node and a local attribute summary node. The local attribute summary node is used to semantically describe the hub nodes in the initial multi-attribute graph. The knowledge enhancement nodes are obtained by performing knowledge enhancement processing on the initial multi-attribute graph using the original corpus, the semantic unit nodes, and the relation nodes, including: The nodes in the initial multi-attribute graph are subjected to community detection using a community detection algorithm to obtain at least one community; the at least one community includes a first community. Extract summaries from entity nodes, relation nodes, semantic unit nodes, and local attribute summary nodes in the first community to generate the first community summary node; Connecting the knowledge-enhancing nodes to the nodes of the initial multivariate attribute graph to obtain the target multivariate attribute graph includes: The first community summary node is connected to the nodes in the community to generate the target multi-attribute graph.

4. The method according to claim 3, characterized in that, Connecting the first community summary node with nodes in the community to generate the target multi-attribute graph includes: The first community summary node is vectorized to obtain the first community summary vector. Vectorize the entity nodes, semantic unit nodes and local attribute summary nodes in the first community to obtain at least one entity node vector, at least one semantic unit node vector and at least one local summary vector. By similarity matching of the at least one entity node vector, the at least one semantic unit node vector, and the at least one local summary vector, the target vector with the highest similarity to the first community summary vector is determined. Connect the first community summary node with the node corresponding to the target vector to generate the target multi-attribute graph.

5. The method according to claim 1, characterized in that, The knowledge enhancement nodes include text block nodes; wherein, the knowledge enhancement nodes are obtained by performing knowledge enhancement processing on the initial multi-attribute graph through the original corpus, the semantic unit nodes, and the relation nodes, including: The original corpus is segmented to obtain at least one text block; the at least one text block includes a first text block. In the semantic unit nodes of the initial multi-attribute graph, the target semantic unit node whose semantic content is contained in the first text block is determined; Connecting the knowledge-enhancing nodes to the nodes of the initial multivariate attribute graph to obtain the target multivariate attribute graph includes: The text block node corresponding to the first text block is combined with the target semantic unit node to generate the target multi-attribute graph.

6. The method according to claim 1, characterized in that, A graph search is performed in the target multi-attribute graph to determine the associated nodes that match the query statement, including: In the target multi-attribute graph, the node that matches the keyword of the query statement is determined as the entry node; Based on the entry node, a random walk is performed in the target multi-attribute graph to determine the correlation between each node and the entry node; The top N nodes in terms of relevance are identified as associated nodes, where N is an integer greater than or equal to 1.

7. The method according to claim 6, characterized in that, The entry node includes a first entry node; wherein, based on the entry node, a random walk is performed in the target multi-attribute graph to determine the relevance of each node to the entry node, including: Determine the initial probability of the first entry node; Obtain the iterative formula and the normalized adjacency matrix of the target multi-attribute graph; Combining the normalized adjacency matrix and the initial probability, the target distribution matrix is ​​obtained by iterative processing according to the iterative formula; wherein the target distribution matrix is ​​used to represent the correlation between each node in the target multi-attribute graph and the first entry node.

8. The method according to claim 7, characterized in that, Determining the initial probability of the first entry node includes: Determine the sum of the weights of the adjacent edges of each entry node; The weights of the adjacent edges of each entry node are summed to obtain the weight sum. Divide the sum of the weights of the adjacent edges of the first entry node by the sum of the weights to determine the initial probability of the first entry node.

9. The method according to claim 8, characterized in that, The target multi-attribute graph includes a first node and a second node, which are connected; wherein, performing a random walk in the target multi-attribute graph based on the entry node includes: Obtain the edge weights of the outgoing edges of the first node; Add the weights of the outgoing edges of the first node to obtain the sum of the outgoing edge weights of the first node; Determine the edge weights between the first node and the second node; Divide the edge weight between the first node and the second node by the sum of the outgoing edge weights to determine the transition probability from the first node to the second node.

10. The method according to claim 1, characterized in that, The target multi-attribute graph includes a third node and a fourth node; wherein, the method further includes: Determine the cosine similarity between the third node and the fourth node; Calculate the co-occurrence frequency of the third node and the fourth node as node pairs in the target multi-attribute graph; The cosine similarity and the co-occurrence frequency are weighted and summed to determine the edge weight between the third node and the fourth node.

11. A retrieval enhancement device based on graph search, characterized in that, include: The attribute graph acquisition module is used to acquire the initial multi-attribute graph corresponding to the original corpus. The initial multi-attribute graph includes entity nodes, relation nodes, and semantic unit nodes. The semantic unit node is the smallest logical segment in the original corpus that carries independent and complete semantics. The knowledge-enhanced node generation module is used to perform knowledge enhancement processing on the initial multi-attribute graph using the original corpus, the semantic unit nodes, and the relation nodes to obtain knowledge-enhanced nodes. The target multi-attribute graph generation module is used to connect the knowledge enhancement nodes with the nodes of the initial multi-attribute graph to obtain the target multi-attribute graph; The associated node determination module is used to perform graph search in the target multi-attribute graph to determine the associated nodes that match the query statement; The feedback generation module is used to input the associated node, the semantic unit node and knowledge enhancement node corresponding to the associated node, and the query statement into the large language model so that the large language model can generate feedback content for the query statement.

12. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer program instructions; the processor calls the computer program instructions stored in the memory to implement the graph search-based retrieval enhancement method as described in any one of claims 1-10.

13. A computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the graph search-based retrieval enhancement method as described in any one of claims 1-10.

14. A computer program product comprising computer program instructions stored in a computer-readable storage medium, characterized in that, When the computer program instructions are executed by the processor, they implement the method according to any one of claims 1-10.