A multi-round knowledge-guided question answering method and system integrating a large language model and knowledge graph

By integrating a large language model and a multi-round knowledge-guided question-answering method with knowledge graphs, the problem of inaccurate user demand analysis in complex fields by traditional question-answering systems is solved, and accurate question-answering in the field of social security policies and regulations is achieved.

CN120069068BActive Publication Date: 2025-09-09GUANGZHOU SEMANTIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510126681.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-27
Publication Date
2025-09-09
Estimated Expiration
2045-01-27

AI Technical Summary

Technical Problem

Traditional question-answering systems have difficulty accurately understanding user needs and providing accurate answers in multi-round question-answering scenarios, especially in complex areas such as social security policies and regulations.

Method used

By integrating large language models and knowledge graphs, and building hierarchical knowledge graphs and pre-trained models, it conducts semantic parsing, retrieval, and clarification processes, dynamically tracks user intent, and generates accurate answers.

Benefits of technology

It achieves the goal of gradually approaching user intentions in multiple rounds of question and answering, improves the accuracy and reliability of question and answering in complex fields, and is applicable to areas such as social security policies and regulations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120069068B_ABST
    Figure CN120069068B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-round knowledge-guided question-answering method and system that integrates a large language model and a knowledge graph. The method includes: S1, constructing a knowledge graph; S2, retrieval and clarification; S3, label extraction and question classification; S4, scenario guidance and dynamic retrieval; S5, answer generation and formatted output. The present invention aims to solve the fuzzy problems in complex policy and regulatory questions and answers, and improve the accuracy of user demand analysis and the comprehensiveness of answers. The method takes the knowledge graph as the core, and provides multi-path semantic parsing and question guidance capabilities by constructing a hierarchical structure covering primary matters, secondary matters, scenario categories and keyword nodes. Combined with the powerful semantic understanding and generation capabilities of the pre-trained large language model, the system can dynamically track the contextual information in the user input, iteratively access related nodes along different paths of the knowledge graph, and gradually clarify the user's intentions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a multi-round knowledge-guided question-answering method and system that integrates a large language model and a knowledge graph. Background Art

[0002] With the rapid development of information technology, people's demand for information is growing, and question-answering systems have garnered widespread attention as a convenient tool for information exchange. Traditional question-answering systems often rely on a single source of knowledge or technical means, and thus have numerous limitations. For example, while question-answering systems based solely on knowledge graphs can accurately utilize structured knowledge to provide answers, they are relatively weak in semantic understanding and natural language generation. Question-answering systems that rely solely on large language models, while performing well in language understanding and generation, may be unable to extract users' true needs due to untimely knowledge updates or a lack of structured knowledge support. This results in poor accuracy and reliability in answers, making them unsuitable for question-answering in complex domains. These issues are even more pronounced in multi-round question-answering scenarios, where the gradual refinement of user needs and the requirement for contextual coherence pose even greater challenges to question-answering systems. Summary of the Invention

[0003] In response to the problems of the existing technology, the purpose of the present invention is to provide a multi-round knowledge-guided question-answering method and system that integrates a large language model and a knowledge graph. Through the deep integration of the path guidance capability of the knowledge graph and the semantic capability of the pre-trained large language model, it is possible to iteratively extract the user's real needs in multiple rounds, approach the user's ultimate intention layer by layer, and achieve accurate answers to complex questions. It also has high efficiency and scalability, and is suitable for intelligent question-answering in complex fields such as social security policies and regulations.

[0004] In order to achieve the above objectives, the present invention provides the following technical solutions:

[0005] The present invention provides a multi-round knowledge-guided question-answering method that integrates a large language model and a knowledge graph, comprising:

[0006] S1. Build a knowledge graph: Perform semantic parsing and hierarchical processing on the input document content, extracting and annotating the first-level items, second-level items, scenario categories, relevant keywords, and corresponding knowledge questions and answers in the document; through the entity alignment and relationship extraction modules, the extracted content is constructed into a knowledge graph with a hierarchical structure;

[0007] S2. Retrieval and clarification: Based on user input, semantic analysis is performed using a pre-trained large language model. Hybrid retrieval is performed in combination with the knowledge graph and knowledge base built in step S1. If the retrieval results are unclear, the clarification process is triggered.

[0008] S3. Label extraction and question classification: The label extraction module extracts primary issues, secondary issues, scenario categories, and keywords from the user input in step S2, and classifies and processes questions based on the extraction results.

[0009] S4, scenario guidance and dynamic retrieval: Based on the knowledge graph constructed in step S1 and the tag information extracted in step S3, the details of the scenario category are determined, the retrieval conditions are dynamically generated, and the knowledge base is further accurately queried;

[0010] S5. Answer generation and formatted output: Combining the context information obtained in steps S1 to S4, the retrieval augmentation generation (RAG) module uses the pre-trained large language model to generate answers, and the formatting module optimizes the answer output.

[0011] In step S1, the hierarchical knowledge graph includes knowledge label item paths, knowledge questions, knowledge question vectors, knowledge answers and knowledge answer vectors.

[0012] In a possible implementation, in step S1, the specific process of entity alignment and relationship extraction is as follows:

[0013] S11, input document content D = {d1, d2, ..., d n}Perform text cleaning and contextual semantic enhancement to convert it into a standardized text representation; Based on the sentence embedding model E s , generate a vectorized representation v for each sentence in the document i =E s (d i ), used for subsequent entity and relationship analysis; for the document question and answer part, the extraction model K(z) is used to extract the set K Q and K A , ensuring the accuracy of question-answering knowledge extraction;

[0014] S12. Use a relation extraction method based on a pre-trained large language model to construct entity and relationship prompt templates. Analyze the document context and use a combination of semantic parsing and nested hierarchical extraction to build a hierarchical knowledge graph, including:

[0015] S121, first-level item node T1: extract the main items or topics involved in the document and represent them as a node set These nodes typically represent high-level policy categories or areas;

[0016] S122, Secondary matter node T2: further refine the context of the primary matter, extract the secondary matter, and form a set of child nodes associated with the primary matter To express detailed content more accurately;

[0017] S123, scene category node S: According to the description of the document and the application background, extract the scene-related node set S = {s1, s2, ..., s k}, used to represent the usage scenario of knowledge;

[0018] S124, keyword node K: extract the core keyword K in the document = {k1, k2, ..., k p} and associate it with the relevant first-level matters, second-level matters and scenario category nodes.

[0019] In a possible implementation, in step S1, the specific process of constructing the knowledge graph is as follows:

[0020] 1. Leverage pre-trained large language models Deeply analyze the semantics of the document sentence level and generate context vector representation Combined with syntactic analysis model Extract hierarchical entity nodes and their relationships;

[0021] 2. Design a recursive relation extraction function RelExtract(·) to associate the first-level node T1 with the keywords and second-level nodes in its context:

