Knowledge graph question and answer result generation method and device, equipment and medium

By generating an initial execution plan through semantic parsing and logical analysis, and combining subgraph query tools and atomic query tools, the problem of low accuracy in generating question-answering results from knowledge graphs is solved, achieving efficient and reliable question-answering result generation.

CN120873026APending Publication Date: 2025-10-31CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202511035165.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

The accuracy of knowledge graph question-answering results generated in existing technologies is low, mainly due to the lack of automated verification mechanisms and insufficient entity link processing, resulting in erroneous output.

Method used

An initial execution plan is generated through semantic parsing and logical analysis. Entity association data is obtained by combining subgraph query tools, and linearization and entity link rule filtering are performed. Atomic query tools are used for precise querying to ensure entity disambiguation and to verify the question-and-answer results in stages.

Benefits of technology

It improves the automation and accuracy of knowledge graph question answering, enhances the systematic nature and scalability of complex questions, and ensures the reliability of question answering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120873026A_ABST
    Figure CN120873026A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent decision making, can be applied to business system platforms of financial science and technology, medical health and the like, and discloses a knowledge graph question and answer result generation method, device, equipment and medium, which comprises the steps of performing semantic analysis on a user question to obtain entity information and a query intention, performing logic analysis on the entity information and the query intention to obtain a question and answer result; obtaining an initial execution plan; calling a sub-graph query tool according to the initial execution plan, and querying sub-graph data by using the sub-graph query tool; performing linearization processing on the sub-graph data to obtain a sub-graph data text, extracting a candidate entity set in the sub-graph data text, and screening out a matched target entity from the candidate entity set; performing logic analysis on the target entity and the query intention to obtain a target execution plan, and screening out a matched atomic query tool from the candidate tool set; and querying a knowledge graph question-answer result by using an atomic query tool. The knowledge graph question and answer result generation accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent decision-making technology, and in particular to a method, apparatus, device, and medium for generating question-and-answer results from a knowledge graph. Background Technology

[0002] Knowledge graphs store massive amounts of knowledge in a structured form, while large models possess powerful language understanding and generation capabilities. Knowledge graph question answering in large models is mainly achieved by treating knowledge graph knowledge as documents, transforming user questions into query statements, and calling tools to decompose questions. The aim is to enable machines to understand users' natural language questions and accurately retrieve and generate answers from the knowledge graph, thereby improving the efficiency and quality of intelligent question answering.

[0003] In the healthcare field, when using large models for knowledge graph question answering, such as when a patient asks "Which antihypertensive drugs are suitable for diabetic patients," the retrieval-enhanced generation method may recommend drugs with drug interaction risks due to the illusion of a large model. By transforming the query, if the knowledge base is not updated with the latest clinical guidelines, outdated treatment plans may be given. When the tool calls and decomposes the question, if related disease entities such as "diabetic nephropathy" are not correctly linked, the accuracy of the knowledge graph question answering results will be low.

[0004] In the fintech business, when using large models for knowledge graph question answering, such as when an investor asks "What are some highly liquid and low-risk bonds?", the large model may fabricate bond ratings due to illusions when using retrieval-enhanced generation methods. When converting the question into a query, if the knowledge base is not updated with new bond market regulations in a timely manner, it may provide incorrect bond eligibility criteria. When using tools to break down the question, if the entity information such as changes in the creditworthiness of the bond issuer is not accurately linked, the accuracy of the knowledge graph question answering results will be low.

[0005] Existing technologies that utilize tools to invoke knowledge graphs for question answering have significant shortcomings. While this method breaks down user questions into sub-problems and solves them step-by-step using tools, in practical applications, it firstly lacks an automated verification mechanism for the tool's execution results, failing to ensure the accuracy of the answers and potentially leading to the direct output of incorrect results. Secondly, it neglects the crucial role of entity links in graph question answering, lacking proper handling of ambiguity between entities in the question and entities in the knowledge graph, making it prone to analytical biases due to confusion caused by entities with the same name, resulting in low accuracy in the generated knowledge graph question answering results. Summary of the Invention

[0006] This invention provides a method, apparatus, device, and medium for generating question-and-answer results for knowledge graphs, in order to solve the technical problem of low accuracy in generating question-and-answer results for knowledge graphs.

[0007] Firstly, a method for generating question-and-answer results from a knowledge graph is provided, including: Obtain user questions, perform semantic parsing on the user questions to obtain entity information and query intent, and perform logical analysis on the entity information and query intent to obtain an initial execution plan; According to the initial execution plan, the subgraph query tool for the entity information is invoked, and the subgraph query tool is used to query the subgraph data corresponding to the entity information in the pre-built knowledge graph. The subgraph data is linearized to obtain subgraph data text. A set of candidate entities is extracted from the subgraph data text, and target entities that semantically match the user question are selected from the set of candidate entities according to preset entity linking rules. Logical analysis is performed on the target entity and the query intent to obtain the target execution plan for the user's question, and atomic query tools that match the target execution plan are selected from a preset set of candidate tools. The atomic query tool is used to query the knowledge graph question-and-answer results corresponding to the user's question in the pre-built knowledge graph.

[0008] Secondly, a question-answering result generation device for knowledge graphs is provided, including: The initial execution plan generation module is used to obtain user questions, perform semantic parsing on the user questions to obtain entity information and query intent, and perform logical analysis on the entity information and query intent to obtain an initial execution plan; The subgraph data query module is used to call the subgraph query tool of the entity information according to the initial execution plan, and use the subgraph query tool to query the subgraph data corresponding to the entity information in the pre-built knowledge graph. The target entity filtering module is used to linearize the subgraph data to obtain subgraph data text, extract a set of candidate entities from the subgraph data text, and filter out target entities that semantically match the user question from the set of candidate entities according to preset entity linking rules. The atomic query tool filtering module is used to perform logical analysis on the target entity and the query intent to obtain the target execution plan of the user question, and to filter out atomic query tools that match the target execution plan from a preset candidate tool set. The knowledge graph question-and-answer result query module is used to query the knowledge graph question-and-answer results corresponding to the user's question in the pre-built knowledge graph using the atomic query tool.

