A method, system and storage medium for intelligent question answering based on large model
By using complexity evaluation functions and dynamic programming answer generation steps in a large-model-based question-and-answer system, the problem of improper problem complexity handling in the prior art is solved, and a more efficient and better quality question-and-answer processing is achieved.
Patent Information
- Application Number
- CN202411102673.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-08-13
AI Technical Summary
When dealing with problems, the existing big model-based question-and-answer system fails to adopt different processing strategies according to the complexity of the problem, resulting in the over-complex handling of simple problems and insufficient handling of complex problems.
By pre-setting the callable external tool set and complexity evaluation function, the user's questions are evaluated in a complexity manner, and different processing strategies are adopted according to the evaluation results, dynamically plan the answer generation steps and call external tools to ensure the quality of the final answer.
It effectively avoids problems that are overly complex and complex and insufficiently handled by complex problems, improves the quality and user experience of the final answers, and ensures the dynamicity and efficiency of the processing strategy.
Smart Images

Figure CN118626627B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an intelligent question-answering method, system and storage medium based on a large model. Background Art
[0002] With the rapid development of artificial intelligence technology, large language models (LLMs) have made significant breakthroughs in the field of natural language processing. These models have demonstrated powerful text understanding and generation capabilities, bringing new opportunities for the development of intelligent question-answering systems. However, existing question-answering systems based on large models generally use a unified approach to handle all types of questions, without adopting different processing strategies based on the complexity of the questions. This may lead to overly complex processing of simple questions and insufficient processing of complex questions. Summary of the invention
[0003] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides an intelligent question-answering method, system and storage medium based on a large model, which can adopt different processing strategies according to the complexity of the problem, thereby helping to solve the problem that simple problems are overly complicated to handle and complex problems are not handled sufficiently.
[0004] In order to implement the above technical solution, in a first aspect, the present invention provides an intelligent question answering method based on a large model, comprising the following steps:
[0005] Step 1: Pre-set the callable external tool set and describe the function of each external tool in the external tool set;
[0006] Step 2: Classify the preset external tool set according to the functions of each external tool described to obtain a function set of the external tools;
[0007] Step 3: Use the complexity evaluation function to evaluate the complexity of the user's question and generate a complexity evaluation result, where the complexity evaluation result includes simple questions and professional questions;
[0008] Step 4: Use different processing strategies to generate the final answer based on the generated complexity assessment results.
[0009] Furthermore, the step 4 includes:
[0010] If the complexity assessment result is a simple question, the final answer is generated directly;
[0011] If the complexity assessment result is a professional issue, perform the following steps:
[0012] A) Retrieve knowledge items related to the user's problem from the knowledge database;
[0013] B) Plan the answer generation steps based on the feature set and the retrieved knowledge items;
[0014] C) generating an external tool calling plan for the planned answer generation step, wherein the external tool calling plan includes: the answer generation step and the external tool to be called for each answer generation step;
[0015] D) Evaluate the generated external tool call plan. If the plan evaluation result is reasonable, execute the external tool call according to the external tool call plan to generate a final answer. If the plan evaluation result is unreasonable, return to step B).
[0016] Further, executing the external tool call according to the external tool call plan to generate the final answer includes:
[0017] According to the external tool calling plan, call the external tool for each answer generation step in sequence;
[0018] Performing effect evaluation on the execution results of the external tools called in each answer generation step, and generating effect evaluation results, wherein the effect evaluation results include whether the expected effect is achieved and whether the expected effect is not achieved;
[0019] Determine the final answer based on the evaluation results.
[0020] Furthermore, determining the final answer based on the evaluation results includes:
[0021] If the expected effect is achieved, the output results of all answer generation steps are integrated as the final answer;
[0022] If there is any failure to achieve the expected result, the output results of all answer steps before the failure to achieve the expected result will be integrated as the final answer.
[0023] Furthermore, the step also includes: performing quality assessment on the generated final answer.
[0024] On the other hand, the present invention provides an intelligent question answering system based on a large model, comprising:
[0025] A human-computer exchange module, used for inputting user questions and displaying final answers to the input user questions;
[0026] A knowledge database, used to store a plurality of knowledge items, wherein the knowledge items include user questions, steps for generating answers to the user questions, and external tools required to be called for each step for generating answers;
[0027] An external tool set setting module, used for presetting an external tool set including a plurality of external tools;
[0028] A function classification module is used to classify the functions of multiple external tools in the external tool set to obtain a function set;
[0029] The complexity evaluation module is used to evaluate the complexity of the input user questions and generate complexity evaluation results;
[0030] The question-answering module is used to adopt different processing strategies based on the complexity assessment results and give the final answer.
[0031] Furthermore, the question-answering module includes:
[0032] A retrieval unit, used to retrieve knowledge items related to the user's question from the knowledge database;
[0033] An answer generation step planning unit, used for planning an answer generation step;
[0034] An external tool calling plan generating unit, used for generating an external tool calling plan according to the planned answer generating steps;
[0035] The plan evaluation unit is used to evaluate the generated external call plan and generate a plan evaluation result.
[0036] On the other hand, the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned large model-based intelligent question and answer method.
[0037] The beneficial effects of the present invention are:
[0038] (1) The present invention uses a complexity evaluation function to evaluate the complexity of user problems, and adopts different processing strategies to handle user problems through dynamic programming and the call of external tools based on the complexity evaluation results, thereby helping to avoid the phenomenon that simple problems are handled too complicatedly and complex problems are not handled sufficiently.
[0039] (2) The mechanism of evaluating and iteratively optimizing the quality of the final answer helps to avoid the phenomenon of unstable or poor quality output of the final answer.
[0040] (3) In the process of knowledge extraction, full consideration of users’ actual satisfaction can help improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0042] Figure 1The present invention is a flowchart of an intelligent question-answering method based on a large model.
[0043] Figure 2 A flow chart for generating answers when the evaluation result of the present invention is a professional question.
[0044] Figure 3 It is a flow chart of analyzing the conversation history of the present invention. DETAILED DESCRIPTION
[0045] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0046] It should be noted that the following detailed descriptions are all illustrative and are intended to provide further explanation of the present invention. Unless otherwise specified, each technical and scientific term used in this embodiment has the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0047] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0048] In the present invention, terms such as "upper", "lower", "left", "right", "front", "back", "vertical", "horizontal", "side", "bottom", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings. They are relational words determined only for the convenience of describing the structural relationships of the various parts or elements of the present invention, and do not specifically refer to any part or element in the present invention and should not be understood as limitations on the present invention.
[0049] In the present invention, terms such as "fixed connection", "connected", "connection", etc. should be understood in a broad sense, indicating that it can be fixedly connected, integrally connected or detachably connected; it can be directly connected or indirectly connected through an intermediate medium. Relevant scientific research or technical personnel in this field can determine the specific meanings of the above terms in the present invention according to specific circumstances, and they should not be understood as limiting the present invention.
[0050] Embodiment 1:
[0051] like Figure 1 As shown, this embodiment provides an intelligent question answering method based on a large model, comprising the following steps:
[0052] S1: Predefine a callable external tool set and describe the function of each external tool in the external tool set.
[0053] For ease of explanation and understanding, the predefined callable external tool set is represented as T = {t1, t2, ..., t n}, where t i represents the i-th tool in the external tool set T, and 1≤i≤n.
[0054] The function and calling method of each external tool in the external tool set are described, wherein the external tool set includes at least one external tool.
[0055] S2: Classify the predefined external tool set according to the described function of each external tool to obtain a function set of the external tools.
[0056] Use the clustering algorithm to classify the functions of each external tool in the external tool set according to the functional similarity to obtain the function set, which is represented by F = {f1, f2, ..., f m}, where f j represents the jth function in the function set, and 1≤j≤m, and m≤n. For example, tools t1 and t3 belong to function f1 in the function set.
[0057] S3: Use the complexity evaluation function to perform complexity evaluation on the user question and generate a complexity evaluation result, where the complexity evaluation result includes simple questions and professional questions.
[0058] For ease of understanding and explanation, the user question is recorded as user question Q. The complexity evaluation function is used to analyze the question based on factors such as the question length, keyword complexity, syntactic structure complexity, and domain expertise of the user question to obtain the complexity evaluation result for the user question:
[0059]
[0060] Among them, C(Q) is the problem complexity evaluation function, which is a complexity evaluation function based on the big model. By sending a specific prompt to the big model, the big model will analyze the problem according to the guidance given by the prompt and return a score of 0 or 1, where 0 represents a simple problem and 1 represents a complex problem that requires professional knowledge. The specific implementation is as follows:
[0061] Prompt example:
[0062] You are a professional problem complexity assessment expert. You need to judge the complexity of user questions and give a score of 0 or 1, where 0 represents a simple question and 1 represents a complex question that requires professional knowledge.
[0063] When evaluating, consider the following:
[0064] 1. The length and structure of the questions;
[0065] 2. Whether it contains professional terms or concepts;
[0066] 3. The scope of knowledge required to answer the question;
[0067] 4. Whether multi-step reasoning or calculation is required.
[0068] Please analyze the user question and give your rating (0 or 1): Question: [User question Q].
[0069] S4: Different processing strategies are used to generate the final answer based on the generated complexity evaluation results.
[0070] The specific steps include:
[0071] S41: If the complexity assessment result is a simple question, the large model is directly used to generate the final answer.
[0072] Specifically, if C(Q) = 0, that is, the complex evaluation result is a simple question, the pre-trained large model is directly used to generate the final answer, and the final answer is represented as A, that is, A = M(Q), where M represents the large model function.
[0073] Among them, the large model adopts the Transformer architecture and is pre-trained and fine-tuned through massive historical text data to obtain a pre-trained large model.
[0074] S42: If the assessment result is a professional issue, perform the following steps: Figure 2 As shown:
[0075] Q1: Retrieve knowledge items related to the user's question from the knowledge database.
[0076] The knowledge items include user question vectors, steps for generating answers to user question vectors, and external tools that need to be called to answer user questions.
[0077] Convert the user question Q into a user question vector (the user question vector is represented by V Q Indicates), V Q Calculate the similarity between the user question vectors of each knowledge item in the knowledge database and select the one that is similar to the user question vector V Q A preset number (e.g., K) of the most relevant knowledge items.
[0078] Q2: Plan the answer generation steps based on the feature set of the external tool and the retrieved knowledge items.
[0079] Based on the function set F and the retrieved knowledge items, for example, K, the large model is used to generate the sequence of steps required to answer the user's question, and the step sequence is represented as S = {s1, s2, ..., s L}, where s k represents the kth step, s k ∈{s1, s2, ..., s L}.
[0080] prompt example:
[0081] You are an advanced AI assistant who is responsible for planning the steps to solve complex problems. Based on the given problem and related knowledge items, you need to develop a detailed step-by-step plan to answer the problem. Please make sure that your step-by-step plan is logically clear, comprehensive and executable.
[0082] Question: [insert user question here]
[0083] Retrieved knowledge items related to the user's question:
[0084] 1. [insert the first relevant piece of knowledge retrieved here];
[0085] 2. [Insert the second relevant knowledge item retrieved here];
[0086] 3. [insert the third relevant knowledge item retrieved here];
[0087] …
[0088] Functionality of the callable external tool: [insert description of the callable external tool functionality here]
[0089] Based on the above information, please develop a detailed step-by-step plan to answer the user's question. Your plan should include the following:
[0090] 1. Step number;
[0091] 2. Step description: clearly describe the tasks to be completed in this step;
[0092] 3. Required functional category: Select the most appropriate one from the above functional categories;
[0093] 4. Expected output: Describe the results that should be obtained after completing this step;
[0094] 5. Relationship to the next step: Explain how the output of this step is used in the subsequent step.
[0095] Make sure your steps are planned:
[0096] - Make full use of the retrieved relevant knowledge;
[0097] - The logical order is reasonable and each step is necessary;
[0098] - Take into account possible exceptions and alternatives;
[0099] - The number of steps is moderate, usually no less than 3 and no more than 10.
[0100] Now, start planning your steps:
[0101] Step plan:
[0102] 1. Step number: 1
[0103] Step Description:
[0104] Required functionality category:
[0105] Expected Output:
[0106] Relationship to next step:
[0107] 2. Step number: 2
[0108] Step Description:
[0109] Required functionality category:
[0110] Expected Output:
[0111] Relationship to next step:
[0112] 3. Step number: 3
[0113] Step Description:
[0114] Required functionality category:
[0115] Expected Output:
[0116] Relationship to next step:
[0117] …
[0118] Finally, please briefly summarize how this step plan effectively answers the original question and what major challenges it may face.
[0119] Q3: Generate an external tool calling plan for the planned answer generation steps, wherein the external tool calling plan includes: the planned answer generation steps and the external tools that need to be called for each answer generation step, and each answer generation step is arranged corresponding to the external tool it needs to call.
[0120] Specifically, for each answer generation step s k , where sk ∈{s1, s2, ..., s L}, using the tool selection model based on the attention mechanism, calculate the matching score between each answer generation step and each external tool in the external tool set, and select the external tool with the highest matching score as the tool used in this step, so as to match each step one by one, thereby forming an external tool calling plan, which is represented as P = {( s1, t1), (s2, t2), …,(s k , t i )}.
[0121] It should be noted that P = {( s1, t1), (s2, t2), …, (s k , t i )} is merely exemplary and is for ease of description and understanding.
[0122] Q4: Evaluate the generated external tool call plan. If the plan evaluation result is reasonable, execute the external tool call according to the external tool call plan and generate a final answer. If the plan evaluation result is unreasonable, return to step Q2.
[0123] The specific steps are as follows:
[0124] Q41: Use the tool call plan evaluation function based on rules and large models to evaluate the rationality of the external tool call plan and generate the following plan evaluation results:
[0125]
[0126] Among them, E(P) is the tool call plan evaluation function, and the evaluation criteria of E(P) include step logic, tool selection accuracy and plan completeness.
[0127] For example, the prompt example of evaluating the rationality of the external tool call plan by the tool call plan evaluation function based on rules and large models is as follows:
[0128] You are a professional tool call plan evaluation expert. You need to evaluate whether a given tool call plan is reasonable and give a score of 0 or 1, where 0 means the plan is unreasonable and 1 means the plan is reasonable.
[0129] When evaluating, consider the following:
[0130] 1. Is the logical order of the steps correct?
[0131] 2. Are the tools selected for each step appropriate?
[0132] 3. Is the plan complete and can it solve user problems?
[0133] 4. Are there any redundant or unnecessary steps?
[0134] Please analyze the following tool call plan and give your score (0 or 1):
[0135] Original question: [User Question Q]
[0136] External tool call plan:
[0137] [Insert details of external tool call plan P here]
[0138] score:
[0139] reason:
[0140] Q41-1: If E(P) = 1, that is, the plan evaluation result is reasonable, then the external tool is called according to the external tool call plan for the answer generation step to generate an answer.
[0141] The specific steps include:
[0142] A1: According to the external tool calling plan, call the external tools for the answer generation steps in sequence.
[0143] According to the correspondence between each answer generation step in the external tool calling plan and the external tool, the external tools are called for the answer generation steps in sequence according to the arrangement order in the external tool calling plan.
[0144] Specifically, for example, according to the external tool call plan P = { (s1, t1), (s2, t2), …, (s k ,t i )}, the execution order is: first call external tool t1 for answer generation step s1, then call external tool t2 for answer generation step s2, and so on.
[0145] A2: Evaluate the execution results of the called external tools.
[0146] Generate steps s for the answers in sequence k External tools called i In answer generation step s k The execution result in is represented as r k = t i (s k ), and use the effect evaluation function to determine the execution result r k Whether the expected effect is achieved is specifically indicated as follows:
[0147]
[0148] Among them, W(r k ) effect evaluation function, which is evaluated based on predefined effect indicators and machine learning models.
[0149] The execution result is, for example, a weather query tool, the execution result of which is the queried weather information.
[0150] A2-1: If W(r k ) are all 1, that is, the execution results of the external tools called by each answer step in the external tool call plan all achieve the expected results, then the output results of all answer generation steps are integrated to generate the final answer, and the final answer is denoted as A_final.
[0151] A2-2: If there exists W(r k ) = 0, that is, when the external tools corresponding to each answer generation step are called and executed one by one according to the external tool calling plan, if the execution result does not meet the expected effect, the calling and execution are stopped, and the output results of all the answer generation steps before the answer generation step are integrated as the final answer A_final.
[0152] For example, the external tool call plan P = { (s1, t1), (s2, t2), …, (s k , t i )}, first answer generation step s1, call external tool t1, and evaluate the execution result of external tool t1 in answer generation step s1. If the expected effect is achieved, continue to answer generation step s2, call external tool t2, and evaluate the execution result of external tool t2 in answer generation step s2. If the expected effect is achieved, continue to answer generation step s3, call external tool t3, and evaluate the execution result of external tool t3 in answer generation step s3. If the expected effect is not achieved, stop calling and executing, and integrate the output results of step s1, step s2 and step s3 as the final answer.
[0153] Here is an example of a prompt for effect evaluation:
[0154] You are a professional tool execution effect evaluation expert. You need to evaluate whether the execution result of a given tool has achieved the expected effect and give a score of 0 or 1, where 0 means that the expected effect has not been achieved and 1 means that the expected effect has been achieved.
[0155] When evaluating, consider the following:
[0156] 1. Whether the execution result solves the goal of the current step.
[0157] 2. Accuracy and completeness of results.
[0158] 3. Whether the results provide necessary information for subsequent steps.
[0159] Please analyze the following tool execution results and give your rating (0 or 1):
[0160] Original question: [insert user question Q here]
[0161] Current step: [insert current step here] k Description]
[0162] Tools used: [insert tools used here] i Name and functional description]
[0163] Execution results: [insert tool execution results here] k ]
[0164] score:
[0165] reason:
[0166] Q41-2: If E(P) = 0, that is, the plan evaluation result is unreasonable, return to step Q2 and re-plan the step.
[0167] Q5: Perform quality assessment on the generated final answer.
[0168] Use the quality assessment function to evaluate the quality of the final answer to obtain the following quality assessment results:
[0169]
[0170] Among them, Q(A_final) is the quality evaluation function.
[0171] If Q(A_final) = 0, the quality of the generated final answer does not meet the requirements, then return to step Q1 for iterative optimization until a satisfactory answer is obtained or the maximum number of iterations is reached, where the maximum number of iterations is pre-set.
[0172] Q6: Optimization and maintenance.
[0173] Q61: Regularly clean and update the knowledge database and delete outdated or low-quality knowledge entries.
[0174] Q62: Continuously monitor system performance, including indicators such as answer accuracy, user satisfaction, and response time.
[0175] Q63: Based on user feedback and system logs, continuously optimize the algorithms and models of each module.
[0176] Q64: Regularly update external tool sets and adjust tool classification and selection strategies accordingly.
[0177] Embodiment 2:
[0178] The difference between this embodiment and embodiment 1 is that Figure 3 As shown, the method further includes analyzing the conversation history and extracting knowledge items from the conversation history to store in a knowledge database.
[0179] The conversation history is the conversation question and answer data generated by the process of users generating answers based on questions, and the data is recorded in the conversation history database.
[0180] The specific steps are as follows:
[0181] D1: Analyze the conversation history.
[0182] For ease of understanding and explanation, the conversation history H is represented as a series of role-content pairs: H = {(role1, content1), (role2, content2), ..., (role i , content i )}, where role i ∈ {user, agent}, content i Indicates the corresponding conversation content.
[0183] When the role is a user, the content of the conversation is the questions and requests raised by the user; when the role is an agent, the content of the conversation is the tool call plan and final answer generated by the agent.
[0184] D2: Segment the conversation history.
[0185] Using an algorithm based on topic modeling and dialogue behavior analysis, the dialogue history H is divided into multiple relatively independent paragraphs G = {g1, g2, ..., g j}, where g j Represents multiple questions and answers about a topic.
[0186] Specifically, the conversation history may include user question 1, agent answer 1, user question 2, agent answer 2, user question 3, agent answer 3, etc. This is a long paragraph, which may include multiple different topics. For example, user questions 1 and 2 and their corresponding answers are about topic 1, and then user question 3 and its corresponding answer are about topic 2. The segmentation here is to identify the topic in the conversation and divide the conversation history into different paragraphs according to the topic. This process can be performed using the TADAM model.
[0187] D3: Satisfaction evaluation.
[0188] For each paragraph gj , using the satisfaction evaluation function S(g j ) to determine whether the user is satisfied and generate a satisfaction evaluation result:
[0189]
[0190] Among them, the evaluation criteria include: the user's expressed satisfaction, the user's emotional inclination, and the coherence and completeness of the conversation.
[0191] Satisfaction Assessment Prompt Example:
[0192] You are a professional user satisfaction assessment expert. You need to evaluate whether the user is satisfied with the agent's answer in a given dialogue paragraph and give a score of 0 or 1, where 0 means the user is dissatisfied and 1 means the user is satisfied.
[0193] When evaluating, consider the following:
[0194] 1. Explicit feedback from users (such as expressions of gratitude or affirmation);
[0195] 2. The user’s emotional inclination (judged by tone and word choice);
[0196] 3. The coherence and integrity of the dialogue;
[0197] 4. Whether the user asks questions or seeks clarification;
[0198] Please analyze the following dialogue paragraph and give your rating (0 or 1):
[0199] Dialogue paragraph:
[0200] [Insert dialogue paragraph hereg j The complete content of the , including the conversation between the user and the agent]
[0201] score:
[0202] reason:
[0203] D4: Knowledge extraction and storage.
[0204] For satisfying S(g j ) = 1, the system performs the following steps:
[0205] a) Use named entity recognition and key information extraction technology to extract user questions Q j .
[0206] b) Use sequence tagging and dependency parsing to extract the correct answer step S j .
[0207] c) A collection of tools that extract calls through keyword matching and context analysis T j .
[0208] d) Generate structured knowledge items k j = (Q j , S j , T j ).
[0209] e) k j Store it in the knowledge database and update the relevant index.
[0210] This embodiment improves the accuracy of question and answer by analyzing historical conversations, forming a virtuous circle.
[0211] Embodiment 3:
[0212] This embodiment provides an intelligent question-answering system based on a large model, including:
[0213] The human-computer exchange module is used to input user questions and display the final answers to user questions.
[0214] The knowledge database is used to store multiple knowledge items, wherein the knowledge items include user questions, steps for generating answers to the user questions, and external tools required to be called for each answer generation step.
[0215] The external toolset setting module is used to pre-set an external toolset including multiple external tools.
[0216] The function classification module is used to classify the functions of multiple external tools in the external tool set to obtain a function set.
[0217] The complexity evaluation module is used to perform complexity evaluation on the input user questions and generate complexity evaluation results.
[0218] The question-answering module is used to adopt different processing strategies based on the complexity assessment results and give the final answer.
[0219] Wherein, the question-answering module includes:
[0220] The retrieval unit is used to retrieve knowledge items related to the user's question from the knowledge database.
[0221] The answer generation step planning unit is used to plan the answer generation step.
[0222] The external tool calling plan generating unit is used to generate an external tool calling plan according to the planned answer generating steps.
[0223] The plan evaluation unit is used to evaluate the generated external call plan and generate a plan evaluation result.
[0224] System optimization module, used to optimize and maintain the system.
[0225] Embodiment 4:
[0226] This embodiment provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the large model-based intelligent question-answering method described in Example 1.
[0227] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
[0228] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0229] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0230] In addition, it should be noted that the flowchart in the accompanying drawings shows the method of the embodiment of the present disclosure. In the corresponding description in the flowchart or block diagram in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in an order different from that disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be performed substantially in parallel, and they can sometimes be performed in the opposite order, which can depend on the functions involved. Each block in the block diagram and / or flow chart, and the combination of blocks in the block diagram and / or flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0231] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An intelligent question answering method based on a large model, characterized in that: The following steps are involved: Step 1: Pre-set the callable external tool set and describe the function of each external tool in the external tool set; Step 2: Classify the preset external tool set according to the functions of each external tool described to obtain a function set of the external tools; Step 3: Use the complexity evaluation function to evaluate the complexity of the user's question and generate a complexity evaluation result, where the complexity evaluation result includes simple questions and professional questions; Step 4: Use different processing strategies to generate the final answer based on the generated complexity assessment results; The fourth step comprises: If the complexity assessment result is a simple question, the final answer is generated directly; If the complexity assessment result is a professional issue, perform the following steps: A) Retrieve knowledge items related to the user's problem from the knowledge database; B) Plan the answer generation steps based on the feature set and the retrieved knowledge items; C) generating an external tool calling plan for the planned answer generation step, wherein the external tool calling plan includes: the answer generation step and the external tool to be called for each answer generation step; D) Evaluate the generated external tool call plan. If the plan evaluation result is reasonable, execute the external tool call according to the external tool call plan to generate a final answer. If the plan evaluation result is unreasonable, return to step B); The step three includes: using a complexity evaluation function to analyze the question according to the question length, keyword complexity, syntactic structure complexity and domain expertise of the user question to obtain a complexity evaluation result for the user question; The step D) further comprises: The rationality of the external tool call plan is evaluated using the tool call plan evaluation function based on rules and large models, and the following plan evaluation results are generated: Among them, E(P) is the tool call plan evaluation function, and the evaluation criteria of E(P) include step logic, tool selection accuracy and plan completeness; The method further comprises: Represent the conversation history as a sequence of role-content pairs: H = {(role1, content1), (role2, content2), ..., (role i , content i )}, where role i ∈{user, agent}, content i Indicates the corresponding conversation content; H indicates the conversation history; Using an algorithm based on topic modeling and dialogue behavior analysis, the dialogue history H is segmented into multiple independent paragraphs G = {g1, g2, ..., g j }, where g j Represents multiple questions and answers about a topic; For each paragraph g j , using the satisfaction evaluation function S(g j ) to determine whether the user is satisfied and generate a satisfaction evaluation result: For satisfying S(g j ) = 1, perform the following steps: a) Extract user questions using named entity recognition and key information extraction techniques; b) Use sequence labeling and dependency parsing to extract the correct answer steps; c) A collection of tools to extract calls through keyword matching and context analysis; d) Generate structured knowledge items; e) Store the generated knowledge entries into the knowledge database and update the relevant indexes.
2. The intelligent question-answering method based on a large model according to claim 1, characterized in that: The executing of the external tool call according to the external tool call plan to generate the final answer includes: According to the external tool calling plan, call the external tool for each answer generation step in sequence; Performing effect evaluation on the execution results of the external tools called in each answer generation step, and generating effect evaluation results, wherein the effect evaluation results include whether the expected effect is achieved and whether the expected effect is not achieved; Determine the final answer based on the evaluation results.
3. The intelligent question-answering method based on a large model according to claim 2, characterized in that: According to the evaluation results, the final answer includes: If the expected effect is achieved, the output results of all answer generation steps are integrated as the final answer; If there is any failure to achieve the expected result, the output results of all answer steps before the failure to achieve the expected result will be integrated as the final answer.
4. The intelligent question-answering method based on a large model according to claim 1, characterized in that: The step also includes: performing quality assessment on the generated final answer.
5. An intelligent question-answering system based on a large model, characterized in that: include: A human-computer exchange module, used for inputting user questions and displaying final answers to the input user questions; A knowledge database, used to store multiple knowledge items, wherein the knowledge items include user questions, steps for generating answers to the user questions, and external tools required to be called for each answer generation step; An external tool set setting module, used for presetting an external tool set including a plurality of external tools; A function classification module is used to classify the functions of multiple external tools in the external tool set to obtain a function set; The complexity evaluation module is used to evaluate the complexity of the input user questions and generate complexity evaluation results; The question-answering module is used to adopt different processing strategies based on the complexity assessment results and give the final answer; The question-answering module includes: A retrieval unit, used to retrieve knowledge items related to the user's question from the knowledge database; An answer generation step planning unit, used for planning an answer generation step; An external tool calling plan generating unit, used for generating an external tool calling plan according to the planned answer generating steps; A plan evaluation unit, used to evaluate the generated external call plan and generate a plan evaluation result; The step of performing complexity evaluation on the input user question and generating a complexity evaluation result includes: using a complexity evaluation function to analyze the question according to the question length, keyword complexity, syntactic structure complexity and domain expertise factors of the user question to obtain a complexity evaluation result for the user question; The step of evaluating the generated external call plan and generating a plan evaluation result includes: The rationality of the external tool call plan is evaluated using the tool call plan evaluation function based on rules and large models, and the following plan evaluation results are generated: Among them, E(P) is the tool call plan evaluation function, and the evaluation criteria of E(P) include step logic, tool selection accuracy and plan completeness; The system is further configured to: represent the conversation history as a series of role-content pairs: H = {(role1, content1), (role2, content2), ..., (role i , content i )}, where role i ∈{user, agent}, content i Indicates the corresponding conversation content; H indicates the conversation history; Using an algorithm based on topic modeling and dialogue behavior analysis, the dialogue history H is segmented into multiple independent paragraphs G = {g1, g2, ..., g j }, where g j Represents multiple questions and answers about a topic; For each paragraph g j , using the satisfaction evaluation function S(g j ) to determine whether the user is satisfied and generate a satisfaction evaluation result: For satisfying S(g j ) = 1, perform the following steps: a) Extract user questions using named entity recognition and key information extraction techniques; b) Use sequence labeling and dependency parsing to extract the correct answer steps; c) A collection of tools to extract calls through keyword matching and context analysis; d) Generate structured knowledge items; e) Store the generated knowledge entries into the knowledge database and update the relevant indexes.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the large model-based intelligent question-answering method described in any one of claims 1 to 4.