[0022]

[0023] Among them, Rih represents the relationship type between the first-level matters and the second-level matters;

[0024] 3. The extraction of scene category node S is done through context nesting analysis, combined with the association probability P(s|t i , k j ), generating a scene branch structure of a hierarchical graph;

[0025] Ultimately, all nodes and relationships will be organized into a hierarchical knowledge graph in the following form:

[0026] G=(N,E), N=T1∪T2∪S∪K, E={(n i , n j , R ij )|n i , n j ∈N}, (2)

[0027] Among them, N is the node set, E is the relationship set between nodes, R ij Represents the relationship between any two nodes;

[0028] The construction process can dynamically generate hierarchical nodes and relationships based on the document content, ensuring the accuracy and scalability of the knowledge graph and providing structured semantic support for subsequent retrieval and clarification (step S2).

[0029] In step S2, the clarification process includes first-level label matters clarification, second-level label matters clarification, scenario guidance clarification and refusal process.

[0030] In a possible implementation, in step S2, the specific process of semantic parsing is:

[0031] S211, User Input Vectorization:

[0032] Questions Q entered by the user u , using a pre-trained large language model to generate embedding vectors Generated by the following formula:

[0033]

[0034] Where, Embedding(·,θ) represents the semantic embedding generation function, and θ is the model parameter;

[0035] If the user input involves multiple rounds of context, the current input is combined with the historical conversation content to generate a context semantic vector by splicing

[0036]

[0037] Among them, H t-1 Represents the previous round of dialogue history;

[0038] S212, using the semantic structure information of the knowledge graph G = (N, E) constructed in step S12, the user input And the node embedding vector in the constructed knowledge graph G Perform preliminary matching and calculate the similarity of each node:

[0039]

[0040] According to the similarity threshold τ1, a set of high-correlation nodes is extracted Including first-level matters T1, second-level matters T2, scenario category C s and keyword K;

[0041] Preliminarily determine the knowledge nodes related to user input and their association relationships to provide a basis for subsequent retrieval modules.

[0042] In a possible implementation, in step S2, the specific process of searching is as follows:

[0043] S221, High Confidence Fast Matching:

[0044] If, in the node set N matched by the knowledge graph, nodes with similar vectors are retrieved through Elasticsearch's k-NN, and the similarity of the key question in a certain node is Sim ≥ 0.98 or the rerank relevance of the answer is Rerank ≥ 0.95, the relevant document is directly called as the preliminary answer and enters the formatting module, skipping the clarification process;

[0045] S222, Vector Search Extension:

[0046] If the high confidence node is not hit, use the knowledge graph in step S1 and the embedding vector of the user question Construct search conditions:

[0047] Q r =ConstructQuery(T1, T2, C s , K), (6)