[0009] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-mentioned knowledge graph question-answering result generation method.

[0010] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the question-and-answer result generation method for the aforementioned knowledge graph.

[0011] The aforementioned solution for generating question-and-answer results for knowledge graphs utilizes semantic parsing and logical analysis to generate an initial execution plan. It then combines this with subgraph query tools to acquire entity association data. Target entities are filtered through linearization and entity linking rules to ensure accurate entity disambiguation. Based on the target entities and query intent, a target execution plan is generated and matched with atomic query tools, achieving modularity in the query process and precision in tool invocation. This method effectively improves the systematic nature of complex problem decomposition, enhances the understanding efficiency of large models through subgraph data linearization, improves system scalability by connecting to multiple types of knowledge graphs using atomic toolsets, and ensures the reliability of question-and-answer results through a phased verification mechanism. This improves the automation level and accuracy of knowledge graph question-and-answer generation, addressing the problem of low accuracy in generating knowledge graph question-and-answer results. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram of an application environment for a knowledge graph question-answering result generation method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a method for generating question-and-answer results for a knowledge graph according to an embodiment of the present invention; Figure 3 yes Figure 2 A flowchart illustrating a specific implementation method of step S1; Figure 4 yes Figure 2 A flowchart illustrating a specific implementation method of step S2; Figure 5 This is a schematic diagram of a knowledge graph question-and-answer result generation device according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 7 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0015] The knowledge graph question-answering result generation method provided in this invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can obtain user questions from the client, perform semantic parsing on the user questions to obtain entity information and query intent, perform logical analysis on the entity information and query intent to obtain an initial execution plan, and call the subgraph query tool of the entity information according to the initial execution plan to query the subgraph data corresponding to the entity information in the pre-built knowledge graph. The subgraph data is linearized to obtain subgraph data text, and a set of candidate entities is extracted from the subgraph data text. Based on preset entity linking rules, target entities that semantically match the user question are selected from the candidate entity set. The target entities are then processed... Logical analysis is performed on the query intent to obtain the target execution plan for the user question. Atomic query tools matching the target execution plan are selected from a pre-set candidate toolset. These atomic query tools are then used to query the knowledge graph question-and-answer results corresponding to the user question within the pre-built knowledge graph. In this invention, an initial execution plan is generated through semantic parsing and logical analysis. Entity association data is obtained using subgraph query tools. Target entities are filtered through linearization and entity linking rules to ensure the accuracy of entity disambiguation. A target execution plan is generated based on the target entities and query intent, and matched with atomic query tools, achieving modularity of the query process and precision of tool invocation. This method effectively improves the systematic nature of complex problem decomposition, enhances the understanding efficiency of large models through subgraph data linearization, improves system scalability by connecting to multiple types of knowledge graphs using atomic toolsets, and ensures the reliability of question-and-answer results through a phased verification mechanism, thereby improving the automation level and accuracy of knowledge graph question-and-answer. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster composed of multiple servers. The invention will be described in detail below through specific embodiments.

[0016] Please see Figure 2 As shown, Figure 2 A flowchart illustrating a method for generating question-answering results for a knowledge graph according to an embodiment of the present invention includes the following steps: S1. Obtain the user's question, perform semantic parsing on the user's question to obtain entity information and query intent, perform logical analysis on the entity information and query intent to obtain an initial execution plan.

[0017] In this embodiment of the invention, the user question is a specific inquiry raised by the user, such as "Help me find a million-dollar medical insurance policy in region A"; the entity information is a key object extracted from the user question, such as "million-dollar medical insurance" and "region A" in the question; the query intent is the purpose behind the user question, that is, to find entity-related information with specific attributes (such as region A).

[0018] In detail, the system performs semantic understanding of user questions through a large model, extracts key objects as entity information, and analyzes question keywords and context to determine user needs and purposes as query intent. This process completes semantic parsing to obtain entity information and query intent.

[0019] For example, in a medical scenario, when a user asks, "What are the effects of antiplatelet drugs suitable for patients with coronary heart disease?", a large model is used to perform semantic analysis on the question, extracting "coronary heart disease" and "antiplatelet drugs" as entity information from the question. At the same time, based on keywords such as "suitable" and "effects" in the question and the context, the user's query intent is determined to be to understand the specific efficacy of antiplatelet drugs in the treatment of coronary heart disease. This process focuses on accurately extracting key objects and needs from the question text.

[0020] For example, in a financial scenario, when a user asks, "What are some low-risk fund products with an annualized return of over 6%?", the system uses a large model to perform semantic analysis on the question, extracting "6% annualized return" and "low-risk fund products" as entity information from the question. At the same time, based on keywords such as "over 6%" and "low risk" and the context, the system clarifies the user's query intent: to search for fund product information that meets specific return and risk levels.

[0021] In this embodiment of the invention, the initial execution plan is a preliminary action plan for solving the user problem, formed by logically sorting, associating and structuring the entity information (such as specific objects, data, etc.) and query intent (such as query, analysis, comparison, etc.) extracted from the user problem. The plan clarifies the basic execution framework, such as the specific operation steps, data processing path or information retrieval direction, that need to be performed to meet the user's needs.

[0022] In this embodiment of the invention, reference is made to Figure 3As shown, the step of logically analyzing the entity information and the query intent to obtain the initial execution plan for the user's question includes: S31. The entity information is extracted in a structured manner to obtain a structured entity set, and the query intent is semantically decomposed to obtain query parameters; S32. Associate the structured entity set with the query parameters to obtain a semantic association constraint set; S33. Generate a preliminary step framework for the user question based on the semantic association constraint set; S34. The preliminary step framework is processed to standardize the execution elements to obtain the initial execution plan for the user problem.

