Title answer generation method and device, storage medium and computer device
By standardizing the structure of the original text questions and evaluating the knowledge point tags, combined with the logical consistency detection of the review agent, the accuracy and adaptability issues of large language models in answering complex numerical questions are solved, achieving efficient and accurate question answering and question bank updates.
Patent Information
- Application Number
- CN202610725127.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2046-05-25
AI Technical Summary
Existing large language models are prone to fabricating numerical values or making calculation errors when solving complex numerical problems in mathematics, physics, etc., and the generated solutions are beyond the cognitive range of the learning stage, resulting in poor accuracy and adaptability of the solutions, which cannot meet the needs of intelligent tutoring scenarios.
The system receives raw text questions from users, performs structural standardization, determines whether there are duplicate questions in the local question bank, and if not, determines the question solution mode according to the new question routing strategy. It also evaluates knowledge point tags based on the knowledge point tag library, performs parsing and reasoning using the corresponding mode, generates an initial answer, and then performs logical consistency detection and targeted modification through an auditing agent to finally form the target answer.
It improves the accuracy and adaptability of problem solutions, avoids the waste of computing power caused by repeated generation, ensures that the answers are within the scope of the syllabus, increases the usability of generated answers, and enriches the problem bank.
Smart Images

Figure CN122572443B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to a method, apparatus, storage medium, and computer device for generating answers to questions. Background Technology
[0002] With the rapid development of artificial intelligence technology, large language models are increasingly being applied in online education and intelligent tutoring scenarios to automatically generate problem solutions, replacing traditional manual coding methods. Currently, existing solutions utilize large language models such as GPT and Llama, designing prompt words to allow the model to directly generate solutions containing answers and solution steps, thereby improving the accuracy of science problems.
[0003] However, existing large language models are essentially probabilistic text generation models, mostly relying on pre-loaded question banks for question matching. When encountering new questions not included in the bank, especially those involving complex numerical values in subjects like mathematics and physics, they are prone to fabricating numerical values or making calculation errors. Furthermore, they are prone to providing solutions beyond the cognitive scope of the question's learner, resulting in correct but unusable outputs. In short, current large language models exhibit poor adaptability and accuracy in generating solutions, failing to meet the requirements for accurate and compliant question answers in intelligent tutoring scenarios. Summary of the Invention
[0004] The purpose of this application is to at least address one of the aforementioned technical deficiencies, particularly the technical deficiency that existing large language models generate solutions with poor adaptability and accuracy when answering questions, failing to meet the requirements for accurate and compliant question answers in intelligent tutoring scenarios.
[0005] This application provides a method for generating answers to questions, the method comprising:
[0006] After receiving the original text question input by the user, the original text question is processed to standardize the structure to form a standardized text question, and it is determined whether there are duplicate questions in the local question bank that match the standardized text question.
[0007] If so, extract the target answer corresponding to the repeated question and output the target answer to the user;
[0008] If not, then the question-solving mode of the standard text question is determined according to the new question routing strategy, and the knowledge point tags of the standard text question are evaluated based on the knowledge point tag library. Based on the knowledge point tags, the question-solving mode is used to analyze and reason about the standard text question to generate an initial answer.
[0009] The intelligent review agent performs a logical consistency check on the initial answer, obtains the check result, and modifies and / or annotates the question based on the check result to form a target answer. The target answer is then output to the user, and the standardized text question and the target answer are associated and stored in the local question bank.
[0010] Optionally, the step of standardizing the structure of the original text title to form a standardized text title includes:
[0011] The original text title is preprocessed to obtain a plain text title, and the plain text title is then subjected to region recognition to obtain multiple recognition regions and the format type of each recognition region.
[0012] The semantic recognition of each recognition region is performed using a recognition method corresponding to each format type, and standardized text titles are generated based on the recognition results.
[0013] Optionally, determining whether there are duplicate questions in the local question bank that match the standardized text question includes:
[0014] The similarity between the standardized text question and each question in the local question bank is calculated based on vector matching technology, and it is determined whether there are any questions in the local question bank with a similarity greater than a preset threshold.
[0015] If so, then the entered question is confirmed to be a duplicate question that matches the standard text question;
[0016] If not, then it is confirmed that there are no duplicate questions in the local question bank that match the standard text question.
[0017] Optionally, determining the question-answering pattern of the standardized text question according to the new question routing strategy includes:
[0018] The computational features and difficulty values of the computational features in the standardized text questions are determined by rule matching and keyword matching, and it is determined whether the difficulty value exceeds a preset threshold.
[0019] If so, then the solution mode of the standard text question is determined to be the science calculation mode;
[0020] If not, then the solution mode of the standard text question is determined to be the text reasoning mode.
[0021] Optionally, the step of parsing and reasoning about the standardized text question based on the knowledge point tags and using the question-solving mode to generate an initial answer includes:
[0022] When the question-solving mode is a science calculation mode, the standardized text question is written into programming code through a code executor, and based on the knowledge point tags, the programming code is mathematically parsed by a code interpreter to obtain the initial answer;
[0023] When the question-solving mode is text reasoning mode, a similarity matching method is used to select multiple questions with the same knowledge point tags from the local question bank, and each question is introduced into the large language model as a few sample examples to perform answer reasoning on the standardized text questions and obtain the initial answer.
[0024] Optionally, the evaluation of the knowledge point tags for the standardized text question based on the knowledge point tag library includes:
[0025] Semantic features are extracted from the standardized text questions to obtain multiple knowledge point features. Dimensional comprehensive judgment and hierarchical depth analysis are performed on each knowledge point feature to obtain the subject type and difficulty level of the standardized text questions.
[0026] A set of knowledge point tags corresponding to the subject type and the difficulty level is obtained by filtering from the knowledge point tag library, and the knowledge point tags of the standard text question are matched from the set of knowledge point tags based on the characteristics of each knowledge point.
[0027] Optionally, the step of modifying the initial answer and / or annotating the question based on the detection result to form a target answer includes:
[0028] If the detection result is passed, the initial answer will be marked as the target answer of the standardized text question;
[0029] If the detection result is unsuccessful, the reviewer's modification suggestions for the initial answer are obtained through the manual review channel, and the initial answer is modified accordingly. Then, the process returns to the execution of the logical consistency detection of the initial answer by the review agent and subsequent steps.
[0030] This application also provides a question answer generation device, including:
[0031] The question preprocessing module is used to receive the original text question input by the user, perform structural standardization processing on the original text question to form a standardized text question, and determine whether there are duplicate questions in the local question bank that match the standardized text question.
[0032] The answer extraction module is used to extract the target answer corresponding to the repeated question if the answer is yes, and output the target answer to the user.
[0033] The answer generation module is used to determine the question solution mode of the standard text question according to the new question routing strategy if not, and to evaluate the knowledge point tags of the standard text question based on the knowledge point tag library, and to perform parsing and reasoning on the standard text question based on the knowledge point tags and the question solution mode to generate an initial answer.
[0034] The answer modification module is used to perform logical consistency detection on the initial answer through a review agent, obtain the detection result, and modify the initial answer in a targeted manner and / or label the question according to the detection result to form a target answer, output the target answer to the user, and associate and store the standardized text question and the target answer in the local question bank.
[0035] This application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the question answer generation method as described in any of the above embodiments.
[0036] This application also provides a computer device, including: one or more processors, and memory;
[0037] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the question answer generation method as described in any of the above embodiments.
[0038] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0039] The question-answer generation method, apparatus, storage medium, and computer equipment provided in this application can standardize the structure of the original text question when it receives the original text question input by the user, forming a standardized text question. This provides a unified input format for subsequent reasoning. If there is a duplicate question in the local question bank that matches the standardized text question, the target answer corresponding to the duplicate question can be directly extracted and output to the user, avoiding the waste of computing power caused by duplicate answer generation. Otherwise, the question-answering mode of the standardized text question can be determined according to the new question routing strategy, and the knowledge point tags of the question can be obtained based on the knowledge point tag library. Thus, based on the knowledge point tags, the question-answering mode can be used to analyze and reason about the standardized text question to generate an initial answer. The question-answering mode can achieve targeted answers for various types of questions, improving the correctness of the answer reasoning process, while the knowledge point tags can accurately identify the grade level and knowledge point level to which the question belongs, ensuring that the answer reasoning process does not exceed the syllabus. In addition, this application can also perform logical consistency checks on the initial answer through an auditing agent, and make targeted modifications and / or question annotations on the initial answer based on the check results, thereby improving the usability of the answer generated in a single instance. At this point, the final generated target answer can be output to the user and stored in the local question bank along with the standardized text question, thereby enriching the question bank. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart illustrating a question answer generation method provided in an embodiment of this application;
[0042] Figure 2 A flowchart illustrating a question-answering mode confirmation method provided in an embodiment of this application;
[0043] Figure 3 This is a schematic diagram of the structure of a question answer generation device provided in an embodiment of this application;
[0044] Figure 4 This is an internal schematic diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] In one embodiment, such as Figure 1 As shown, Figure 1 This is a flowchart illustrating a method for generating answers to questions, provided as an embodiment of this application. This application provides a method for generating answers to questions, specifically including the following:
[0047] S110: After receiving the original text question input by the user, perform structural standardization processing on the original text question to form a standardized text question, and determine whether there are duplicate questions in the local question bank that match the standardized text question.
[0048] In this step, when the computer receives the original text question input by the user, it can perform structural standardization processing on the original text question to form a standardized text question, providing a unified input format for subsequent reasoning. Then, it can be matched with duplicate questions in the local question bank to determine whether questions with existing high-quality answers can be directly reused, avoiding the waste of computing power caused by repeated generation.
[0049] The original text question refers to the HTML file containing the question text content input by the user, which usually only contains the content area corresponding to a single question; the local question bank refers to the offline question bank stored on the local machine, which is used to store the generated and verified standardized text questions and their corresponding target answers.
[0050] Specifically, the computer device can first perform image preprocessing operations on the original text questions, including but not limited to denoising, binarization, and tilt correction. Then, it can use optical character recognition technology to extract the text content from the image and convert it into standardized text questions with the same format, thereby eliminating the data heterogeneity problem caused by different sources and different layouts in the original text questions. Subsequently, the computer device can call a local question bank to perform duplicate question matching. For example, by calculating the text similarity between the standardized text questions and each question in the local question bank, and comparing it with a similarity threshold, the computer device can determine whether there are already matching duplicate questions in the local question bank based on the comparison results. This allows the computer device to determine whether the answers from the local question bank can be reused to reduce computing resources.
[0051] S120: If so, extract the target answer corresponding to the repeated question and output the target answer to the user.
[0052] In this step, after matching duplicate questions in the local question bank by step S110, if there are duplicate questions in the local question bank, the computer device can directly extract the target answer corresponding to the duplicate question and output it to the user. By directly outputting the approved standard answer, efficient processing with zero generation, zero error and zero delay is achieved.
[0053] Specifically, after identifying the final duplicate question in the local question bank through semantic consistency, formula structure consistency, key numerical consistency, and knowledge point consistency, the computer device can directly read the target answer corresponding to the duplicate question from the local question bank and output the target answer as the final parsing result to the user, without having to call the large language model to perform the reasoning and generation process, thus saving computing resources.
[0054] S130: If not, then determine the question-solving mode of the standard text question according to the new question routing strategy, and evaluate the knowledge point tags of the standard text question based on the knowledge point tag library. Based on the knowledge point tags, use the question-solving mode to analyze and reason about the standard text question to generate the initial answer.
[0055] In this step, step S110 performs duplicate matching of the standardized text questions in the local question bank. If there are no duplicate questions in the local question bank, the computer device can determine the question-solving mode of the standardized text question according to the new question routing strategy, and evaluate the knowledge point tags of the question based on the knowledge point tag library. Thus, based on the knowledge point tags, the question-solving mode can be used to analyze and reason about the standardized text question to generate an initial answer. The question-solving mode can realize targeted solutions for various types of questions, improve the correctness of the answer reasoning process, and the knowledge point tags can accurately identify the grade level and knowledge point level to which the question belongs, ensuring that the answer reasoning process does not exceed the syllabus.
[0056] The new question routing strategy refers to the strategy used to classify newly received standardized text questions by question type and determine the corresponding solution method. It can match the most suitable reasoning mode based on the characteristics of the question itself, avoiding the high error rate in STEM calculations caused by uniformly using large models, and improving the accuracy of solutions for different types of questions. The knowledge tag library refers to a pre-organized and stored set of standard tags corresponding to different subjects, difficulties, and knowledge points. It can quickly match the corresponding knowledge point tags based on the extracted semantic features of the questions, limiting the corresponding knowledge scope for subsequent reasoning and avoiding errors beyond the scope of the syllabus.
[0057] Specifically, computer devices can identify question types based on question type features, formula features, semantic structure, and problem objectives in standardized text questions. Then, they can select the corresponding question-solving model based on the identification results. For example, for science questions involving formula calculations and derivations, a code interpreter-based science calculation model can be matched; for humanities questions involving textual discussion and logical reasoning, a text reasoning model based on a large language model and few-sample reasoning can be matched. After determining the solution model, the computer device can extract the semantic features of the question and, combined with a pre-built knowledge point tag library, match layer by layer to obtain the corresponding knowledge point tags. These tags can then be used as knowledge scope constraints in the reasoning process, calling the corresponding solution model to complete the reasoning and obtain the initial answer.
[0058] S140: The intelligent agent performs a logical consistency check on the initial answer, obtains the check result, and modifies the initial answer and / or labels the question according to the check result to form the target answer, outputs the target answer to the user, and associates and stores the standardized text question and the target answer in the local question bank.
[0059] In this step, after the initial answer is generated in step S130, the computer device can perform a logical consistency check on the initial answer through the review agent, and make targeted modifications and / or question annotations based on the check results, thereby improving the usability of the answer generated in one go. At this time, the final generated target answer can be output to the user, and at the same time, it can be associated with the standardized text question and stored in the local question bank to enrich the question bank.
[0060] Among them, the review agent refers to an intelligent verification module specifically designed to detect the logical rationality and correctness of the initial answer. It can combine the knowledge point tags corresponding to the question to systematically detect the initial answer from multiple dimensions such as the correctness of knowledge point application, the logical coherence of the problem-solving steps, and the accuracy of calculation results. While improving detection efficiency, it can also reduce review costs.
[0061] Specifically, the reviewing agent can first match and verify the problem-solving steps and derivation process in the initial answer with the corresponding knowledge point tags of the question to determine whether the knowledge points used in the problem-solving process match the question and whether they meet the knowledge requirements of the corresponding learning stage. Then, it can check whether the logic of each derivation step is self-consistent and whether there are any errors in the calculation process. For example, the reviewing agent can check whether the formula used in a certain problem-solving step is within the allowed range of the current learning stage, or check whether the variable values in subsequent steps are consistent with the calculation results in previous steps; it can also check whether there is a semantic conflict between the final conclusion and the conditions of the question; and it can also combine knowledge point tags to perform consistency verification on the scope of knowledge point calls in the initial answer to confirm whether there are any problems such as out-of-syllabus knowledge calls, cross-chapter reasoning, or advanced techniques replacing basic methods that do not comply with teaching standards.
[0062] Furthermore, the computer device can perform corresponding processing based on the detection results finally output by the auditing agent. For example, if the inspection result fails, it can perform error-oriented repair. If the inspection result passes, it can mark the corresponding standard text question as the target answer for that question. After the computer device sends the target answer to the user, it can also write it together with the marked standard text question into the local question bank to form a new reusable question resource.
[0063] In the above embodiments, when the user inputs an original text question, the original text question can be structurally standardized to form a standardized text question, providing a unified input format for subsequent reasoning. If there is a duplicate question matching the standardized text question in the local question bank, the target answer corresponding to the duplicate question can be directly extracted and output to the user, avoiding the waste of computing power caused by repeatedly generating answers. Otherwise, the question solution mode of the standardized text question can be determined according to the new question routing strategy, and the knowledge point tags of the question can be evaluated based on the knowledge point tag library. Thus, based on the knowledge point tags, the question solution mode can be used to analyze and reason about the standardized text question to generate an initial answer. The question solution mode can realize targeted solutions for various types of questions, improving the correctness of the answer reasoning process, while the knowledge point tags can accurately identify the grade level and knowledge point level to which the question belongs, ensuring that the answer reasoning process does not exceed the syllabus. In addition, this application can also perform logical consistency checks on the initial answer through an auditing agent, and make targeted modifications and / or question annotations on the initial answer based on the check results, thereby improving the usability of the answer generated in a single instance. At this point, the final generated target answer can be output to the user and stored in the local question bank along with the standardized text question, thereby enriching the question bank.
[0064] In one embodiment, the process of standardizing the structure of the original text title in step S110 to form a standardized text title may include:
[0065] S111: Perform preprocessing on the original text title to obtain plain text title, and perform region recognition on the plain text title to obtain multiple recognition regions and the format type of each recognition region.
[0066] S112: Use the recognition method corresponding to each format type to perform semantic recognition on each recognition area, and generate standardized text titles based on each recognition result.
[0067] In this embodiment, when the computer device standardizes the original text questions, it can first perform preprocessing operations on the original text questions to obtain plain text questions, and then perform region recognition on the plain text questions to obtain multiple recognition regions and the format type of each recognition region. Then, it can use the recognition method corresponding to each format type to perform semantic recognition on each recognition region, and generate standardized text questions based on each recognition result.
[0068] Specifically, the computer device can first preprocess the original text title to remove HTML tags, resulting in a plain text title. If the plain text title contains images or image links, the computer device can directly acquire or obtain the corresponding original images through image links for further processing. Since the recognition rate of the original image may be affected by issues such as shooting angle, lighting, resolution, and noise, the computer device can first perform quality enhancement on the original image, such as geometric correction and denoising. For geometric correction, the computer device can use Hough transform or minimum bounding rectangle to detect the text line tilt angle, perform affine transformation correction, and locate the four corner points through edge detection to restore the image perspective distortion to a rectangle. For denoising, the computer device can use Gaussian filtering or median filtering to remove scanning noise and moiré fringes, and use adaptive histogram equalization (CLAHE) to enhance local contrast, especially improving uneven lighting. Furthermore, before image processing, the computer device can also perform grayscale conversion on the image to reduce computational complexity, preserve brightness information, and after image quality enhancement, scale the image to a uniform DPI to ensure clear textures.
[0069] After preprocessing the original text questions, the computer device can perform region recognition, obtaining multiple recognition regions and the format type of each region, such as text regions, formula regions, or table regions. For text regions, the computer device can use a deep learning-based OCR engine to detect the region and recognize it line by line. For formula regions, the computer device can use object detection models or detection rules to locate the formulas, and then identify formulas mixed with ordinary text by checking character spacing, vertical alignment anomalies, etc. For table regions, the computer device can use the TableTransformer model to detect the table regions and reconstruct them into Markdown format. Finally, the computer device can merge lines and restore paragraphs from the recognition results of each region, and perform character-level error correction and formula format standardization on the restored results, ultimately generating standardized text questions with a uniform format.
[0070] In one embodiment, the process of determining whether there are duplicate questions matching the standard text questions in the local question bank in step S110 may include:
[0071] S113: Calculate the similarity between the standardized text question and each question in the local question bank based on vector matching technology, and determine whether there are any questions in the local question bank with a similarity greater than a preset threshold.
[0072] S114: If so, then confirm that the question entered into the database is a duplicate question that matches the question in the standard text.
[0073] S115: If not, confirm that there are no duplicate questions in the local question bank that match the standard text questions.
[0074] In this embodiment, when matching duplicate questions, the computer device can calculate the similarity between the standard text question and each question in the local question bank based on vector matching technology. If there is a question in the question bank with a similarity greater than a preset threshold, it means that the question in the question bank is a duplicate question that matches the standard text question. Otherwise, it means that there is no duplicate question in the local question bank that matches the standard text question.
[0075] Specifically, computer devices can use a pre-trained text encoding model to convert standardized text questions into low-dimensional, dense semantic vectors. Since all questions in the local question bank have been pre-converted into semantic vectors and stored, the similarity between the standardized text question vector and each question vector in the local question bank can be directly calculated using cosine similarity. The calculated similarity is then compared with a preset similarity threshold. If the similarity of a question in the local question bank is greater than the preset threshold, it is considered a successful match, confirming that the question in the local question bank is a duplicate question. If the similarity of all questions in the local question bank is not greater than the preset threshold, it is considered that the current standardized text question is a new question that has not been included in the local question bank, and the corresponding new question parsing and generation process is triggered.
[0076] Furthermore, computer devices can dynamically adjust the corresponding similarity thresholds based on different subject types. For example, for subjects sensitive to formula structures, such as mathematics and physics, computer devices can increase the similarity threshold to avoid subtle differences in formulas causing different questions to be incorrectly identified as duplicates. Conversely, for subjects with significant semantic variations, such as language arts and history, the similarity threshold can be appropriately lowered to improve the recall of semantically similar questions. In addition, computer devices can perform secondary verification of duplicate question matching results, such as through formula tree matching, knowledge path matching, or key step verification, to further confirm whether the current candidate question and the standardized text question are truly duplicated.
[0077] In one embodiment, such as Figure 2 As shown, Figure 2 A flowchart illustrating a question-answering mode confirmation method provided in an embodiment of this application; Figure 2 In step S130, the process of determining the question-answering pattern of the standardized text question according to the new question routing strategy may include:
[0078] S131: Determine the computational features and difficulty values of the computational features in the standardized text questions through rule matching and keyword matching, and determine whether the difficulty value exceeds a preset threshold.
[0079] S132: If so, then the solution mode for the standard text question is determined to be the science calculation mode.
[0080] S133: If not, then the solution mode for the standard text question is determined to be the text reasoning mode.
[0081] In this embodiment, when determining the solution method for a problem, the computer device can determine the computational features and difficulty values of the computational features in the standardized text problem through rule matching and keyword matching, and determine whether the difficulty value exceeds a preset threshold. If so, the solution mode of the standardized text problem can be switched to the science calculation mode; otherwise, the solution mode of the standardized text problem can be switched to the text reasoning mode.
[0082] The computational features refer to the question attributes that require rigorous logical reasoning and numerical calculations, such as specific numerical operations, formula substitution, algebraic derivation, symbol transformation, physical quantity calculation, or chemical equation solving. This application can use a combination of rule engines and named entity recognition to extract computational features from the text content of standardized text questions.
[0083] Specifically, the computer device can first scan the formula expression structure in the standardized text questions using rule matching, such as integral symbols, summation symbols, complex fractional structures, square root structures, matrix expressions, function expressions, or multi-layered nested formula structures, etc., to detect specific formula features. Simultaneously, it can detect whether the questions contain mathematical formula tags represented in LaTeX format, such as "\int", "\sum", "\frac", "\sqrt", and exponential function expressions. Furthermore, the computer device can extract the problem target features in the standardized text questions through keyword matching, including action words, target words, and solution words in the question stem, such as keywords like "find", "calculate", "solve", "simplify", "prove", "find maximum value", "find speed", "find concentration", and "derive". Additionally, it can combine named entity recognition models to identify variable names, physical quantity names, chemical substance names, function names, and mathematical objects in the questions.
[0084] Furthermore, the computer device can calculate the numerical density in the standardized text problem based on the identified formula expression structure and problem target characteristics, thereby determining its difficulty value by the proportion of computational features in the standardized text problem. If the difficulty value exceeds a preset threshold, the computer device can determine that the current standardized text problem belongs to a high computational complexity problem and switch the corresponding problem-solving mode to a science calculation mode. If the difficulty value does not exceed the preset threshold, the computer device can determine that the current problem mainly relies on semantic understanding and logical expression, and switch the problem-solving mode to a text reasoning mode.
[0085] It should be noted that in the science-based calculation mode, the computer device can call the reasoning module, which has the ability to derive formulas, perform step-by-step calculations, and verify numerical values, to perform step-by-step derivation, formula constraint calculations, and result verification on the problem; while in the text-based reasoning mode, the computer device can focus on calling the reasoning capabilities related to semantic analysis, reading comprehension, and logical induction to generate the corresponding analytical results.
[0086] In one embodiment, step S130, which involves parsing and reasoning through a standardized text question based on knowledge point tags to generate an initial answer, may include:
[0087] S134: When the question solution mode is science calculation mode, the code executor writes the standard text question into programming code, and based on the knowledge point tags, the code interpreter performs mathematical analysis on the programming code to obtain the initial answer.
[0088] S135: When the question-answering mode is text reasoning mode, a similarity matching method is used to select multiple questions with the same knowledge point tags from the local question bank, and each question is introduced into the large language model as a few sample examples to perform answer reasoning on the standardized text questions and obtain the initial answer.
[0089] In this embodiment, under the science calculation mode, the computer device can convert science problems with high computational complexity into executable programming code and use a code interpreter to perform mathematical analysis, thereby transforming the traditional probability generation process into a deterministic calculation process. This effectively reduces the problems of numerical fabrication, formula misuse, and derivation errors that occur in complex numerical calculations by large language models, and improves the calculation accuracy and reliability of results for science problems. Under the text reasoning mode, the computer device can introduce multiple in-database problems that are the same as the current knowledge points as few sample examples, enabling the large language model to refer to historical high-quality problem-solving cases for reasoning generation. This improves the model's ability to learn problem-solving logic, step structure, and language expression, and enhances the standardization and readability of the generated answers for text-based problems that are biased towards semantic understanding and logical reasoning.
[0090] Specifically, for the science-based computation mode, the computer device can first perform structured semantic parsing of the problem content based on the conditions, formula expressions, variable relationships, and knowledge point tags in the standardized text problem. The parsed variable definitions, constraints, solution objectives, and formula relationships are then converted into corresponding programming logic. Subsequently, the computer device can automatically write the standardized text problem into corresponding programming code using a code generation module. During the coding process, knowledge point tags are used to constrain the code, preventing the use of out-of-scope formulas, complex algorithms, or high-order mathematical tools during execution. Next, the computer device can use a code interpreter to execute the variable relationships, formula derivations, and numerical results step by step, generating an initial answer in a corresponding format. This initial answer can include the solution steps, formula derivations, and the final result.
[0091] For text-based reasoning, the computer device can first filter multiple questions from its local question bank that share the same knowledge point tags as the current standard text question. Then, it can rank the selected questions based on similarity in terms of question structure, semantic similarity, and problem-solving logic. The highest-scoring questions and their corresponding target answers can then be selected as few-sample examples. These few-sample examples are then input into a large language model to construct a corresponding few-sample prompt context. These few-sample examples demonstrate the standard problem-solving process, step organization, and answer expression for the current knowledge point to the large language model, enabling it to learn the corresponding reasoning pattern based on these examples. Therefore, by introducing a large language model with few-sample examples, the computer device can directly use it to reason about the answer to the standard text question and generate the corresponding initial answer.
[0092] In one embodiment, the process of evaluating and obtaining the knowledge point tags of the standardized text question based on the knowledge point tag library in step S130 may include:
[0093] S136: Extract semantic features from the standardized text questions to obtain multiple knowledge point features, and perform dimensional comprehensive judgment and hierarchical in-depth analysis on each knowledge point feature to obtain the subject type and difficulty level of the standardized text questions.
[0094] S137: Filter out a set of knowledge point tags corresponding to the subject type and difficulty level from the knowledge point tag library, and match the knowledge point tags of the standard text questions from the knowledge point tag set based on the characteristics of each knowledge point.
[0095] In this embodiment, during the evaluation of knowledge point tags, the computer device can first extract semantic features from the standardized text question to obtain multiple knowledge point features, and then perform dimensional comprehensive judgment and hierarchical depth analysis on each knowledge point feature to obtain the subject type and difficulty level of the standardized text question. Then, it can filter out the knowledge point tag set corresponding to the subject type and difficulty level from the knowledge point tag library, and match the knowledge point tags of the standardized text question from the knowledge point tag set based on each knowledge point feature.
[0096] Specifically, computer equipment can perform semantic feature extraction processing on standardized text questions to identify the core knowledge expression information in the questions. It then performs feature recognition on the identified core knowledge expression information to obtain multiple knowledge point features. These features can then be comprehensively analyzed from dimensions such as subject, question type, formula, logic, and semantic expression. Based on the analysis results, the subject type of the standardized text question is determined. Subsequently, the computer equipment can assess the knowledge depth of the current question by combining the dependencies between knowledge points, the complexity of formulas, the level of abstract concepts, and the knowledge scope of the learning stage, thus obtaining the difficulty level of the standardized text question.
[0097] Furthermore, based on the obtained subject type and difficulty level, the computer device can filter out a set of knowledge point tags from the knowledge point tag library that match the knowledge scope of the current standardized text question, thereby narrowing down the subsequent knowledge point matching range. Based on this set of knowledge point tags, the computer device can use methods such as semantic vector matching, keyword matching, formula template matching, and knowledge graph association matching to calculate the degree of association between the current knowledge point features and each tag, and select one or more tags with the highest scores as the knowledge point tags of the standardized text question, providing a constraint on the knowledge scope for the subsequent answer reasoning process.
[0098] In one embodiment, the process of modifying the initial answer and / or annotating the question based on the detection result to form the target answer in step S140 may include:
[0099] S141: If the test result is passed, the initial answer will be marked as the target answer of the standard text question.
[0100] S142: If the detection result is unsuccessful, obtain the reviewer's modification opinions on the initial answer through the manual review channel, modify the initial answer according to the modification opinions, and return to the execution of the review agent to perform logical consistency detection on the initial answer and subsequent steps.
[0101] In this embodiment, after the review agent outputs the detection result, if the detection result is passed, the computer device can mark the initial answer as the target answer of the standardized text question; if the detection result is failed, the computer device can obtain the reviewer's modification opinions on the initial answer through the manual review channel, modify the initial answer according to the modification opinions, and re-perform the logical consistency detection of the initial answer through the review agent until the detection passes or the maximum number of retests is reached.
[0102] Specifically, when the detection result is passed, the computer device can directly mark the initial answer as the target answer for the standardized text question. When the detection result is failed, the computer device can send the detection result output by the review agent, including the standardized text question, the initial answer, and anomaly information, to the review terminal through the review channel to obtain the reviewer's modification suggestions. After obtaining the modification suggestions, the computer device can rewrite, supplement, or replace only the abnormal local steps in the initial answer without regenerating the entire answer, thus reducing the resource consumption caused by repetitive reasoning. After completing the targeted modifications, the computer device can re-perform a logical consistency check on the modified initial answer through the review agent until the check passes or the maximum number of retests is reached.
[0103] The maximum number of retests limits the number of times the same question can be retried in the automatic correction process, preventing the system from consuming computing resources for extended periods due to complex errors or ambiguities. When the maximum number of retests for a given question is reached, if the review agent's detection result still fails, the computer can mark the current specification text question as pending manual review and pause the automatic correction process. Simultaneously, the computer can store the last output detection result and historical modification records of the specification text as meta-review data, along with the current specification text question and initial answer, in the local question bank or review database for subsequent manual verification and model optimization.
[0104] The question and answer generation apparatus provided in the embodiments of this application is described below. The question and answer generation apparatus described below can be referred to in correspondence with the question and answer generation method described above.
[0105] In one embodiment, such as Figure 3 As shown, Figure 3 This application provides a schematic diagram of a question-answer generation device according to an embodiment of the present application; the present application also provides a question-answer generation device, including a question preprocessing module 210, an answer extraction module 220, an answer generation module 230, and an answer modification module 240, specifically including the following:
[0106] The question preprocessing module 210 is used to receive the original text questions input by the user, perform structural standardization processing on the original text questions to form standardized text questions, and determine whether there are duplicate questions in the local question bank that match the standardized text questions.
[0107] The answer extraction module 220 is used to extract the target answer corresponding to the repeated question if the answer is yes, and output the target answer to the user.
[0108] The answer generation module 230 is used to determine the question solution mode of the standard text question according to the new question routing strategy if not, and to evaluate the knowledge point tags of the standard text question based on the knowledge point tag library, and to perform parsing and reasoning on the standard text question based on the knowledge point tags and the question solution mode to generate an initial answer.
[0109] The answer modification module 240 is used to perform logical consistency detection on the initial answer through the review agent, obtain the detection result, and modify the initial answer and / or label the question according to the detection result to form the target answer, output the target answer to the user, and associate and store the standardized text question and the target answer in the local question bank.
[0110] In the above embodiments, when the user inputs an original text question, the original text question can be structurally standardized to form a standardized text question, providing a unified input format for subsequent reasoning. If there is a duplicate question matching the standardized text question in the local question bank, the target answer corresponding to the duplicate question can be directly extracted and output to the user, avoiding the waste of computing power caused by repeatedly generating answers. Otherwise, the question solution mode of the standardized text question can be determined according to the new question routing strategy, and the knowledge point tags of the question can be evaluated based on the knowledge point tag library. Thus, based on the knowledge point tags, the question solution mode can be used to analyze and reason about the standardized text question to generate an initial answer. The question solution mode can realize targeted solutions for various types of questions, improving the correctness of the answer reasoning process, while the knowledge point tags can accurately identify the grade level and knowledge point level to which the question belongs, ensuring that the answer reasoning process does not exceed the syllabus. In addition, this application can also perform logical consistency checks on the initial answer through an auditing agent, and make targeted modifications and / or question annotations on the initial answer based on the check results, thereby improving the usability of the answer generated in a single instance. At this point, the final generated target answer can be output to the user and stored in the local question bank along with the standardized text question, thereby enriching the question bank.
[0111] In one embodiment, the question preprocessing module 210 may include:
[0112] The title partitioning submodule is used to preprocess the original text title to obtain plain text title, and to perform region recognition on high-quality image to obtain multiple recognition regions and the format type of each recognition region.
[0113] The semantic recognition submodule is used to perform semantic recognition on each recognition region using a recognition method corresponding to each format type, and generate standardized text titles based on each recognition result.
[0114] In one embodiment, the question preprocessing module 210 may further include:
[0115] The similarity calculation submodule is used to calculate the similarity between the standardized text question and each question in the local question bank based on vector matching technology, and to determine whether there are any questions in the question bank with a similarity greater than a preset threshold.
[0116] The first result confirmation submodule is used to confirm that if the entered question is a duplicate question that matches the standard text question, then the question is entered into the database.
[0117] The second result confirmation submodule is used to confirm, if not, that there are no duplicate questions in the local question bank that match the standard text question.
[0118] In one embodiment, the answer generation module 230 may include:
[0119] The difficulty value calculation submodule is used to determine the calculation features and difficulty values of the calculation features in the standardized text questions through rule matching and keyword matching, and to determine whether the difficulty value exceeds a preset threshold.
[0120] The first mode confirmation submodule is used to determine the solution mode of the standard text question as the science calculation mode if the condition is met.
[0121] The second mode confirmation submodule is used to determine the solution mode of the standard text question as the text reasoning mode if no.
[0122] In one embodiment, the answer generation module 230 may further include:
[0123] The first answer generation submodule is used to convert the standard text question into programming code through a code executor when the question solution mode is science calculation mode. Based on the knowledge point tags, the code interpreter performs mathematical parsing on the programming code to obtain the initial answer.
[0124] The second answer generation submodule is used to select multiple questions with the same knowledge point tags from the local question bank when the question answering mode is text reasoning mode. Each question is then used as a few sample examples to be introduced into the large language model to perform answer reasoning on the standardized text questions and obtain the initial answer.
[0125] In one embodiment, the answer generation module 230 may further include:
[0126] The feature analysis submodule is used to extract semantic features from the standardized text questions, obtain multiple knowledge point features, and perform dimensional comprehensive judgment and hierarchical in-depth analysis on each knowledge point feature to obtain the subject type and difficulty level of the standardized text questions.
[0127] The tag matching submodule is used to filter out a set of knowledge point tags corresponding to the subject type and difficulty level from the knowledge point tag library, and to match the knowledge point tags of the standardized text questions from the set of knowledge point tags based on the characteristics of each knowledge point.
[0128] In one embodiment, the answer modification module 240 may include:
[0129] The question labeling submodule is used to label the initial answer as the target answer of the standardized text question if the detection result is passed.
[0130] The targeted modification submodule is used to obtain the reviewers' modification opinions on the initial answer through the manual review channel if the detection result is not passed. The module then modifies the initial answer according to the modification opinions and returns to the execution of the review agent to perform logical consistency detection on the initial answer and subsequent steps.
[0131] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the question answer generation method as described in any of the above embodiments.
[0132] In one embodiment, this application also provides a computer device storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the question answer generation method as described in any of the above embodiments.
[0133] Indicatively, such as Figure 4 As shown, Figure 4 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 4The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the question answer generation method of any of the above embodiments.
[0134] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0135] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0136] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0137] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0138] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating answers to questions, characterized in that, The method includes: After receiving the original text question input by the user, the original text question is processed to standardize the structure to form a standardized text question, and it is determined whether there are duplicate questions in the local question bank that match the standardized text question. If so, extract the target answer corresponding to the repeated question and output the target answer to the user; If not, then the question-solving mode of the standard text question is determined according to the new question routing strategy, and the knowledge point tags of the standard text question are evaluated based on the knowledge point tag library. Based on the knowledge point tags, the question-solving mode is used to analyze and reason about the standard text question to generate an initial answer. The intelligent review agent performs a logical consistency check on the initial answer, obtains the check result, and modifies and / or labels the initial answer according to the check result to form a target answer. The target answer is then output to the user, and the standardized text question and the target answer are associated and stored in the local question bank. The step of determining the question-answering pattern of the standardized text question according to the new question routing strategy includes: The computational features and difficulty values of the computational features in the standardized text questions are determined by rule matching and keyword matching, and it is determined whether the difficulty value exceeds a preset threshold. If so, then the solution mode of the standard text question is determined to be the science calculation mode; If not, then the solution mode of the standard text question is determined to be the text reasoning mode; The process of parsing and reasoning about the standardized text question based on the knowledge point tags and using the question-solving mode to generate an initial answer includes: When the question-solving mode is a science calculation mode, the standardized text question is written into programming code through a code executor, and based on the knowledge point tags, the programming code is mathematically parsed by a code interpreter to obtain the initial answer; When the question-solving mode is text reasoning mode, a similarity matching method is used to select multiple questions with the same knowledge point tags from the local question bank, and each question is introduced into the large language model as a few sample examples to perform answer reasoning on the standard text question to obtain the initial answer; The step of modifying the initial answer and / or annotating the question based on the detection results to form a target answer includes: If the detection result is passed, the initial answer will be marked as the target answer of the standardized text question; If the detection result is unsuccessful, the reviewer's modification suggestions for the initial answer are obtained through the manual review channel, and the initial answer is modified accordingly. Then, the process returns to the execution of the logical consistency detection of the initial answer by the review agent and subsequent steps.
2. The method for generating answers to questions according to claim 1, characterized in that, The process of standardizing the structure of the original text title to form a standardized text title includes: The original text title is preprocessed to obtain a plain text title, and the plain text title is then subjected to region recognition to obtain multiple recognition regions and the format type of each recognition region. The semantic recognition of each recognition region is performed using a recognition method corresponding to each format type, and standardized text titles are generated based on the recognition results.
3. The method for generating answers to questions according to claim 1, characterized in that, The step of determining whether there are duplicate questions in the local question bank that match the standardized text question includes: The similarity between the standardized text question and each question in the local question bank is calculated based on vector matching technology, and it is determined whether there are any questions in the local question bank with a similarity greater than a preset threshold. If so, then the entered question is confirmed to be a duplicate question that matches the standard text question; If not, then it is confirmed that there are no duplicate questions in the local question bank that match the standard text question.
4. The method for generating answers to questions according to claim 1, characterized in that, The knowledge point tags obtained from the evaluation based on the knowledge point tag library for the standardized text question include: Semantic features are extracted from the standardized text questions to obtain multiple knowledge point features. Dimensional comprehensive judgment and hierarchical depth analysis are performed on each knowledge point feature to obtain the subject type and difficulty level of the standardized text questions. A set of knowledge point tags corresponding to the subject type and the difficulty level is obtained by filtering from the knowledge point tag library, and the knowledge point tags of the standard text question are matched from the set of knowledge point tags based on the characteristics of each knowledge point.
5. A device for generating answers to questions, characterized in that, include: The question preprocessing module is used to receive the original text question input by the user, perform structural standardization processing on the original text question to form a standardized text question, and determine whether there are duplicate questions in the local question bank that match the standardized text question. The answer extraction module is used to extract the target answer corresponding to the repeated question if the answer is yes, and output the target answer to the user. The answer generation module is used to determine the question solution mode of the standard text question according to the new question routing strategy if not, and to evaluate the knowledge point tags of the standard text question based on the knowledge point tag library, and to perform parsing and reasoning on the standard text question based on the knowledge point tags and the question solution mode to generate an initial answer. The answer modification module is used to perform logical consistency detection on the initial answer through the review agent, obtain the detection result, modify the initial answer in a targeted manner and / or label the question according to the detection result to form a target answer, output the target answer to the user, and associate and store the standardized text question and the target answer in the local question bank. The process of determining the question solution mode of the standardized text question according to the new question routing strategy in the answer generation module includes: The computational features and difficulty values of the computational features in the standardized text questions are determined by rule matching and keyword matching, and it is determined whether the difficulty value exceeds a preset threshold. If so, then the solution mode of the standard text question is determined to be the science calculation mode; If not, then the solution mode of the standard text question is determined to be the text reasoning mode; The process of generating an initial answer in the answer generation module, based on the knowledge point tags and using the question-solving mode, involves parsing and reasoning through the standardized text question, including: When the question-solving mode is a science calculation mode, the standardized text question is written into programming code through a code executor, and based on the knowledge point tags, the programming code is mathematically parsed by a code interpreter to obtain the initial answer; When the question-solving mode is text reasoning mode, a similarity matching method is used to select multiple questions with the same knowledge point tags from the local question bank, and each question is introduced into the large language model as a few sample examples to perform answer reasoning on the standard text question to obtain the initial answer; The process in the answer modification module of modifying the initial answer and / or annotating the question based on the detection results to form the target answer includes: If the detection result is passed, the initial answer will be marked as the target answer of the standardized text question; If the detection result is unsuccessful, the reviewer's modification suggestions for the initial answer are obtained through the manual review channel, and the initial answer is modified accordingly. Then, the process returns to the execution of the logical consistency detection of the initial answer by the review agent and subsequent steps.
6. A storage medium, characterized in that: The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the question answer generation method as described in any one of claims 1 to 4.
7. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the question answer generation method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Information display method and device, computer equipment and storage medium
CN116302240A
Question answering method and device, electronic equipment and storage medium
CN116884282A