[0048] Among them, Q r It is a search condition dynamically generated by combining knowledge graph nodes and is used to call external vector search (such as Elasticsearch's k-NN search);

[0049] Retrieve the candidate document set D and score the relevance of the candidate documents through the reranking module to filter out low-relevance documents:

[0050] D filtered ={d|RelScore(d)≥τ2, d∈D}, (7)

[0051] Among them, D filtered is the retrieved knowledge document; d is a single knowledge document, belonging to the original knowledge document set D filtered An element in ; RelScore is the document relevance score, which indicates the degree of match between d and the user query, usually calculated by some vector similarity, such as cosine similarity or dot product; τ2 is the threshold for setting similarity or relevance;

[0052] S223, Prompt build:

[0053] Use the matched node information in the knowledge graph (such as first-level matters, scene categories, etc.) and D filtered , build Prompt, and call the pre-trained large language model to generate the preliminary answer A raw .

[0054] In a possible implementation, in step S2, the specific process of triggering the clarification process is:

[0055] S231, trigger conditions:

[0056] If D filtered Empty, or the initial answer is A raw The uncertainty of (according to the confidence of the generative model) is higher than the threshold α, triggering the clarification process;

[0057] S232, clarification question generation:

[0058] Based on the knowledge graph nodes and relationships in step S1, generate clarification questions:

[0059] 1. If the first-level item T1 is unclear, first search all first-level labeled items and the knowledge graph currently obtained based on the facts, and generate clarification questions for T1 using the pre-trained large language model;

[0060] 2. If the second-level item T2 is unclear, first search all second-level labeled items and the knowledge graph obtained based on the facts, and generate clarification questions for T2 using the pre-trained large language model;

[0061] 3. If the keyword set K is incomplete, generate clarification questions for the keywords;

[0062] S233, User Interaction and Update:

[0063] Send clarification questions to the user, receive user feedback, and update the current session context and knowledge graph node set;

[0064] S234, Re-search after clarification:

[0065] Re-execute the search process based on user feedback until all key nodes are clarified or the rejection process is triggered.

[0066] In step S3, the problem of classification and processing according to the extraction results refers to filling in the word slots extracted by the user, determining which type of elements are missing, and performing a reverse questioning process based on the specific missing elements.

[0067] In a possible implementation, in step S3, the specific process of label extraction is as follows:

[0068] S311. Input data:

[0069] Enter the question Q entered by the user u , retrieved knowledge documents D filtered , clarified context information C u and knowledge graph G;

[0070] S312, label extraction process:

[0071] Use the large model-based tag extraction method to generate a tag extraction prompt:

[0072] P extract =ConstructPrompt(Q u , C u , D filtered , G), (8)

[0073] Among them, P extract is the final Prompt extracted, which is represented by a specific task description generated by combining user query and context information, and is used to guide the pre-trained large model to generate answers;

[0074] Prompt contains: user questions, context, search results and knowledge graph node information;

[0075] The following information is extracted from Prompt using a pre-trained large language model:

[0076] First-level item T1: the first-level node label set most relevant to the user's question;

[0077] Secondary item T2: A specific sub-node label set further defined on the basis of T1;

[0078] Scenario Category C s : A classification label describing the semantic context of the question;

[0079] Keyword K: A set of words that are highly relevant to the user's question;

[0080] S313, label identification generation:

[0081] Encapsulate the extraction results into a tag structure Tags:

[0082] Tags = {T1, T2, C s , K}, (9)

[0083] S314, Multi-factor Authentication:

[0084] Use the knowledge graph G to verify the extracted tags:

[0085] If T1 or T2 does not exist in the knowledge graph G, trigger the tag completion process (return to the clarification module in step S2);

[0086] If the extracted label is ambiguous: confidence Conf<τ3, a clarification hint is generated to obtain more explicit information.

[0087] In a possible implementation, in step S3, the specific process of classifying and processing the problem is as follows:

[0088] S321. Classification rules:

[0089] Based on the extracted tag information Tags, user questions are divided into the following categories:

[0090] 1. Direct answer type: Label extraction is complete and clear, and answers in the knowledge graph or retrieval documents can be directly matched;

[0091] 2. Clarification Requirement: Label extraction is incomplete (e.g., missing primary or secondary items) and requires further clarification.

[0092] 3. Dynamic search: The labels are clear, but the search needs to be refined by combining scene categories and keywords;

[0093] S322, classification and discrimination formula:

[0094] Use classification models or rules to determine:

[0095]

[0096] Among them, Complete(Tags) indicates whether the tags are complete; When the scene category C s Or whether the keyword K is an empty set, that is, no label is extracted;

[0097] S323, classification output:

[0098] Adjust the subsequent process based on the classification results:

[0099] 1. For direct answer questions, enter the Retrieval Enhanced Generation (RAG) module to generate answers;

[0100] 2. For clarification needs, return to step S2 and enter the clarification question and answer process to supplement the missing information;

[0101] 3. For dynamic retrieval type, the Tags structure (including first-level matters, second-level matters, scenario categories and keywords) is used as the input of the scenario guidance in step S4 to perform scenario guidance and dynamic retrieval.

[0102] In step S4, the retrieval condition is dynamically generated based on the lack of the scenario guidance type, and the corresponding reference clarification words are dynamically retrieved based on the scenario type to ask questions in order to accurately extract the user's specific scenario guidance details.

[0103] In a possible implementation, in step S4, the specific process is:

[0104] S41. Scene condition initialization and dynamic expansion

[0105] S411, input initialization:

[0106] Get the tags T1, T2, C extracted in step S3 s, K and preliminary retrieval results D filtered ;

[0107] Load nodes and context information related to the current session from the knowledge graph G;

[0108] S412, Conditional Extension:

[0109] If some tags are missing, such as T2 or C s , then dynamically call the knowledge graph for conditional expansion:

[0110] Find the set of possible labels associated with T1 or K:

[0111]

[0112] Will Incorporate into the scenario derivation process;

[0113] S413. Generate dynamic search conditions:

[0114] Initial conditions:

[0115]

[0116] Condition optimization:

[0117] Use search history and feedback to refine your criteria, such as increasing the priority of specific tags:

[0118] Q optimized =Q init +{"boost": TagsPriority(T1, T2)}, (13)

[0119] S42. Dynamic retrieval execution and feedback iteration

[0120] S421, Preliminary Search:

[0121] Based on Q optimized And the Elasticsearch configuration to perform the search:

[0122] D scene =Elasticsearch(Q optimized ), (14)

[0123] The returned results are sorted by relevance score, and D filtered :

[0124] D filtered =TopN(D scene , N=10,score>0.8), (15)

[0125] S422, Feedback Iteration:

[0126] Generate a question prompt for pending tags:

[0127]

[0128] S423, Dynamically Supplement Pending Tags:

[0129] For unspecified C s , search for relevant words in the knowledge graph G;

[0130]

[0131] Use words to clarify the scene category until C s Explicit or user termination of the session;

[0132] S43. Scene refinement and label confirmation

[0133] S431, tag confirmation logic:

[0134] If T1, T2 and K are clear, but C s Unresolved, use the following logic to refine;

[0135] 1. If C s The number of candidate items is 1, which is directly confirmed as the final label:

[0136]

[0137] 2. If there are more than 1 candidate items, dynamically generate a clarification option prompt:

[0138]

[0139] Prompt the user to make a choice;

[0140] S432, Tag Priority Sorting:

[0141] Based on contextual information and user feedback, prioritize tags to guide subsequent processes; S44, confirm output and multiple rounds of optimization

[0142] S441. Result output:

[0143] Output the final determined label set T1, T2, K and accurate retrieval results D final ;

[0144] Ensure D final After filtering, the content is highly relevant to the current context;

[0145] S442, connect with subsequent modules:

[0146] Provide the answer generation for step S5:

[0147] 1. Complete scene categories

[0148] 2. High-quality knowledge document collection D final ;

[0149] 3. The pending tag is used as feedback and returns to step S3 to form a closed loop.

[0150] In a possible implementation, in step S5, the specific process is:

[0151] S51. Answer Generation

[0152] S511, context integration;

[0153] According to the final scene category, first-level items, second-level items and keyword information obtained in step S4, combined with the user's historical input and current question, the context information C is constructed. user ;

[0154] S512, Knowledge Retrieval Integration:

[0155] The knowledge document K retrieved from step S4 retrieved As external knowledge support, and context information C user Input them together into the search enhancement generation module to construct the generative formula PromptP RAG :

[0156] P RAG =f(C user , K retrieved ), (20)

[0157] Generate a preliminary answer A through a pre-trained large language model raw ;

[0158] The pre-trained large language model uses Qwen2.5, with 72B parameters;

[0159] S52. Answer optimization

[0160] S521, consistency check:

[0161] The preliminary answer A generated by the comparison raw Ensure that the answer logic is consistent with the knowledge base and the paths and nodes in the knowledge graph; for parts that deviate from the knowledge graph, trigger supplementary search and iteratively optimize the generated answer;

[0162] S522, formatting:

[0163] The initial answer A rawInput the formatting module, optimize its language fluency, structural clarity and professional terminology, and output the final answer A final ;

[0164] S53. Answer output

[0165] The system will give the final answer A final The answer is returned to the user with interactive prompt information, allowing the user to initiate further clarification or modification requests for the generated answer, thus realizing a circular knowledge question and answer.

[0166] The present invention also provides a multi-round knowledge-guided question-answering system that integrates a large language model and a knowledge graph, including an entity alignment and relationship extraction module, a semantic parsing module, a retrieval module, a clarification question-answering module, a label extraction module, a question classification module, a scenario guidance and dynamic retrieval module, and an answer generation and formatted output module.

[0167] The beneficial technical effects of the present invention are:

[0168] (1) The present invention provides a multi-round knowledge-guided question-answering method that integrates a large language model and a knowledge graph, aiming to resolve ambiguous issues in complex policy and regulatory questions and answers, and to improve the accuracy of user demand analysis and the comprehensiveness of answers. This method takes the knowledge graph as its core and provides multi-path semantic parsing and question guidance capabilities by constructing a hierarchical structure covering primary matters, secondary matters, scenario categories, and keyword nodes. Combined with the powerful semantic understanding and generation capabilities of the pre-trained large language model, the system can dynamically track the contextual information in the user input, iteratively access relevant nodes along different paths of the knowledge graph, and gradually clarify the user's intentions.

[0169] (2) The present invention provides a multi-round knowledge-guided question-answering system that integrates a large language model and a knowledge graph. User input is matched with the knowledge graph through a deep semantic parsing module, triggering a dynamic retrieval or intention clarification process; the label extraction module extracts key semantic information and constructs multi-dimensional question labels; the clarification module combines the knowledge graph path with the pre-trained large language model to generate intelligent rhetorical questions, gradually guiding the user to provide more clear input; in multiple rounds of dialogue, the context and relevant knowledge nodes are dynamically combined to generate accurate answers that conform to semantic logic. BRIEF DESCRIPTION OF THE DRAWINGS

[0170] Figure 1 It is the system flow chart;

[0171] Figure 2 Store the structure for the knowledge graph;

[0172] Figure 3 To popularize the accurate recognition effect example diagram (application example 1);

[0173] Figure 4An example diagram of the effect of rhetorical questioning to guide fuzzy intentions (Application Example 2);

[0174] Figure 5 This is an example diagram of the actual application effect in the production environment (Application Example 3);

[0175] Figure 6 This is an example diagram of the actual application effect in the production environment (Application Example 4);

[0176] Figure 7 This is an example diagram of the actual application effect in the production environment (Application Example 5). DETAILED DESCRIPTION

[0177] The technical solution of the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0178] Example