[0023] In detail, a structured entity set is a collection of entity information extracted from data content and structured (e.g., organized in the form of tables or key-value pairs). Each entity contains explicit attributes and corresponding values. Query parameters are key condition elements obtained after semantic analysis and decomposition of the user's query intent, such as specific restrictions like time, location, and type. The semantic association constraint set is a set of constraint relationships formed by semantically mapping the entity attributes in the structured entity set to the query parameters. It is used to define the matching rules and correspondences between entities and query conditions.

[0024] Specifically, the reactcodeagent in the problem analysis module extracts entity information in a structured way, transforming unstructured information into a structured entity set containing entity attributes and relationships. At the same time, semantic understanding is used to decompose the query intent to obtain query parameters such as attribute conditions and relationship types. Then, with the help of the select-agent, based on functional dependency relationships and constraint decoding mechanisms, the entity attributes in the structured entity set are semantically mapped and matched with the query parameters, thereby forming a semantic association constraint set that defines the rules for the correspondence between entities and query conditions.

[0025] Furthermore, the preliminary steps framework is a preliminary solution steps architecture for user problems generated based on the semantic association constraint set (i.e., the constraint relationship formed by the association mapping between the structured entity set and the query parameters). This architecture outlines the key steps required to solve the problem in the form of a framework, providing a basic framework for the subsequent formation of an operable initial execution plan through the normalization of execution elements.

[0026] Furthermore, by using reactcodeagent to construct a preliminary step framework containing tool invocation logic based on a set of semantic association constraints, this framework outlines the path to solve the problem using the invocation order of atomic tools such as get_relations (getting relationships) and get_neighbors (getting neighbors). Then, by standardizing the execution elements such as tool parameters and preconditions in each step of the framework (such as validating parameter validity and clarifying tool dependencies), the framework is transformed into an initial execution plan that conforms to the execution rules.

[0027] For example, in a medical scenario, when a user asks "Which tertiary hospitals in region A have oncology departments and offer targeted therapy?", the system first extracts a structured set of entities including "region A", "tertiary hospitals", and "oncology department" using `get_node`. Semantically, the query intent is decomposed to obtain parameters such as "region = region A", "hospital level = tertiary", "department = oncology", and "treatment method = targeted therapy". After associating and mapping these parameters to form a constraint set, `reactcodeagent` generates a preliminary framework: After calling `get_node("tertiary hospitals in region A")` to obtain the entity set, the `filter` tool is used to filter the results based on attribute conditions. By specifying the filter condition "department = oncology", the system accurately locates target entities containing oncology departments from the candidate hospitals. After filtering, the `get_neighbors` tool queries the corresponding treatment methods for these hospitals' oncology departments. Finally, `filter("treatment method = targeted therapy")` is used for precise location, and the results are normalized to form an initial execution plan.

[0028] For example, in a financial scenario, when a user asks "Which joint-stock commercial banks in region A issue credit cards with a credit limit exceeding 50,000 yuan?", the system first extracts a structured entity set of "region A", "joint-stock commercial banks", and "credit cards" using `get_node`. Semantically, the query intent is decomposed to obtain the parameters "region = region A", "bank type = joint-stock", "card type = credit card", and "credit limit > 50,000". After associating and mapping these parameters to form a constraint set, `reactcodeagent` generates a preliminary step framework: calling `get_node("joint-stock commercial banks in region A")` to obtain entities, filtering using `filter("issue credit cards")`, querying the credit card credit limit using `get_attributes`, and finally using `filter("credit limit > 50,000")` for precise location. This is then processed by normalization to form an initial execution plan.

[0029] S2. According to the initial execution plan, call the subgraph query tool of the entity information, and use the subgraph query tool to query the subgraph data corresponding to the entity information in the pre-built knowledge graph.

[0030] In this embodiment of the invention, the subgraph query tool is a type of graph query tool used to query subgraphs centered on entities, and its main function is to assist in entity linking.

[0031] In detail, reactcodeagent generates execution instructions covering entity extraction and query functions based on the initial execution plan. After calling the get_node tool to obtain entity information, it immediately triggers the get_subgraph (v) subgraph query tool (where v is an entity variable).

[0032] In this embodiment of the invention, the pre-built knowledge graph refers to a structured knowledge base that has been pre-built through processes such as data collection, modeling, and storage, in which entities, entity attributes, and relationships between entities are stored in the form of a graph structure; the subgraph data refers to local graph structure data extracted from the knowledge graph based on specific entity information.

[0033] In this embodiment of the invention, reference is made to Figure 4 As shown, the step of using the subgraph query tool to query the subgraph data corresponding to the entity information in the pre-built knowledge graph includes: S41. Perform semantic parsing on the entity information to obtain the target entity variable; S42. Using the preset subgraph query function in the subgraph query tool, perform a neighborhood query on the target entity variable in the pre-constructed knowledge graph to obtain initial subgraph data; S43. Based on the entity association rules in the pre-constructed knowledge graph, the initial subgraph data is filtered according to the rules to obtain the subgraph data.

[0034] In detail, the target entity variable is a structured variable used to represent the target entity after semantic parsing of entity information. It usually contains entity identifiers or key attributes for precise positioning. The preset subgraph query function is a predefined neighborhood query function module in the subgraph query tool. It performs retrieval in the knowledge graph according to set rules (such as querying the adjacent N layers of nodes and relationships of the entity). The initial subgraph data is the basic result obtained by performing neighborhood queries on the target entity variable through this function.

[0035] Specifically, reactcodeagent uses natural language processing technology to perform semantic parsing on entity information, extracts key features and structures them into target entity variables, and then calls the get_subgraph neighborhood query function in the subgraph query tool to retrieve its neighboring nodes and relationships in the pre-built knowledge graph with the target entity variable as the center, thereby obtaining initial subgraph data containing information directly related to the target entity.