[0179] Reference Attachment Figures 1-2 , a multi-round knowledge-guided question answering method that integrates a large language model and a knowledge graph, including the following steps:

[0180] Step 1: Construct a knowledge graph: Perform semantic parsing and hierarchical processing on the input document content, extracting and annotating the first-level items, second-level items, scenario categories, relevant keywords, and corresponding knowledge questions and answers in the document; construct the extracted content into a knowledge graph with a hierarchical structure through the entity alignment and relationship extraction module; the hierarchical knowledge graph includes knowledge label item paths, knowledge questions, knowledge question vectors, knowledge answers, and knowledge answer vectors;

[0181] The specific process of entity alignment and relationship extraction is as follows:

[0182] S11, input document content D = {d1, d2, ..., d n}Perform text cleaning and contextual semantic enhancement to convert it into a standardized text representation; Based on the sentence embedding model E s , generate a vectorized representation v for each sentence in the document i =E s (d i ), used for subsequent entity and relationship analysis; for the document question and answer part, the extraction model K(z) is used to extract the set K Q and K A , ensuring the accuracy of question-answering knowledge extraction;

[0183] S12. Use a relation extraction method based on a pre-trained large language model to construct entity and relationship prompt templates. Analyze the document context and use a combination of semantic parsing and nested hierarchical extraction to build a hierarchical knowledge graph, including:

[0184] S121, first-level item node T1: extract the main items or topics involved in the document and represent them as a node set These nodes typically represent high-level policy categories or areas;

[0185] S122, Secondary matter node T2: further refine the context of the primary matter, extract the secondary matter, and form a set of child nodes associated with the primary matter To express detailed content more accurately;

[0186] S123, scene category node S: According to the description of the document and the application background, extract the scene-related node set S = {s1, s2, ..., s k}, used to represent the usage scenario of knowledge;

[0187] S124, keyword node K: extract the core keyword K in the document = {k1, k2, ..., k p}, and associate it with the relevant first-level matters, second-level matters and scenario category nodes;

[0188] The specific process of building a knowledge graph is as follows:

[0189] 1. Leverage pre-trained large language models Deeply analyze the semantics of the document sentence level and generate context vector representation Combined with syntactic analysis model Extract hierarchical entity nodes and their relationships;

[0190] 2. Design a recursive relation extraction function RelExtract(·) to associate the first-level node T1 with the keywords and second-level nodes in its context:

[0191]

[0192] Among them, Rij represents the relationship type between the first-level matters and the second-level matters;

[0193] 3. The extraction of scene category node S is done through context nesting analysis, combined with the association probability P(s|t i , k j ), generating a scene branch structure of a hierarchical graph;

[0194] Ultimately, all nodes and relationships will be organized into a hierarchical knowledge graph in the following form:

[0195] G=(N,E), N=T1∪T2∪S∪K, E={(n i , n j , R ij )|n i , n j∈N}, (2)

[0196] Among them, N is the node set, E is the relationship set between nodes, R ij Represents the relationship between any two nodes;

[0197] The construction process can dynamically generate hierarchical nodes and relationships based on the document content, ensuring the accuracy and scalability of the knowledge graph and providing structured semantic support for subsequent retrieval and clarification (step 2);

[0198] Step 2: Search and Clarification: Based on user input, semantic analysis is performed using a pre-trained large language model. Hybrid search is performed in conjunction with the knowledge graph and knowledge base constructed in Step 1. If the search results are unclear, a clarification process is triggered. The clarification process includes clarification of first-level label matters, clarification of second-level label matters, scenario-guided clarification, and a refusal process.

[0199] The specific process of semantic parsing is as follows:

[0200] S211, User Input Vectorization:

[0201] Questions Q entered by the user u , using a pre-trained large language model to generate embedding vectors Generated by the following formula:

[0202]

[0203] Where, Embedding(·,θ) represents the semantic embedding generation function, and θ is the model parameter;

[0204] If the user input involves multiple rounds of context, the current input is combined with the historical conversation content to generate a context semantic vector by splicing

[0205]

[0206] Among them, H t-1 Represents the previous round of dialogue history;

[0207] S212, using the semantic structure information of the knowledge graph G = (N, E) constructed in step 12, the user input And the node embedding vector in the constructed knowledge graph G Perform preliminary matching and calculate the similarity of each node:

[0208]

[0209] According to the similarity threshold τ1, a set of high-correlation nodes is extracted Including first-level matters T1, second-level matters T2, scenario category Cs and keyword K;

[0210] Preliminarily determine the knowledge nodes and their relationships related to user input to provide a basis for subsequent retrieval modules;

[0211] The specific process of retrieval is as follows:

[0212] S221, High Confidence Fast Matching:

[0213] If, in the node set N matched by the knowledge graph, nodes with similar vectors are retrieved through Elasticsearch's k-NN, and the similarity of the key question in a certain node is Sim ≥ 0.98 or the rerank relevance of the answer is Rerank ≥ 0.95, the relevant document is directly called as the preliminary answer and enters the formatting module, skipping the clarification process;

[0214] S222, Vector Search Extension:

[0215] If the high confidence node is not hit, use the knowledge graph in step 1 and the embedding vector of the user question Construct search conditions:

[0216] Q r =ConstructQuery(T1, T2, C s , K), (6)