[0036] Furthermore, entity association rules are pre-defined logical constraints in the pre-built knowledge graph, used to define the validity criteria of the association between entities. Specifically, they may include relationship type matching rules (such as "belongs to" or "contains" relationship types), attribute value filtering rules (such as entity attributes need to meet specific numerical ranges or text patterns), association path length restriction rules (such as only retaining associations within N degrees of the target entity), etc. These rules are used to filter nodes and relationships in the initial subgraph data and retain association structures that meet the preset logical conditions.

[0037] Furthermore, based on the predefined entity association rules in the pre-built knowledge graph, the nodes and edges in the initial subgraph data are matched and filtered, and entity associations that do not conform to the rules (such as invalid relationship types and connections with abnormal attribute values) are automatically removed, while the association structures that meet the preset logical conditions are retained, thereby completing the transformation from the initial subgraph data to the refined subgraph data.

[0038] For example, in a medical scenario, when a user inputs "query key diagnostic indicators for acute myocardial infarction," the system performs semantic parsing on "acute myocardial infarction," extracting key information such as disease name, ICD code, and pathological features to generate target entity variables. The system then calls the `get_subgraph` function of the subgraph query tool to perform a 2-degree neighborhood query in a pre-built cardiovascular disease knowledge graph, obtaining initial subgraph data containing associated nodes such as myocardial injury markers, electrocardiogram features, and clinical symptoms. Next, based on preset entity association rules in the knowledge graph, the system filters out weakly correlated risk factors (such as smoking history) and non-specific symptoms (such as fatigue), ultimately forming subgraph data focusing on core diagnostic indicators such as dynamic changes in troponin and ST segment evolution patterns.

[0039] For example, in a financial scenario, when a user queries "Inquire about the risk rating of Bank A's wealth management products," the system performs semantic parsing on "Bank A's wealth management products," extracting key information such as product name, issuing institution, and product type to generate target entity variables. The system then calls the `get_subgraph` function of the subgraph query tool to perform a 3-degree neighborhood query within a pre-built financial product knowledge graph, obtaining initial subgraph data containing related nodes such as product type (money market fund), historical yield, investment targets (bank deposits, bonds), and liquidity indicators. Next, based on preset entity association rules in the knowledge graph, the system filters out historical data from the product's early stages and information on non-core investment targets, ultimately forming subgraph data focusing on core elements such as the current low-risk R1 rating and 7-day annualized yield.

[0040] S3. Linearize the subgraph data to obtain subgraph data text, extract the candidate entity set from the subgraph data text, and select the target entity that semantically matches the user question from the candidate entity set according to the preset entity linking rules.

[0041] In this embodiment of the invention, the subgraph text data is natural language text obtained by linearizing the entity-centered subgraph data (containing structured information such as nodes, relationships, and attributes) in the knowledge graph; the candidate entity set is a list of potential entities related to the question extracted from the text, which is used to subsequently filter out the correct entities through entity links.

[0042] In detail, by converting entity-centric subgraph data in the knowledge graph into natural language text according to rules, the linearization process of the subgraph data is completed, forming subgraph data text that is easy for large models to understand. Then, potential entities related to the problem context are identified and extracted from this text to form a candidate entity set for subsequent entity linking and filtering.

[0043] In this embodiment of the invention, the preset entity linking rules are pre-defined criteria for judging the degree of semantic matching between candidate entities and user questions; the target entity is the entity that best matches the semantics of the user question, selected from the candidate entity set according to these rules.

[0044] In this embodiment of the invention, the step of selecting target entities that semantically match the user's question from the candidate entity set according to preset entity linking rules includes: Extract the subgraph path corresponding to each entity in the candidate entity set; The subgraph paths are aggregated into a set of entity association paths for the candidate entity set; Based on preset entity linking rules, semantic association analysis is performed on the entity association path set and the user question to obtain a path association score; The entity with the highest path association score is selected from the entity association path set as the target entity for semantic matching with the user question.

[0045] In detail, a subgraph path refers to an ordered sequence of nodes and relationships that extend along the relationships between entities in a specific subgraph starting from a candidate entity, reflecting the connection path between the entity and other nodes; the entity association path set is a set formed by aggregating and integrating all subgraph paths corresponding to each entity in the candidate entity set, used to present the association path network between candidate entities in the system.

[0046] Specifically, the get_subgraph tool is called through reactcodeagent to extract the subgraph path corresponding to each entity in the candidate entity set. Then, the subgraph paths of each entity are summarized and integrated to form an entity association path set that covers all candidate entity association paths.

[0047] Furthermore, the path association score is a quantitative result obtained by performing semantic association analysis on the entity association path set and the user question based on preset entity linking rules. It is used to characterize the strength of the semantic association between each path in the entity association path set and the user question.

[0048] Furthermore, by utilizing pre-defined entity linking rules, the large model calculates the semantic similarity between the path set and the user's question. Combined with the filtering and sorting functions in the atomic tools, a path association score is generated. Finally, the entity corresponding to the highest-scoring path is selected from the entity association path set by the select-agent. After the review-agent verifies the semantic matching accuracy, it is determined as the target entity.

[0049] S4. Perform logical analysis on the target entity and the query intent to obtain the target execution plan for the user question, and select atomic query tools that match the target execution plan from a preset candidate tool set.

[0050] In this embodiment of the invention, the target execution plan refers to a structured processing flow in the form of executable code generated after logical analysis of the target entity and query intent in the user's question by reactcodeagent.

[0051] In this embodiment of the invention, the step of performing logical analysis on the target entity and the query intent to obtain the target execution plan for the user question includes: Semantic parsing is performed on the target entity to obtain entity text features; The intent element set of the query intent is determined based on the action instructions and constraints in the query intent; Logically associate and map the entity text features with the intent element set to obtain the associated logical structure; The target execution plan for the user's problem is generated based on the associated logical structure and the preset execution constraint rules.

[0052] In detail, entity text features are the key textual information (such as attributes, categories, keywords, etc.) that can represent the target entity after semantic parsing; action instructions are the instructions in the query intent that represent specific operational behaviors (such as "query", "get", "filter", etc.); constraints are the content in the query intent that limits the scope and conditions of the action execution (such as time, location, quantity, attribute range, etc.); and the intent element set is the combination of elements (including key elements such as action instructions and corresponding constraints) determined according to the action instructions and constraints in the query intent to fully describe the query intent.