[0217] Among them, Q r It is a search condition dynamically generated by combining knowledge graph nodes and is used to call external vector search (such as Elasticsearch's k-NN search);

[0218] Retrieve the candidate document set D and score the relevance of the candidate documents through the reranking module to filter out low-relevance documents:

[0219] D filtered ={d|RelScore(d)≥τ2, d∈D}, (7)

[0220] Among them, D filtered is the retrieved knowledge document; d is a single knowledge document, belonging to the original knowledge document set D filtered An element in ; RelScore is the document relevance score, which indicates the degree of match between d and the user query, usually calculated by some vector similarity, such as cosine similarity or dot product; τ2 is the threshold for setting similarity or relevance;

[0221] S223, Prompt build:

[0222] Use the matched node information in the knowledge graph (such as first-level matters, scene categories, etc.) and Dfiltered , build Prompt, and call the pre-trained large language model to generate the preliminary answer A raw ;

[0223] The specific process of triggering the clarification process is as follows:

[0224] S231, trigger conditions:

[0225] If D filtered Empty, or the initial answer is A raw The uncertainty of (according to the confidence of the generative model) is higher than the threshold α, triggering the clarification process;

[0226] S232, clarification question generation:

[0227] Based on the knowledge graph nodes and relationships in step 1, generate clarification questions:

[0228] 1. If the first-level item T1 is unclear, first search all first-level labeled items and the knowledge graph currently obtained based on the facts, and generate clarification questions for T1 using the pre-trained large language model;

[0229] 2. If the second-level item T2 is unclear, first search all second-level labeled items and the knowledge graph obtained based on the facts, and generate clarification questions for T2 using the pre-trained large language model;

[0230] 3. If the keyword set K is incomplete, generate clarification questions for the keywords;

[0231] S233, User Interaction and Update:

[0232] Send clarification questions to the user, receive user feedback, and update the current session context and knowledge graph node set;

[0233] S234, Re-search after clarification:

[0234] Re-execute the search process based on user feedback until all key nodes are clear or the rejection process is triggered;

[0235] Step 3: Label extraction and question classification: The label extraction module extracts primary items, secondary items, scenario categories, and keywords from the user input in step 2, and classifies and processes questions based on the extraction results. Classifying and processing questions based on the extraction results means filling in the word slots extracted by the user, determining which type of elements are missing, and then conducting a counter-questioning process based on the specific missing elements.

[0236] The specific process of label extraction is as follows:

[0237] S311. Input data:

[0238] Enter the question Q entered by the user u , retrieved knowledge documents D filtered , clarified context information C u and knowledge graph G;

[0239] S312, label extraction process:

[0240] Use the large model-based tag extraction method to generate a tag extraction prompt:

[0241] P extract =ConstructPrompt(Q u , C u , D filtered , G), (8)

[0242] Among them, P extract is the final Prompt extracted, which is represented by a specific task description generated by combining user query and context information, and is used to guide the pre-trained large model to generate answers;

[0243] Prompt contains: user questions, context, search results and knowledge graph node information;

[0244] The following information is extracted from Prompt using a pre-trained large language model:

[0245] First-level item T1: the first-level node label set most relevant to the user's question;

[0246] Secondary item T2: A specific sub-node label set further defined on the basis of T1;

[0247] Scenario Category C s : A classification label describing the semantic context of the question;

[0248] Keyword K: A set of words that are highly relevant to the user's question;

[0249] S313, label identification generation:

[0250] Encapsulate the extraction results into a tag structure Tags:

[0251] Tags = {T1, T2, C s , K}, (9)

[0252] S314, Multi-factor Authentication:

[0253] Use the knowledge graph G to verify the extracted tags:

[0254] If T1 or T2 does not exist in the knowledge graph G, trigger the tag completion process (return to the clarification module in step 2);

[0255] If the extracted label is ambiguous: confidence Conf<τ3, generate clarification hints to obtain more clear information;

[0256] The specific process of classification problem solving is as follows:

[0257] S321. Classification rules:

[0258] Based on the extracted tag information Tags, user questions are divided into the following categories:

[0259] 1. Direct answer type: Label extraction is complete and clear, and answers in the knowledge graph or retrieval documents can be directly matched;

[0260] 2. Clarification Requirement: Label extraction is incomplete (e.g., missing primary or secondary items) and requires further clarification.

[0261] 3. Dynamic search: The labels are clear, but the search needs to be refined by combining scene categories and keywords;

[0262] S322, classification and discrimination formula:

[0263] Use classification models or rules to determine:

[0264]

[0265] Among them, Complete(Tags) indicates whether the tags are complete; When the scene category C s Or whether the keyword K is an empty set, that is, no label is extracted;

[0266] S323, classification output:

[0267] Adjust the subsequent process based on the classification results:

[0268] 1. For direct answer questions, enter the Retrieval Enhanced Generation (RAG) module to generate answers;

[0269] 2. For clarification requests, return to step 2 and enter the clarification Q&A process to supplement the missing information.

[0270] 3. For dynamic search, the Tags structure (including first-level items, second-level items, scenario categories, and keywords) is used as the input for scenario guidance in step 4, and scenario guidance and dynamic search are performed;

[0271] Step 4: Scenario Guidance and Dynamic Retrieval: Based on the knowledge graph constructed in Step 1 and the tag information extracted in Step 3, the details of the scenario category are determined, and retrieval conditions are dynamically generated to conduct further precise queries on the knowledge base. Dynamic retrieval conditions are generated based on the lack of scenario guidance types. Based on the scenario type, corresponding reference clarification words are dynamically retrieved and counter-questions are conducted to accurately extract the user's specific scenario guidance details.

[0272] S41. Scene condition initialization and dynamic expansion

[0273] S411, input initialization:

[0274] Get the labels T1, T2, C extracted in step 3 s , K and preliminary retrieval results D filtered ;

[0275] Load nodes and context information related to the current session from the knowledge graph G;

[0276] S412, Conditional Extension:

[0277] If some tags are missing, such as T2 or C s , then dynamically call the knowledge graph for conditional expansion:

[0278] Find the set of possible labels associated with T1 or K:

[0279]

[0280] Will Incorporate into the scenario derivation process;

[0281] S413. Generate dynamic search conditions:

[0282] Initial conditions:

[0283]

[0284] Condition optimization:

[0285] Use search history and feedback to refine your criteria, such as increasing the priority of specific tags:

[0286] Q optimized =Q init +{"boost": TagsPriority(T1, T2)}, (13)

[0287] S42. Dynamic retrieval execution and feedback iteration

[0288] S421, Preliminary Search:

[0289] Based on Q optimizedAnd the Elasticsearch configuration to perform the search:

[0290] D scene =Elasticsearch(Q optimized ), (14)

[0291] The returned results are sorted by relevance score, and D filtered :

[0292] D filtered =TopN(D scene , N=10,score>0.8), (15)

[0293] S422, Feedback Iteration:

[0294] Generate a question prompt for pending tags:

[0295]

[0296] S423, Dynamically Supplement Pending Tags:

[0297] For unspecified C s , search for relevant words in the knowledge graph G;

[0298]

[0299] Use words to clarify the scene category until C s Explicit or user termination of the session;

[0300] S43. Scene refinement and label confirmation

[0301] S431, tag confirmation logic:

[0302] If T1, T2 and K are clear, but C s Unresolved, use the following logic to refine;

[0303] 1. If C s The number of candidate items is 1, which is directly confirmed as the final label:

[0304]

[0305] 2. If there are more than 1 candidate items, dynamically generate a clarification option prompt:

[0306]

[0307] Prompt the user to make a choice;

[0308] S432, Tag Priority Sorting:

[0309] Based on contextual information and user feedback, tags are prioritized to guide subsequent processes;

[0310] S44. Confirm output and multiple rounds of optimization

[0311] S441. Result output:

[0312] Output the finalized label set T1, T2, K and accurate retrieval results D final ;

[0313] Ensure D final After filtering, the content is highly relevant to the current context;

[0314] S442, connect with subsequent modules:

[0315] Generate the answer for step 5:

[0316] 1. Complete scene categories

[0317] 2. High-quality knowledge document collection D final ;

[0318] 3. The pending tag is used as feedback and returns to step 3 to form a closed loop;

[0319] Step 5: Answer generation and formatted output: Combining the context information obtained in steps 1 to 4, the Retrieval Augmentation Generation (RAG) module uses the pre-trained large language model to generate answers, and the formatting module optimizes the answer output.

[0320] S51. Answer Generation

[0321] S511, context integration;

[0322] Based on the final scenario category, first-level items, second-level items, and keyword information obtained in step 4, combined with the user's historical input and current question, the context information C is constructed. user ;

[0323] S512, Knowledge Retrieval Integration:

[0324] The knowledge document K retrieved from step 4 retrieved As external knowledge support, and context information C user Input them together into the retrieval enhancement generation module to construct the generative formula Prompt P RAG :

[0325] P RAG =f(C user , K retrieved ), (20)

[0326] Generate a preliminary answer A through a pre-trained large language model raw ;

[0327] The pre-trained large language model uses Qwen2.5, with 72B parameters;

[0328] S52. Answer optimization

[0329] S521, consistency check:

[0330] The preliminary answer A generated by the comparison raw Ensure that the answer logic is consistent with the knowledge base and the paths and nodes in the knowledge graph; for parts that deviate from the knowledge graph, trigger supplementary search and iteratively optimize the generated answer;

[0331] S522, formatting:

[0332] The initial answer A raw Input the formatting module, optimize its language fluency, structural clarity and professional terminology, and output the final answer A final ;

[0333] S53. Answer output

[0334] The system will give the final answer A final The answer is returned to the user with interactive prompt information, allowing the user to initiate further clarification or modification requests for the generated answer, thus realizing a circular knowledge question and answer.

[0335] Application Example 1

[0336] When querying complex policy documents, users often express their needs in colloquial language (e.g., unemployment benefits in social security policies). Traditional systems struggle to directly understand this type of natural language. However, this invention combines knowledge graphs with large language models to accurately identify user intent.

[0337] Figure 3 This diagram illustrates the effectiveness of accurate recognition for popular expressions. It demonstrates how, after a user enters a popular question, the system can capture the user's intent through the user's unformatted question. It also demonstrates how the system leverages the knowledge graph and semantic parsing module to map the user's natural language to specific first-level items, second-level items, and keyword nodes. Documents are filtered using formula (4) (semantic similarity calculation), and the search results are optimized using formula (7), ultimately generating accurate answers.

[0338] Actual effect:

[0339] When a user asks, "I came here from another province to work. I was recently fired by the company. Can I get any unemployment benefits?", the system successfully maps the question in popular language to the "Unemployment Insurance-Unemployment Insurance Benefit Application-Non-local Household Registration-Unemployed Person" node. When the citizen's popular question information is relatively comprehensive, the first-level matter label and the second-level matter label can be extracted, but the scenario guidance still lacks a condition. At this time, the system will clarify and ask, "Did you participate in unemployment insurance as an enterprise employee or as a flexible employment person before?" At this time, the system determines that the necessary nodes for scenario guidance have been completed and generates a clear policy interpretation.

[0340] Application Example 2

[0341] When the user's question is unclear (e.g., "pension insurance question"), the system needs to guide the user to clarify their specific needs (e.g., business type, application requirements). Traditional search methods are easily ineffective in this scenario, but this invention accurately clarifies the user's intention through a dynamically generated rhetorical question mechanism.

[0342] Figure 4 This diagram shows an example of the effect of fuzzy intent-guided rhetorical questions. It shows that after a user enters a fuzzy question, the system triggers a first-level clarification based on the knowledge graph and clarification module (e.g., "To better assist you, would you like to know the application procedures for pension insurance, unemployment insurance, or work-related injury insurance?"). Dynamic search conditions are constructed by formulas (5) and (8), gradually guiding users to clarify their needs.

[0343] Actual effect:

[0344] The user initially inputs "I want to apply for social security." In the first round of dialogue, the citizen's question is vague, and the extracted first-level label is social security, but the second-level label and scenario guidance are unknown. In the second round of dialogue, the citizen further clarifies the first-level item label through counter-questions. After two rounds of counter-questions, the system finally determines it to be "pension insurance." In the third round of dialogue, the citizen further clarifies the second-level item label through counter-questions. At this point, the system can map the question to the "pension insurance - relationship transfer" node, but the scenario guidance is still missing. Therefore, the citizen is asked for more details about the scenario guidance. Finally, after the citizen confirms the scenario type, the system generates an accurate answer in the search enhancement generation module.

[0345] Application Example 3

[0346] Figure 5 This is an example diagram of the actual application effect in the production environment. It shows a real system dialogue scenario in which users use popular language to express their needs (such as unemployment benefits in social security policies) in complex policy document queries. In the figure, each round of dialogue can explain the workflow process of the system logic, and finally generates clarification questions according to step (S232) for counter-asking.

[0347] Actual effect:

[0348] After the user inputs a popular question, the system can obtain the user's intention through the user's question without strict format. The system visualizes the decision-making and judgment process of each step, and generates a clarification question based on the missing conditions, "Did you participate in unemployment insurance as an enterprise employee or as a flexible employment person before?", which has the effect of asking the user a question.

[0349] Application Example 4

[0350] Figure 6 This is an example diagram of the actual application effect in the production environment. It shows that in a complex policy document query, the user uses popular language to express his needs (such as the unemployment benefit issue in the social security policy). After accurately clarifying the user's intention, the answer is generated through formula (20) (retrieval enhancement generation module), and the result of accurately answering the user's intention is achieved through step (S522) (answer formatting).

[0351] Actual effect:

[0352] After the user inputs a popular question, the system can obtain the user's intention through the user's unformatted questions. After multiple rounds of clarification and questioning, the knowledge graph of the user's intention is fully constructed. The answer is generated through the retrieval enhancement generation module, and the answer is formatted and summarized according to the point-by-point logic to answer the user's intention in an organized and standardized manner.

[0353] Application Example 5

[0354] When the user's question intention has been clarified and the answer has been accurately replied, if the user needs to modify a certain scenario guidance condition or a certain knowledge link, the system can dynamically modify the link based on the historical messages of the context, allowing the user to perceive the result of the ongoing dialogue instead of repeating the clarification. Traditional dialogue retrieval methods are prone to failure in this scenario, while the present invention can dynamically adjust the graph nodes through dynamically generated knowledge graph maintenance and revise the answers to subsequent questions.

[0355] Figure 7 This diagram illustrates an actual production application, showing a scenario where, after multiple rounds of clarification, the system accurately responds and the user continues to ask questions. When the user asks again about other knowledge graph nodes, the system dynamically adjusts the secondary item labels and responds to the answers in the neighboring knowledge links. When the user continues with a second round of questions and changes or adds scenario-guided conditions, the system automatically responds with different answers based on the changing conditions and context.

[0356] Actual effect:

[0357] Based on the system's final intended answer in the previous round, "...the procedures for receiving unemployment insurance benefits...", the user inputs again, "I want to receive it all at once, what materials do I need to apply?" In the first round of dialogue, the secondary label extracted from the citizen's question information was changed to a one-time unemployment insurance benefit application. The system continues to determine that the knowledge graph has been constructed, and performs precise search and answers, "If you are an enterprise employee who is not registered in this province and hope to receive unemployment insurance benefits in one go, you need to prepare the following materials:..."

[0358] In the second round of dialogue, the citizen again added a new scenario guidance node to the knowledge graph: "Online Collection". Finally, after the system determined that the citizen had identified the scenario type, the system generated an accurate answer in the retrieval enhancement generation module based on the context information: "Of course, you can apply for a one-time unemployment insurance benefit online through your mobile phone. The following are the specific online application channels:..."

[0359] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A multi-round knowledge-guided question answering method that integrates a large language model and knowledge graph, characterized by include: S1. Build a knowledge graph: Perform semantic parsing and hierarchical processing on the input document content, extracting and annotating the first-level items, second-level items, scenario categories, relevant keywords, and corresponding knowledge questions and answers in the document; through the entity alignment and relationship extraction modules, the extracted content is constructed into a knowledge graph with a hierarchical structure; S2. Retrieval and clarification: Based on user input, semantic analysis is performed using a pre-trained large language model. Hybrid retrieval is performed in combination with the knowledge graph and knowledge base built in step S1. If the retrieval results are unclear, the clarification process is triggered. Based on the knowledge graph nodes and relationships in step S1, generate clarification questions: 1) If the first-level matter Unknown, first retrieve all first-level label items and the knowledge graph currently obtained according to the facts, and generate the target language through the pre-trained large language model. clarification issues; 2) If the secondary matter Unknown, first retrieve all secondary label items and the knowledge graph currently obtained according to the facts, and generate the target language through the pre-trained large language model. clarification issues; 3) If the keyword set Incomplete, generate clarification questions targeting key words; S3. Label extraction and question classification: The label extraction module extracts primary issues, secondary issues, scenario categories, and keywords from the user input in step S2, and classifies and processes questions based on the extraction results. The specific process of classification problem solving is as follows: Classification rules: According to the extracted label information , classify user questions into the following categories: 1) Direct answer type: Label extraction is complete and clear, directly matching the answer in the knowledge graph or retrieval document; 2) Clarification Need: Label extraction is incomplete and requires further clarification; 3) Dynamic search: The labels are clear, but the search needs to be refined by combining scene categories and keywords; Classification output: Adjust the subsequent process based on the classification results: 1) For direct answer types, enter the retrieval enhancement generation module to generate answers; 2) For clarification needs, return to step S2 and enter the clarification question and answer process to supplement the missing information; 3) For dynamic retrieval type, Structure, including first-level matters , Secondary matters , scene category and keywords , as the input of the scene guidance in step S4, performing scene guidance and dynamic retrieval; S4, scenario guidance and dynamic retrieval: Based on the knowledge graph constructed in step S1 and the tag information extracted in step S3, the details of the scenario category are determined, the retrieval conditions are dynamically generated, and the knowledge base is further accurately queried; S5. Answer generation and formatted output: Combining the context information obtained in steps S1 to S4, the retrieval enhancement generation module is used to generate answers using the pre-trained large language model, and the answer output is optimized through the formatting module.

2. According to claim 1, a multi-round knowledge-guided question-answering method integrating a large language model and a knowledge graph is characterized in that: In step S1, the specific process of entity alignment and relationship extraction is as follows: S11. Input document content Perform text cleaning and contextual semantic enhancement to convert it into a standardized text representation; based on the sentence embedding model , generating a vectorized representation of each sentence in the document , used for subsequent entity and relationship analysis; for the document question and answer part, an extraction model is used Extract Collection and , ensuring the accuracy of question-answering knowledge extraction; S12. Use the relation extraction method based on the pre-trained large language model to construct entities and relationships template; Analyze the document context and build a hierarchical knowledge graph by combining semantic parsing with nested hierarchical extraction, which includes: S121, first-level event node : Extract the main issues or topics involved in the document, represented as a set of nodes ; S122, Secondary Event Node : Further refine the context of the first-level items, extract the second-level items, and form a set of child nodes associated with the first-level items , to more accurately represent the refined content; S123, scene category node : Extract the node set related to the scene according to the description of the document and the application background , used to represent the usage scenarios of knowledge; S124, keyword node : Extract core keywords from documents , and associate it with the relevant first-level matters, second-level matters and scenario category nodes.

3. According to claim 1, a multi-round knowledge-guided question-answering method integrating a large language model and a knowledge graph is characterized in that: In step S1, the hierarchical knowledge graph includes knowledge label item paths, knowledge questions, knowledge question vectors, knowledge answers and knowledge answer vectors.