[0053] Specifically, the reactcodeagent performs semantic parsing on the target entity, and uses atomic tools such as get_node and get_subgraph to extract textual information such as the target entity's attributes and relationship paths from the knowledge base to form entity text features. At the same time, the query intent is semantically decomposed, and then the select-agent matches the corresponding execution tool from the candidate tool set according to the logical association between the action instructions and constraints, and integrates them to form an intent element set containing key elements such as action type and constraint parameters.

[0054] Furthermore, the associated logical structure is a structured relationship formed by mapping entity text features and intent element sets through logical association, used to reflect the correspondence between the two; the preset execution constraint rules are pre-set restrictive conditions or rules that must be followed when generating the target execution plan, to ensure that the execution plan meets the established requirements and logical specifications.

[0055] Furthermore, by using reactcodeagent to perform semantic-level logical association analysis on entity text features and intent element sets, the text features such as entity attributes and relationships are structurally mapped to action instructions and constraints in the intent. Then, reactcodeagent generates a target execution plan containing ordered tool call steps and parameters based on the logical dependencies of tool calls in this structure and in combination with preset execution constraint rules (such as atomic tool preconditions, maximum iteration limit, etc.).

[0056] In this embodiment of the invention, the preset candidate toolset is a set of tools pre-built based on the inter-function dependencies, including graph query classes (such as entity query, subgraph query) and function tool classes (such as aggregation, sorting, filtering) and other candidate operations; the atomic query tool is a basic tool with the smallest operation granularity, which can be directly mapped to knowledge base query statements (such as get_relations, argmin), and the two are matched with the target execution plan and the specific tool through select-agent.

[0057] In this embodiment of the invention, the step of selecting atomic query tools that match the target execution plan from a preset set of candidate tools includes: The execution preconditions in the target execution plan are logically decomposed to obtain a set of execution dependencies; By associating and integrating the tool type constraint set and the execution dependency set in the target execution plan, the tool selection criteria of the target execution plan are obtained. Based on the tool selection criteria, a functional matching degree analysis is performed on each atomic tool in the preset candidate tool set to obtain a preliminary tool candidate subset for the target execution plan; Perform execution order logic verification on the atomic tools within the preliminary tool candidate subset to obtain the tool combination for the target execution plan; The matching score of the atomic tools in the tool portfolio is calculated based on the priority weight of each execution step in the target execution plan; Atomic tools with a matching score higher than a preset matching threshold are used as atomic query tools to match the target execution plan.

[0058] In detail, execution preconditions are the prerequisites that must be met before the target execution plan can be executed (such as data preparation, environment status, etc.); the execution dependency set is the set of dependencies between conditions obtained by logically decomposing the execution preconditions (such as condition A must be satisfied before condition B); the tool type constraint set is the range of selectable tool types (such as specifying that only query or calculation tools can be used); and the tool selection criteria are the specific conditions formed by associating and integrating the tool type constraint set and the execution dependency set, used to select tools that meet the type requirements and can satisfy the execution dependencies.

[0059] Specifically, the execution preconditions in the target execution plan are logically decomposed and transformed into a set of sequential dependencies between the preconditions (i.e., the execution dependency set). Then, the constraint set that limits the tool type in the target execution plan (such as only graph query tools or function tools can be used) is associated and matched with the execution dependency set, so that the tool type requirements and execution order dependencies are combined to form the screening conditions for tools that meet the type and satisfy the dependency relationship.

[0060] Furthermore, the preliminary tool candidate subset is an intermediate set of tools for the target execution plan obtained after performing functional matching analysis on each atomic tool in the preset candidate tool set according to the tool screening criteria; the tool combination is a combination of tools that conforms to the execution logic after performing execution order logic verification on the atomic tools in the preliminary tool candidate subset; the matching score is a comprehensive matching degree value of the atomic tools in the tool combination calculated based on the priority weight of each execution step in the target execution plan; the preset matching threshold is a pre-set matching standard value used to screen atomic tools, and atomic tools that are higher than this value will be selected as atomic query tools that match the target execution plan.

[0061] Furthermore, the atomic tools in the pre-defined candidate tool set are analyzed using the `reactcodeagent` algorithm to determine their functional fit with the target execution plan based on screening criteria, thus obtaining a preliminary subset of candidate tools. The execution order of the atomic tools within this subset is then logically verified using `review-agent` to form a tool combination. A matching score model incorporating weighted factors is constructed using `select-agent`, combining the priority weights of each execution step in the target execution plan, to quantitatively score the atomic tools in the tool combination. Atomic tools with matching scores exceeding a pre-defined threshold are selected from the tool combination and identified as matching atomic query tools for the target execution plan through the `select-agent` decision module, achieving precise matching between tools and the execution plan.

[0062] S5. Use the atomic query tool to query the knowledge graph question-and-answer results corresponding to the user's question in the pre-built knowledge graph.

[0063] In this embodiment of the invention, the knowledge graph question answering result is a structured data or natural language answer that can directly answer user questions, obtained by querying and processing the pre-built knowledge graph using an atomic query tool. The answer is automatically verified and evaluated to ensure accuracy and relevance.

[0064] In this embodiment of the invention, the step of using the atomic query tool to query the knowledge graph question-answering results corresponding to the user question in the pre-built knowledge graph includes: The relational query function in the atomic query tool is used to query the relational path corresponding to the user question. Based on the semantic features of the user question, the relational path is filtered for semantic relevance to obtain the target relational path. The attribute query function in the atomic query tool is used to query the entity attribute information of the user question from the pre-built knowledge graph. The target relationship path and the entity attribute information are then aggregated in a structured manner to obtain a structured knowledge fragment. The structured knowledge fragments are semantically consistent with the user questions to obtain a semantic consistency score. When the semantic verification score is lower than the preset verification score threshold, the knowledge graph question answering result corresponding to the user question is generated using the iterative function in the preset code response unit.