4. According to claim 2, a multi-round knowledge-guided question-answering method integrating a large language model and a knowledge graph is characterized in that: The specific process of building a knowledge graph is as follows: 1) Using pre-trained large language models Deeply analyze the semantics of the document sentence level and generate context vector representation , combined with the syntactic analysis model Extract hierarchical entity nodes and their relationships; 2) Design a recursive relation extraction function , associate the first-level node with the keywords and second-level nodes in its context: (1) in, Indicates the type of relationship between the first-level items and the second-level items; 3) Scene category node The extraction is done through context nested analysis, combined with the association probability , generate the scene branch structure of the hierarchical graph; Ultimately, all nodes and relationships will be organized into a hierarchical knowledge graph in the following form: (2) in, is a node set, is the set of relationships between nodes; The construction process can dynamically generate hierarchical nodes and relationships based on the document content, ensuring the accuracy and scalability of the knowledge graph and providing structured semantic support for subsequent retrieval and clarification.

5. According to claim 2, a multi-round knowledge-guided question-answering method integrating a large language model and a knowledge graph is characterized in that: In step S2, the specific process of semantic parsing is as follows: S211, User Input Vectorization: Questions about user input , using a pre-trained large language model to generate embedding vectors , generated by the following formula: (3) in, represents the semantic embedding generation function, are model parameters; If the user input involves multiple rounds of context, the current input is combined with the historical conversation content to generate a context semantic vector by splicing : (4) in, Represents the previous round of dialogue history; S212, using the knowledge graph constructed in step S12 The semantic structure information of the user input and the knowledge graph constructed Midpoint embedding vector Perform preliminary matching and calculate the similarity of each node: (5) Based on the similarity threshold , extract a set of highly relevant nodes , including first-level matters , Secondary matters , scene category and keywords ; Preliminarily determine the knowledge nodes and their relationships related to the user input, providing a basis for subsequent retrieval modules; In step S2, the specific process of retrieval is as follows: S221, High Confidence Fast Matching: If the knowledge graph matches the node set In, through of Retrieve nodes that match similar vectors and the similarity of key issues in a node or the reordering relevance of the answers , directly call the relevant document as the preliminary answer and enter the formatting module, skipping the clarification process; S222, Vector Search Extension: If the high confidence node is not hit, use the knowledge graph in step S1 and the embedding vector of the user question Construct search conditions: (6) in, It is a search condition dynamically generated by combining knowledge graph nodes and is used to call external vector search; Retrieve the candidate document set D and score the relevance of the candidate documents through the reranking module to filter out low-relevance documents: (7) in, is the retrieved knowledge document; Is a single knowledge document, belonging to the original knowledge document collection An element in is the document relevance score, indicating The degree of match with the user query is calculated by some vector similarity; It is to set the threshold of similarity or correlation; S223, Build: Use the matched node information in the knowledge graph and content, build , call the pre-trained large language model to generate preliminary answers ; In step S2, the specific process of triggering the clarification process is as follows: S231, trigger conditions: like Empty, or a preliminary answer The uncertainty is above the threshold , triggering the clarification process; S232, clarification question generation; S233, User Interaction and Update: Send clarifying questions to the user, receive user feedback, and update the current conversation context and a collection of knowledge graph nodes; S234, Re-search after clarification: Re-execute the search process based on user feedback until all key nodes are clarified or the rejection process is triggered.