[0065] In detail, the relation query function is a functional module in the atomic query tool used to find the relationships between entities in the knowledge graph and return the corresponding relation connection routes (i.e., relation paths, which refer to the path chains formed by entities being connected sequentially through various relations); semantic features are key elements (such as keywords, semantic intent, context, etc.) that embody the semantic meaning of the user's question, used to filter the relevance of relation paths; the target relation path is an effective relation path that highly matches the semantics of the user's question after being filtered by semantic features; the attribute query function is a functional component in the atomic query tool that obtains entity attribute data from the knowledge graph, and entity attribute information refers to the characteristics, properties, and related data (such as attribute names, attribute values, etc.) of an entity; and structured knowledge fragments are ordered knowledge combinations formed by aggregating the target relation path and entity attribute information according to a specific logical structure (such as triples, graph structures, etc.).

[0066] Specifically, the relational query function (such as get_relations) in the atomic query tool is used to query the relationship connection chain (i.e., relational path) between entities corresponding to the user's question. Based on the semantic features such as keywords and semantic intent in the user's question, these relational paths are filtered for relevance to obtain the target relational path that matches the semantics of the question. At the same time, the attribute query function (such as get_attributes) is used to obtain the attribute data (such as attribute name, value, etc.) of the entities from the pre-built knowledge graph. The target relational path and entity attribute information are aggregated in a structured form such as triples to form a structured knowledge fragment for the system to answer the question.

[0067] Furthermore, the semantic verification score is a quantitative score that measures the semantic consistency between structured knowledge fragments and user questions using natural language processing technology. The preset verification score threshold is a pre-defined standard for judging whether semantic consistency meets the requirements. When the score is lower than the threshold, it indicates that the direct matching result does not meet the requirements. The preset code response unit, namely reactcodeagent, is essentially generating executable code and has an automated verification mechanism. The iterative function is a functional module in reactcodeagent that implements loop reasoning. When the code verification finds an error, it can combine the error information to regenerate the execution plan and automatically iterate (the maximum number of iterations does not exceed 5 times) until the correct knowledge graph question answering result is generated.

[0068] Furthermore, a semantic verification score is obtained by performing semantic consistency calculation on structured knowledge fragments and user questions using natural language processing technology. When the score is lower than the pre-set judgment standard (verification score threshold), the iterative function (supporting up to 5 loops of reasoning) in the preset code response unit (i.e., reactcodeagent) with automatic verification and error iteration mechanism is used to regenerate the execution plan and drive the knowledge graph query in combination with the error information, thereby generating a question-and-answer result that matches the user question.

[0069] As can be seen, in the above scheme, an initial execution plan is generated through semantic parsing and logical analysis. Entity association data is obtained using a subgraph query tool. Target entities are then filtered through linearization and entity linking rules to ensure the accuracy of entity disambiguation. A target execution plan is generated based on the target entities and query intent, and matched with atomic query tools, achieving modularity of the query process and precision of tool invocation. This method effectively improves the systematic nature of complex problem decomposition, enhances the understanding efficiency of large models through subgraph data linearization, improves system scalability by connecting to multiple types of knowledge graphs using atomic toolsets, and ensures the reliability of question-and-answer results through a phased verification mechanism, thereby improving the automation level and accuracy of knowledge graph question-and-answer.

[0070] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0071] In one embodiment, a question-and-answer result generation device for a knowledge graph is provided, which corresponds one-to-one with the question-and-answer result generation method for the knowledge graph in the above embodiments. For example... Figure 5 As shown, the knowledge graph question-and-answer result generation device 100 includes an initial execution plan generation module 101, a subgraph data query module 102, a target entity filtering module 103, an atomic query tool filtering module 104, and a knowledge graph question-and-answer result query module 105. Detailed descriptions of each functional module are as follows: The initial execution plan generation module 101 is used to obtain user questions, perform semantic parsing on the user questions to obtain entity information and query intent, and perform logical analysis on the entity information and query intent to obtain an initial execution plan. Subgraph data query module 102 is used to call the subgraph query tool of the entity information according to the initial execution plan, and use the subgraph query tool to query the subgraph data corresponding to the entity information in the pre-built knowledge graph; The target entity filtering module 103 is used to perform linearization processing on the subgraph data to obtain subgraph data text, extract a set of candidate entities from the subgraph data text, and filter out target entities that semantically match the user question from the set of candidate entities according to preset entity linking rules. The atomic query tool filtering module 104 is used to perform logical analysis on the target entity and the query intent to obtain the target execution plan of the user question, and to filter out atomic query tools that match the target execution plan from a preset candidate tool set. The knowledge graph question-and-answer result query module 105 is used to query the knowledge graph question-and-answer result corresponding to the user question in the pre-built knowledge graph using the atomic query tool.

[0072] In one embodiment, the initial execution plan generation module 101, when performing logical analysis on the entity information and the query intent to obtain the initial execution plan for the user question, is used to: The entity information is extracted in a structured manner to obtain a set of structured entities, and the query intent is semantically decomposed to obtain query parameters; The structured entity set is associated and mapped with the query parameters to obtain a semantic association constraint set; A preliminary step framework for generating the user question is generated based on the set of semantic association constraints. The initial execution plan for the user problem is obtained by standardizing the execution elements of the preliminary step framework.

[0073] In one embodiment, the subgraph data query module 102, when executing the query of subgraph data corresponding to the entity information in a pre-built knowledge graph using the subgraph query tool, is configured to: The entity information is semantically parsed to obtain the target entity variable; Using the preset subgraph query function in the subgraph query tool, a neighborhood query is performed on the target entity variable in the pre-constructed knowledge graph to obtain initial subgraph data; The initial subgraph data is filtered according to the entity association rules in the pre-constructed knowledge graph to obtain the subgraph data.