6. The multi-round knowledge-guided question-answering method integrating a large language model and a knowledge graph according to claim 2, characterized in that: In step S3, the specific process of label extraction is: S311. Input data: Enter user input question , retrieved knowledge documents , clarified context information and knowledge graph ; S312, label extraction process: Use the label extraction method based on the large model to generate label extraction : (8) in, The final extraction , which is represented as a specific task description generated by combining user queries and context information, and is used to guide the pre-trained large model to generate answers; Contains: user questions, context, search results and knowledge graph node information; By pre-training a large language model Extract the following information: First-level matters : The set of first-level node labels most relevant to the user's question; Secondary matters :exist A specific sub-node label set is further limited based on this; Scene Category : A classification label describing the semantic context of the question; Keywords : A collection of words that are highly relevant to user questions; S313, label identification generation: Encapsulate the extraction results into a tag structure : (9) S314, Multi-factor Authentication: Using the Knowledge Graph Verify the extracted tags: if or Not present in the knowledge graph In step S2, the tag completion process is triggered and the clarification module is returned to step S2; If the extracted label is ambiguous: confidence , generating clarification prompts to obtain more explicit information.

7. The multi-round knowledge-guided question-answering method integrating a large language model and a knowledge graph according to claim 2, characterized in that: In step S4, the specific process is: S41. Scene condition initialization and dynamic expansion S411, input initialization: Get the tags extracted in step S3 , , , and preliminary search results ; Load nodes and context information related to the current session from the knowledge graph G; S412, Conditional Extension: If some tags are missing, the knowledge graph is dynamically called for conditional expansion: turn up or The set of possible tags associated with it: (11) Will Incorporate into the scenario derivation process; S413. Generate dynamic search conditions: Initial conditions: (12) Condition optimization: Use search history and feedback to refine your search criteria: (13) S42. Dynamic retrieval execution and feedback iteration S421, Preliminary Search: based on and Configure the execution retrieval: (14) Return results sorted by relevance score, filter : (15) S422, Feedback Iteration: Generate rhetorical questions for pending tags : (16) S423, Dynamically Supplement Pending Tags: For the unspecified , in the knowledge graph Search for related words in (17) Use words to clarify the scenario category until Explicit or user termination of the session; S43. Scene refinement and label confirmation S431, tag confirmation logic: if , and Clearly, but Unresolved, use the following logic to refine; 1) If The number of candidate items is 1, which is directly confirmed as the final label: (18) 2) If the candidate number is greater than 1, dynamically generate clarification options : (19) Prompt the user to make a choice; S432, Tag Priority Sorting: Based on contextual information and user feedback, tags are prioritized to guide subsequent processes; S44. Confirm output and multiple rounds of optimization S441. Result output: Output the final set of labels , , , and accurate search results ; make sure After filtering, the content is highly relevant to the current context; S442, connect with subsequent modules: Provide the answer generation for step S5: 1) Complete scene categories ; 2) High-quality knowledge document collection ; 3) The pending tag is used as feedback and returns to step S3 to form a closed loop.

8. The multi-round knowledge-guided question-answering method integrating a large language model and a knowledge graph according to claim 2, characterized in that: In step S5, the specific process is: S51. Answer Generation S511, context integration; According to the final scene category, first-level items, second-level items and keyword information obtained in step S4, the context information is constructed in combination with the user's historical input and current question. ; S512, Knowledge Retrieval Integration: The knowledge document retrieved from step S4 As external knowledge support, and context information Input them together into the retrieval enhancement generation module to construct the generative formula : (20) Generate preliminary answers through pre-trained large language models ; The pre-trained large language model uses Qwen2.5, with 72B parameters; S52. Answer optimization S521, consistency check: Comparison of the generated preliminary answers Ensure that the answer logic is consistent with the knowledge base and the paths and nodes in the knowledge graph; for parts that deviate from the knowledge graph, trigger supplementary search and iteratively optimize the generated answer; S522, formatting: The initial answer Input formatting module to optimize its language fluency, structural clarity and professional terminology expression, and output the final answer ; S53. Answer output The system will give the final answer The answer is returned to the user with interactive prompt information, allowing the user to initiate further clarification or modification requests for the generated answer, thus realizing a circular knowledge question and answer.

Citation Information

Patent Citations

  • Multi-terminal task collaboration method and device for robot exhibition hall scene based on cloud side-end architecture

    CN116627637A

  • Government affair service field multi-strategy fusion dialogue method based on knowledge graph

    CN116628172A