[0074] In one embodiment, the target entity filtering module 103, when performing the filtering of target entities that semantically match the user question from the candidate entity set according to preset entity linking rules, is configured to: Extract the subgraph path corresponding to each entity in the candidate entity set; The subgraph paths are aggregated into a set of entity association paths for the candidate entity set; Based on preset entity linking rules, semantic association analysis is performed on the entity association path set and the user question to obtain a path association score; The entity with the highest path association score is selected from the entity association path set as the target entity for semantic matching with the user question.

[0075] In one embodiment, the atomic query tool filtering module 104, when performing logical analysis on the target entity and the query intent to obtain the target execution plan for the user question, is used to: Semantic parsing is performed on the target entity to obtain entity text features; The intent element set of the query intent is determined based on the action instructions and constraints in the query intent; Logically associate and map the entity text features with the intent element set to obtain the associated logical structure; The target execution plan for the user's problem is generated based on the associated logical structure and the preset execution constraint rules.

[0076] In one embodiment, the atomic query tool filtering module 104, when performing the filtering of atomic query tools that match the target execution plan from a preset candidate tool set, is further configured to: The execution preconditions in the target execution plan are logically decomposed to obtain a set of execution dependencies; By associating and integrating the tool type constraint set and the execution dependency set in the target execution plan, the tool selection criteria of the target execution plan are obtained. Based on the tool selection criteria, a functional matching degree analysis is performed on each atomic tool in the preset candidate tool set to obtain a preliminary tool candidate subset for the target execution plan; Perform execution order logic verification on the atomic tools within the preliminary tool candidate subset to obtain the tool combination for the target execution plan; The matching score of the atomic tools in the tool portfolio is calculated based on the priority weight of each execution step in the target execution plan; Atomic tools with a matching score higher than a preset matching threshold are used as atomic query tools to match the target execution plan.

[0077] In one embodiment, the knowledge graph question-answering result query module 105, when executing the query to find the knowledge graph question-answering result corresponding to the user question in the pre-built knowledge graph using the atomic query tool, is configured to: The relational query function in the atomic query tool is used to query the relational path corresponding to the user question. Based on the semantic features of the user question, the relational path is filtered for semantic relevance to obtain the target relational path. The attribute query function in the atomic query tool is used to query the entity attribute information of the user question from the pre-built knowledge graph. The target relationship path and the entity attribute information are then aggregated in a structured manner to obtain a structured knowledge fragment. The structured knowledge fragments are semantically consistent with the user questions to obtain a semantic consistency score. When the semantic verification score is lower than the preset verification score threshold, the knowledge graph question answering result corresponding to the user question is generated using the iterative function in the preset code response unit.

[0078] This invention provides a question-and-answer result generation device for knowledge graphs. It generates an initial execution plan through semantic parsing and logical analysis, acquires entity association data using a subgraph query tool, filters target entities through linearization and entity linking rules to ensure accurate entity disambiguation, and generates a target execution plan based on the target entities and query intent. This plan is then matched with atomic query tools, achieving modularity of the query process and precision in tool invocation. This method effectively improves the systematic decomposition of complex problems, enhances the understanding efficiency of large models through subgraph data linearization, improves system scalability by connecting to multiple types of knowledge graphs using atomic toolsets, and ensures the reliability of question-and-answer results through a phased verification mechanism. This enhances the automation and accuracy of knowledge graph question-and-answer processes.

[0079] Specific limitations regarding the question-answering result generation device for knowledge graphs can be found in the limitations on the question-answering result generation method for knowledge graphs mentioned above, and will not be repeated here. Each module in the aforementioned question-answering result generation device for knowledge graphs can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in a computer device, or stored in software in the memory of a computer device, so that the processor can call and execute the operations corresponding to each module.

[0080] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of a knowledge graph question-answering result generation method on the server side.

[0081] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements client-side functions or steps of a knowledge graph question-answering result generation method.

[0082] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Obtain user questions, perform semantic parsing on the user questions to obtain entity information and query intent, and perform logical analysis on the entity information and query intent to obtain an initial execution plan; According to the initial execution plan, the subgraph query tool for the entity information is invoked, and the subgraph query tool is used to query the subgraph data corresponding to the entity information in the pre-built knowledge graph. The subgraph data is linearized to obtain subgraph data text. A set of candidate entities is extracted from the subgraph data text, and target entities that semantically match the user question are selected from the set of candidate entities according to preset entity linking rules. Logical analysis is performed on the target entity and the query intent to obtain the target execution plan for the user's question, and atomic query tools that match the target execution plan are selected from a preset set of candidate tools. The atomic query tool is used to query the knowledge graph question-and-answer results corresponding to the user's question in the pre-built knowledge graph.

[0083] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: Obtain user questions, perform semantic parsing on the user questions to obtain entity information and query intent, and perform logical analysis on the entity information and query intent to obtain an initial execution plan; According to the initial execution plan, the subgraph query tool for the entity information is invoked, and the subgraph query tool is used to query the subgraph data corresponding to the entity information in the pre-built knowledge graph. The subgraph data is linearized to obtain subgraph data text. A set of candidate entities is extracted from the subgraph data text, and target entities that semantically match the user question are selected from the set of candidate entities according to preset entity linking rules. Logical analysis is performed on the target entity and the query intent to obtain the target execution plan for the user's question, and atomic query tools that match the target execution plan are selected from a preset set of candidate tools. The atomic query tool is used to query the knowledge graph question-and-answer results corresponding to the user's question in the pre-built knowledge graph.

[0084] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0085] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0086] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0087] It should be noted that if any software tools or components not belonging to our company appear in the embodiments of this application, they are merely for illustrative purposes and do not represent actual use.

[0088] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for generating question-and-answer results for a knowledge graph, characterized in that, include: Obtain user questions, perform semantic parsing on the user questions to obtain entity information and query intent, and perform logical analysis on the entity information and query intent to obtain an initial execution plan; According to the initial execution plan, the subgraph query tool for the entity information is invoked, and the subgraph query tool is used to query the subgraph data corresponding to the entity information in the pre-built knowledge graph. The subgraph data is linearized to obtain subgraph data text. A set of candidate entities is extracted from the subgraph data text, and target entities that semantically match the user question are selected from the set of candidate entities according to preset entity linking rules. Logical analysis is performed on the target entity and the query intent to obtain the target execution plan for the user's question, and atomic query tools that match the target execution plan are selected from a preset set of candidate tools. The atomic query tool is used to query the knowledge graph question-and-answer results corresponding to the user's question in the pre-built knowledge graph.

2. The method for generating question-and-answer results for a knowledge graph as described in claim 1, characterized in that, The step of logically analyzing the entity information and the query intent to obtain the initial execution plan for the user's question includes: The entity information is extracted in a structured manner to obtain a set of structured entities, and the query intent is semantically decomposed to obtain query parameters; The structured entity set is associated and mapped with the query parameters to obtain a semantic association constraint set; A preliminary step framework for generating the user question is generated based on the set of semantic association constraints. The initial execution plan for the user problem is obtained by standardizing the execution elements of the preliminary step framework.

3. The method for generating question-and-answer results for a knowledge graph as described in claim 1, characterized in that, The step of using the subgraph query tool to query the subgraph data corresponding to the entity information in the pre-constructed knowledge graph includes: The entity information is semantically parsed to obtain the target entity variable; Using the preset subgraph query function in the subgraph query tool, a neighborhood query is performed on the target entity variable in the pre-constructed knowledge graph to obtain initial subgraph data; The initial subgraph data is filtered according to the entity association rules in the pre-constructed knowledge graph to obtain the subgraph data.

4. The method for generating question-and-answer results for a knowledge graph as described in claim 1, characterized in that, The step of selecting target entities that semantically match the user's question from the candidate entity set according to preset entity linking rules includes: Extract the subgraph path corresponding to each entity in the candidate entity set; The subgraph paths are aggregated into a set of entity association paths for the candidate entity set; Based on preset entity linking rules, semantic association analysis is performed on the entity association path set and the user question to obtain a path association score; The entity with the highest path association score is selected from the entity association path set as the target entity for semantic matching with the user question.

5. The method for generating question-and-answer results for a knowledge graph as described in claim 1, characterized in that, The step of logically analyzing the target entity and the query intent to obtain the target execution plan for the user question includes: Semantic parsing is performed on the target entity to obtain entity text features; The intent element set of the query intent is determined based on the action instructions and constraints in the query intent; Logically associate and map the entity text features with the intent element set to obtain the associated logical structure; The target execution plan for the user's problem is generated based on the associated logical structure and the preset execution constraint rules.

6. The method for generating question-and-answer results for a knowledge graph as described in claim 1, characterized in that, The step of selecting atomic query tools that match the target execution plan from a preset set of candidate tools includes: The execution preconditions in the target execution plan are logically decomposed to obtain a set of execution dependencies; By associating and integrating the tool type constraint set and the execution dependency set in the target execution plan, the tool selection criteria of the target execution plan are obtained. Based on the tool selection criteria, a functional matching degree analysis is performed on each atomic tool in the preset candidate tool set to obtain a preliminary tool candidate subset for the target execution plan; Perform execution order logic verification on the atomic tools within the preliminary tool candidate subset to obtain the tool combination for the target execution plan; The matching score of the atomic tools in the tool portfolio is calculated based on the priority weight of each execution step in the target execution plan; Atomic tools with a matching score higher than a preset matching threshold are used as atomic query tools to match the target execution plan.

7. The method for generating question-and-answer results for a knowledge graph as described in claim 1, characterized in that, The step of using the atomic query tool to query the knowledge graph question-answering results corresponding to the user's question in the pre-built knowledge graph includes: The relational query function in the atomic query tool is used to query the relational path corresponding to the user question. Based on the semantic features of the user question, the relational path is filtered for semantic relevance to obtain the target relational path. The attribute query function in the atomic query tool is used to query the entity attribute information of the user question from the pre-built knowledge graph. The target relationship path and the entity attribute information are then aggregated in a structured manner to obtain a structured knowledge fragment. The structured knowledge fragments are semantically consistent with the user questions to obtain a semantic consistency score. When the semantic verification score is lower than the preset verification score threshold, the knowledge graph question answering result corresponding to the user question is generated using the iterative function in the preset code response unit.

8. A question-and-answer result generation device for a knowledge graph, characterized in that, include: The initial execution plan generation module is used to obtain user questions, perform semantic parsing on the user questions to obtain entity information and query intent, and perform logical analysis on the entity information and query intent to obtain an initial execution plan; The subgraph data query module is used to call the subgraph query tool of the entity information according to the initial execution plan, and use the subgraph query tool to query the subgraph data corresponding to the entity information in the pre-built knowledge graph. The target entity filtering module is used to linearize the subgraph data to obtain subgraph data text, extract a set of candidate entities from the subgraph data text, and filter out target entities that semantically match the user question from the set of candidate entities according to preset entity linking rules. The atomic query tool filtering module is used to perform logical analysis on the target entity and the query intent to obtain the target execution plan of the user question, and to filter out atomic query tools that match the target execution plan from a preset candidate tool set. The knowledge graph question-and-answer result query module is used to query the knowledge graph question-and-answer results corresponding to the user's question in the pre-built knowledge graph using the atomic query tool.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the question-answering result generation method for the knowledge graph as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the question-answering result generation method for the knowledge graph as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Conference schedule-based information interaction method and device, medium and electronic equipment

    CN121210646A

  • Method, device, medium and electronic equipment for information interaction based on meeting schedule

    CN121210646B

  • Information enhancement retrieval method and system based on large model and vector knowledge base

    CN121256108A

  • Information retrieval method and system based on large model and vector knowledge base

    CN121256108B

  • Intelligent question answering and traceability analysis system and method based on structured enterprise data

    CN121301380A