An intelligent teaching question-answering system based on natural language processing
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-28
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]本发明解决的技术问题是:相关技术难以在上下文长度预算内实现教学知识片段的最优覆盖,不能准确感知语义冲突,导致大语言模型生成的问答结果容易缺乏逻辑推导层级性
本发明的有益效果:本发明通过对多源原始教学资源进行粗粒度多维索引构建,并将其与教学事件标记深度融合;利用特征集合交并比构建容差类信息粒,克服了硬划分的局限,提升初始候选集的召回率与信息粒度表征力。利用容差拟阵优化,在上下文长度预算内最大化信息空间秩增益,精细划分核心与边界证据层以消除数据冗余。通过结构化语义前缀与压缩证据块实现大语言模型深度语义对齐,在面临冲突和关键条件槽位为空时能智能拦截并挂起生成流程,有效抑制大语言模型幻觉,确保输出的分步推导答案具备极高的教学精准度与逻辑鲁棒性。
Smart Images

Figure CN122570544A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing, and more particularly to an intelligent teaching question-and-answer system based on natural language processing. Background Technology
[0002] With the application of large language models in education, intelligent teaching question-answering systems are gradually becoming important tools for personalized learning. Traditional retrieval-enhanced generation techniques, when dealing with complex teaching resources, often suffer from overly mechanical text segmentation, failing to effectively connect heterogeneous teaching knowledge fragments such as textbook definitions, lecture theorems, and problem-solving steps. Furthermore, due to a lack of deep, structured perception of the redundancy and mutual exclusivity among multi-source evidence and the student's current learning state, large language models are prone to semantic illusions when generating answers due to contextual noise or missing key conditions, failing to provide accurate step-by-step derivations and targeted clarification questions.
[0003] Currently, Chinese invention patent application CN111026842B discloses a natural language processing method, a natural language processing device, and an intelligent question-answering system. The method includes: preprocessing received text information to form a text sequence composed of several words; acquiring knowledge information of entities contained in the text sequence from a preset knowledge graph; fusing the knowledge information with the corresponding entities in the text sequence to generate a fused sequence; calculating intent context information and determining the intent of the fused sequence; calculating slot context information; combining the intent context information and the slot context information to generate intent-slot association information and determine the slot to which each word in the fused sequence belongs; and determining the semantics of the text information based on the slot to which the word belongs and the intent of the fused sequence. It integrates entity information from a preset knowledge graph, which can effectively improve the computational ability to analyze and understand specific professional fields. However, related technologies struggle to optimally cover teaching knowledge fragments within a context length budget, leading to question-answering results generated by large language models prone to illusions and misanswers. Summary of the Invention
[0004] The technical problem solved by this invention is that related technologies have difficulty achieving optimal coverage of teaching knowledge fragments within the context length budget, cannot accurately perceive semantic conflicts, and result in the question-and-answer results generated by large language models easily lacking logical deduction hierarchy.
[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: An intelligent teaching question-answering system based on natural language processing includes a preprocessing module, a tolerance calculation module, a structure hierarchical module, and an alignment control module; The preprocessing module is used to segment the original teaching resources into teaching knowledge fragments and build an index, and to receive the current question text input by the student to generate teaching event markers; The tolerance calculation module is used to retrieve the initial candidate set through indexing and to construct tolerance relationships and tolerance class information granules. The structural layering module is used to construct the rank function of the tolerance matroid structure through tolerance-type information granules, select the independent evidence representative set based on the greedy algorithm, and divide it into the core evidence layer and the boundary evidence layer. The alignment control module is used to construct a structured semantic prefix and concatenate it with compressed evidence blocks into the input large language model, and output step-by-step derivation answers and clarification follow-up texts based on the core evidence layer and the boundary evidence layer.
[0006] Preferably, the preprocessing module includes an acquisition unit and a feature construction unit; The acquisition unit is used to acquire original teaching resources and segment the original teaching resources into text according to the smallest knowledge fragments to obtain teaching knowledge fragments. The minimum knowledge fragment includes a textbook definition block, a lecture theorem block, a PPT method block, a block describing common mistakes, and a problem-solving step block. The feature construction unit is used to extract the structured features of each teaching knowledge segment, form a feature set from the structured features, and build an index for the teaching knowledge segments in parallel. The structured features include concept tags, question type tags, step phrases, and error reason tags; The indexes include vector indexes, structured feature indexes, and relation indexes.
[0007] Preferably, the preprocessing module further includes a marker generation unit; The tag generation unit is used to receive the current question text input by the student and obtain the student's current learning status and the time information of the current question. The current question text is converted into a text vector using a text encoder. The current learning state and the time information of the current question are mapped into a teaching state signal. The text vector and the teaching state signal are then fused and encoded to generate a teaching event marker.
[0008] Preferably, the specific processing logic of the tolerance calculation module includes: Using text vectors and vector indexes, semantic retrieval is performed in the teaching knowledge base to obtain the first candidate set; By using keywords in the current problem text and employing structured feature indexing, keyword retrieval is performed in the teaching knowledge base to obtain a second candidate set; The first candidate set and the second candidate set are merged to obtain the initial candidate set, and the tolerance relationship is constructed using the initial candidate set; Based on tolerance relations, the teaching knowledge fragment x in the initial candidate set and the teaching knowledge fragments with non-zero similarity to it are aggregated to obtain tolerance-type information particles centered on the teaching knowledge fragment x.
[0009] Preferably, the specific processing logic for constructing tolerance relationships through the initial candidate set includes: The similarity is the ratio of the number of elements in the intersection of the feature set of teaching knowledge fragment x and the feature set of teaching knowledge fragment y in the initial candidate set to the number of elements in the union. When the similarity is not less than the tolerance threshold, it is determined that x and y satisfy the tolerance relationship, and the tolerance relationship value is the similarity. When the similarity is less than the tolerance threshold, it is determined that x and y do not satisfy the tolerance relationship, and the tolerance relationship value is 0.
[0010] Preferably, the specific processing logic of the hierarchical structural module includes: Construct tolerance matroid structures for all tolerance-type information granules and calculate the rank function of the tolerance matroid structures; In the initial candidate set, with the joint objective of maximizing the rank gain of the rank function and maximizing the semantic relevance score with the teaching event label, a greedy algorithm is used to introduce teaching knowledge fragments one by one until the context length budget is reached, so as to obtain the independent evidence representative set. Retrieve the tolerance class information particles corresponding to each teaching knowledge fragment in the independent evidence representative set under the tolerance relation, and merge the teaching knowledge fragments included in each tolerance class information particle to obtain the closure evidence set; Teaching knowledge fragments that belong to the independent evidence representative set and satisfy the stability closed set condition are classified into the core evidence layer. If no teaching knowledge fragment in the independent evidence representative set satisfies the stability closed set condition, they are sorted in descending order according to the comprehensive selection weight, and the first N fragments are set as the core evidence layer, where N is an integer greater than or equal to 1. Teaching knowledge fragments that belong to the closure evidence set but not to the independent evidence representative set are classified into the boundary evidence layer; The stability closed set condition is that the rank gain of the teaching knowledge segment is not less than the rank gain threshold and the correlation with the teaching event label is not less than the correlation threshold.
[0011] Preferably, the expression for calculating the rank function of the tolerance matroid structure is: ; in, A subset of evidence, For teaching knowledge segments Tolerance-type information granules, The value of the rank function. For the modulus of the set, This is the tolerance threshold. This refers to the tolerance relationship.
[0012] Preferably, the specific processing logic for obtaining the independent evidence representative set includes: After adding the currently unselected teaching knowledge segments to the selected evidence subset, the positive difference generated by the rank function is used as the current rank gain; Calculate the semantic relevance score between the teaching knowledge segment and the teaching event marker; The current rank gain and semantic relevance score are normalized, and the normalized current rank gain and semantic relevance score are weighted and summed to obtain the comprehensive selection weight. The teaching knowledge fragment with the highest comprehensive selection weight is added to the selected evidence subset until the total token length of the added teaching knowledge fragments reaches the context length budget, and then the independent evidence representative set is output.
[0013] Preferably, the alignment control module includes a determination unit, a prefix construction unit, a splicing unit, and an output unit; The determination unit is used to calculate the conflict rate within the boundary evidence layer by comparing the conflict fragment pairs determined by the relation index with all teaching knowledge fragment pairs, and to determine whether the suspension condition is triggered. When it is determined that the suspension condition has not been triggered, the control flow is distributed to the prefix construction unit and the splicing unit; When the suspension condition is triggered, the large language model answer generation process is intercepted and suspended. The key missing features that cause the largest decrease in conflict rate in the boundary evidence layer are extracted, and the clarification follow-up text is generated and output. The prefix construction unit is used to filter out the word prototype set from the word embedding space of the large language model, extract the semantic anchor phrases of the current question text and the teaching knowledge fragments in the core evidence layer, and construct a structured semantic prefix using the semantic anchor phrases and the word prototype set. The splicing unit is used to retain the complete text of teaching knowledge fragments with rank gains higher than a preset intensity based on the rank gain of independent evidence representing a set of teaching knowledge fragments, extract summaries of teaching knowledge fragments with rank gains approaching zero, and assemble them into compressed evidence blocks. The output unit is used to compile and concatenate the structured semantic prefix, compressed evidence block and current question text into the final prompt input large language model; The control large language model combines the evidence identifiers within the core evidence layer to output a step-by-step deduction answer. The step-by-step deduction answer includes the final conclusion, the step-by-step deduction process, tips on common mistakes, and suggestions for variation exercises.
[0014] Preferably, the suspension conditions specifically include: When the conflict rate of the boundary evidence layer is lower than the preset threshold, it is determined that the suspension condition has not been triggered. When the conflict rate of the boundary evidence layer is not lower than the preset threshold, or when an abnormal trigger item is triggered, the suspension condition is determined to be triggered. The abnormal triggering items include: in the boundary evidence layer, keywords in the current question text are mapped to two or more concept nodes with mutual exclusion relationships through relation indexing, and after extracting condition slots based on the preset condition template corresponding to the question type, there are key condition slots that are empty; The beneficial effects of this invention are as follows: This invention constructs a coarse-grained multi-dimensional index of multi-source original teaching resources and deeply integrates it with teaching event tags; it utilizes the intersection-union ratio of feature sets to construct tolerance-based information granularities, overcoming the limitations of hard partitioning and improving the recall rate and information granularity representation power of the initial candidate set. Tolerance matroid optimization maximizes the information space rank gain within the context length budget, finely dividing the core and boundary evidence layers to eliminate data redundancy. Through structured semantic prefixes and compressed evidence blocks, it achieves deep semantic alignment of the large language model, intelligently intercepting and suspending the generation process when facing conflicts or empty key condition slots, effectively suppressing the illusion of a large language model and ensuring that the output step-by-step derivation answer has extremely high teaching accuracy and logical robustness. Attached Figure Description
[0015] Figure 1 This is a basic flowchart of an intelligent teaching question-and-answer system based on natural language processing, provided as an embodiment of the present invention. Detailed Implementation
[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0017] Example, refer to Figure 1 This paper presents an intelligent teaching question-and-answer system based on natural language processing, including a preprocessing module, a tolerance calculation module, a structure hierarchical module, and an alignment control module. The preprocessing module is used to segment the original teaching resources into teaching knowledge fragments and build an index, and to receive the current question text input by the student to generate teaching event tags; The tolerance calculation module is used to retrieve the initial candidate set through indexing and to construct tolerance relationships and tolerance class information granules. The structural layering module is used to construct the rank function of the tolerance matroid structure through tolerance-type information granules, select the independent evidence representative set based on the greedy algorithm, and divide it into the core evidence layer and the boundary evidence layer. The alignment control module is used to construct a structured semantic prefix and concatenate it with compressed evidence blocks into the input large language model. Based on the core evidence layer and the boundary evidence layer, it outputs step-by-step derivation answers and clarification follow-up texts.
[0018] In a specific embodiment, the preprocessing module includes an acquisition unit and a feature construction unit; The acquisition unit is used to acquire the original teaching resources and segment the original teaching resources into text according to the smallest knowledge fragments to obtain teaching knowledge fragments. The smallest knowledge fragments include textbook definition blocks, lecture note theorem blocks, PPT method blocks, common mistake description blocks, and problem-solving step blocks; The feature construction unit is used to extract the structured features of each teaching knowledge segment, form a feature set from the structured features, and build an index for the teaching knowledge segments in parallel. Structured features include concept labels, question type labels, step phrases, and error reason labels; Indexes include vector indexes, structured feature indexes, and relation indexes.
[0019] Specifically, the processing logic for acquiring original teaching resources includes obtaining textbook texts, teacher handouts, classroom PPTs, exercise solution documents, and historical Q&A records through a teaching resource access interface; uniformly converting the original teaching resources from different sources into a single format; using a text parsing program to identify chapter titles, knowledge point titles, question type identifiers, step numbers, and annotation areas, and then segmenting them. For definition-type content, complete definition statements are used as textbook definition blocks; for theorem-type content, theorem descriptions and their conditions are used as handout theorem blocks; for method-type content, the step descriptions corresponding to a single problem-solving method are used as PPT method blocks; for error analysis-type content, error causes and correction explanations are used as error-prone point description blocks; for problem-solving content, the continuous derivation steps of a single problem are used as problem-solving step blocks; after segmentation, each teaching knowledge segment is assigned a unique segment identifier and written into the teaching knowledge base for unified storage.
[0020] The specific processing logic for extracting the structured features of each teaching knowledge segment includes word segmentation and syntactic analysis of the teaching knowledge segment to identify subject-specific terms, formula names, question type descriptions, and action verbs; matching the core concepts in the teaching knowledge segment with a pre-set concept dictionary to generate concept tags. The pre-set concept dictionary includes concept name, concept alias, concept category, hierarchical relationship between concepts, and corresponding subject identifier; for example, in mathematics, the graphs of quadratic functions, parabolic functions, and square functions can be mapped to the same core concept node; and matching the terms in the teaching knowledge segment with the pre-set concept dictionary to generate corresponding concept tags to enhance the knowledge consistency between different teaching resources.
[0021] This system utilizes question type rule templates to identify the characteristics of multiple-choice questions, proof questions, function questions, and experimental questions, generating question type tags. The templates include keyword rules, logical structure rules, condition expression rules, and solution objective rules. Keyword rules identify keywords related to solving, proving, simplifying, and analyzing questions. Logical structure rules identify conditional and derivational structures within the question. Condition expression rules identify known, restrictive, and implicit conditions. Solution objective rules identify the evaluation, proof, and reasoning objectives of the question. For example, when a teaching knowledge segment simultaneously contains known, to-be-proven, and proof elements, it can be identified as a proof question; when domain, function expression, and monotonicity appear, it can be identified as a function question. Using question type rule templates improves the consistency and accuracy of question type tag generation.
[0022] Extract the action descriptions in the problem-solving process, identify the steps of substitution, simplification, classification and discussion, and construction of auxiliary lines, and generate step phrases; combine historical wrong question data and common mistake identification, symbol omission, unit error, and condition misjudgment to generate error cause labels; combine concept labels, question type labels, step phrases and error cause labels to form a feature set of corresponding teaching knowledge segments.
[0023] The specific processing logic for parallel indexing of teaching knowledge fragments includes simultaneously initiating vector indexing, structured feature indexing, and relation indexing processes for each teaching knowledge fragment. The vector indexing process is used to semantically encode the teaching knowledge fragments and generate vector representations, which are then written into the vector retrieval library according to vector similarity. The structured feature indexing process is used to establish inverted mapping relationships between concept tags, question type tags, step phrases, and error cause tags, supporting keyword retrieval. The relation indexing process is used to analyze the dependency, inclusion, prerequisite, and mutual exclusion relationships between teaching knowledge fragments and generate relation connection records. The three indexing processes are executed synchronously using a parallel task scheduling method, and are uniformly associated with the corresponding teaching knowledge fragment identifier after the indexing is completed.
[0024] In a specific embodiment, the preprocessing module further includes a marker generation unit; The tag generation unit is used to receive the current question text input by the student and obtain the student's current learning status and the time information of the current question. The current question text is converted into a text vector using a text encoder. The current learning state and the time information of the current question are mapped into a teaching state signal. The text vector and the teaching state signal are then fused and encoded to generate a teaching event marker.
[0025] Specifically, the system obtains the student's current learning status and the time of the current question, and reads the student's recent course learning progress, historical answer results, wrong answer records, knowledge point mastery, and most recent practice score through the learning record interface in the teaching platform; and generates the current learning status based on the knowledge point accuracy rate, the number of repeated errors, and the learning duration. Read the system time when the current question was asked to obtain the question date, question time period, and time interval since the most recent learning behavior; among them, the time information of the current question is automatically recorded by the teaching platform server.
[0026] The specific processing logic for converting the current question text into a text vector using a text encoder includes word segmentation, stop word filtering, and semantic cleaning of the current question text, retaining subject keywords, condition descriptions, and question objectives; inputting the processed text into a pre-trained text encoding model to extract contextual semantic features from the current question text; and performing semantic mapping on the conceptual associations, logical relationships, and problem-solving intentions in the question through the encoding layer, outputting the corresponding high-dimensional semantic representation results, which serve as the text vector corresponding to the current question text.
[0027] The pre-trained text encoding model includes a word embedding layer, a context semantic extraction layer, and a semantic mapping layer. The word embedding layer converts words in the current question text into corresponding word vector representations. The context semantic extraction layer analyzes the contextual relationships between words. The semantic mapping layer generates high-dimensional semantic representations with a unified dimension. The pre-trained text encoding model preferably utilizes the BERT model. During the training phase, the pre-trained text encoding model is trained using textbook texts, problem solution texts, classroom handouts, and historical question-and-answer data to enhance its semantic recognition capabilities for conceptual associations, question type expressions, and problem-solving intentions in teaching scenarios.
[0028] The specific processing logic for mapping the current learning state and the time information of the current question to the teaching state signal includes: quantifying the knowledge mastery level, error frequency, learning stage and practice activity in the current learning state; discretizing and encoding the questioning period, time interval and learning continuity in the time information of the current question; setting corresponding state identifiers according to different state characteristics; converting them into a unified-dimensional state representation result through a state mapping network; and combining the learning state characteristics with the time characteristics to form the teaching state signal.
[0029] Based on different state characteristics, corresponding state labels are set, and corresponding state classification labels are established for different state categories in the current learning state and the current questioning time information. Among them, the level of knowledge mastery corresponds to the mastery state label, the frequency of incorrect questions corresponds to the error state label, the learning stage corresponds to the stage state label, the practice activity corresponds to the activity state label, the questioning time corresponds to the time state label, and the learning continuity corresponds to the continuous state label. The level of knowledge mastery is divided into low mastery, medium mastery, and high mastery, and corresponding mastery state labels are set for each. The frequency of incorrect questions is divided into low error frequency, medium error frequency, and high error frequency, and corresponding error state labels are set for each. The learning stage is divided into the preview stage, classroom learning stage, review stage, and sprint stage, and corresponding stage state labels are set for each. The practice activity is divided into low activity, medium activity, and high activity, and corresponding activity state labels are set for each. The questioning time is divided into classroom time, self-study time, and pre-exam time, and corresponding time state labels are set for each. The learning continuity is divided into continuous learning and intermittent learning, and corresponding continuous state labels are set for each. Each state identifier is converted into a corresponding state vector using a discrete encoding method, and then input into a state mapping network for unified dimensional mapping.
[0030] The specific processing logic for fusing and encoding text vectors and teaching state signals to generate teaching event markers includes: dimensional alignment of text vectors and teaching state signals; inputting the two types of features into the fusion encoding network; analyzing the correspondence between the current question text and the current learning state using an attention association mechanism to strengthen semantic features related to the current learning stage; and performing context compression and feature aggregation on the fused result to generate a unified representation that can simultaneously reflect the question semantics, learning state, and timing of the question, which is then output as a teaching event marker.
[0031] Teaching status signals include knowledge mastery status signals, error behavior status signals, learning stage status signals, learning activity status signals, and time status signals. Among them, the knowledge mastery status signal indicates the degree to which students have mastered the corresponding knowledge points; the error behavior status signal indicates the distribution of students' errors in the current knowledge domain; the learning stage status signal indicates the current learning progress stage of students; the learning activity status signal indicates the intensity of students' recent learning behavior; and the time status signal indicates the time environment corresponding to the current question.
[0032] In a specific embodiment, the specific processing logic of the tolerance calculation module includes: Using text vectors and vector indexes, semantic retrieval is performed in the teaching knowledge base to obtain the first candidate set; By using keywords in the current problem text and employing structured feature indexing, keyword retrieval is performed in the teaching knowledge base to obtain a second candidate set; The first candidate set and the second candidate set are merged to obtain the initial candidate set, and the tolerance relationship is constructed using the initial candidate set; Based on tolerance relations, the teaching knowledge fragment x in the initial candidate set and the teaching knowledge fragments with non-zero similarity to it are aggregated to obtain tolerance-type information particles centered on the teaching knowledge fragment x.
[0033] Specifically, the teaching knowledge base is a data set used to store teaching knowledge fragments, structured features, index information, and relationship information between teaching knowledge fragments. The teaching knowledge base includes data records corresponding to textbook definition blocks, lecture theorem blocks, PPT method blocks, common mistake description blocks, and problem-solving step blocks, as well as vector indexes, structured feature indexes, and relationship indexes. It is used to support semantic recall, keyword recall, tolerance relationship construction, and step-by-step derivation of answer generation.
[0034] Specifically, the processing logic for semantic retrieval in the teaching knowledge base using text vectors and vector indexing includes: inputting the text vector corresponding to the current question text into vector retrieval; searching the vector index for the teaching knowledge fragment with the closest semantic distance; generating text vectors for the current question text and fragment vectors for the teaching knowledge fragment using a pre-trained text encoding model; normalizing each vector and calculating the cosine similarity between the text vector and the fragment vector to obtain the corresponding similarity results; the closer the two vectors are in direction, the higher the semantic association between the current question text and the corresponding teaching knowledge fragment in terms of concept expression, problem-solving intention, and step logic, and the closer the similarity result is to 1; when the two vectors are significantly different in direction, the similarity result is closer to 0; the system then performs semantic retrieval based on the teaching knowledge fragments... The similarity results of the corresponding segments are sorted; teaching knowledge segments with similarity results higher than the preset recall threshold are selected and the first candidate set is formed according to the similarity results from high to low; the specific processing logic of keyword recall in the teaching knowledge base using keywords in the current question text through structured feature index includes extracting concept words, question type words, step action words and condition descriptive words from the current question text; matching the extracted keywords with concept tags, question type tags, step phrases and error cause tags in the structured feature index; calculating the matching score based on the number of matches and the degree of association between keywords and tags; selecting teaching knowledge segments with matching scores higher than the preset matching threshold and forming the second candidate set; among them, keyword recall focuses on retaining teaching knowledge segments that have a direct knowledge point correspondence with the current question text.
[0035] The preferred range for the preset recall threshold is 0.60 to 0.85. When the preset recall threshold is below 0.60, the system is prone to recalling a large number of teaching knowledge fragments with weak semantic connections, resulting in too much irrelevant content in the first candidate set and increasing redundant information in the subsequent tolerance relationship construction process. When the preset recall threshold is above 0.85, it is easy to miss some teaching knowledge fragments that, although expressed differently, have actual teaching relevance, thus reducing the semantic recall coverage. The preferred range for the preset matching threshold is 0.40 to 0.70. When the preset matching threshold is below 0.40, only a small amount of keyword overlap can enter the second candidate set, which can easily lead to overly broad structured feature matching results. When the preset matching threshold is above 0.70, it is easy to miss some teaching knowledge fragments whose keyword expression is incomplete but actually belong to the same knowledge point.
[0036] The specific processing logic for aggregating teaching knowledge fragments x in the initial candidate set with teaching knowledge fragments that have non-zero similarity includes: sequentially traversing each teaching knowledge fragment x in the initial candidate set; comparing the feature set of teaching knowledge fragment x with the feature set of other teaching knowledge fragments; determining that there is a semantic relationship between two teaching knowledge fragments when the similarity between them is greater than zero; taking teaching knowledge fragment x as the center, grouping all teaching knowledge fragments that meet the non-zero similarity condition into the same aggregation range; establishing an association set for teaching knowledge fragments within the aggregation range and forming corresponding tolerance-type information particles; wherein, teaching knowledge fragments in the same tolerance-type information particle are allowed to have local differences, but the relevance in terms of knowledge theme and problem-solving logic must be maintained.
[0037] In a specific embodiment, the specific processing logic for constructing tolerance relationships through an initial candidate set includes: The similarity is the ratio of the number of elements in the intersection of the feature set of teaching knowledge fragment x and the feature set of teaching knowledge fragment y in the initial candidate set to the number of elements in the union. When the similarity is not less than the tolerance threshold, it is determined that x and y satisfy the tolerance relationship, and the tolerance relationship value is the similarity. When the similarity is less than the tolerance threshold, it is determined that x and y do not satisfy the tolerance relationship, and the tolerance relationship value is 0.
[0038] Specifically, the tolerance threshold is set based on the knowledge distribution of different subjects in the teaching knowledge base and the historical question-and-answer matching results. During the initialization phase of teaching resources, the correct matching records in the historical question-and-answer data are read, the similarity distribution between the current question text and the corresponding teaching knowledge fragment is statistically analyzed, and the recall effect corresponding to different similarity intervals is analyzed. When the similarity is too low, although it can expand the recall range, it will introduce a large number of teaching knowledge fragments with weak semantic connections, reducing semantic accuracy. When the similarity is too high, although it can improve semantic accuracy, it is easy to miss teaching knowledge fragments with different expressions but actually belonging to the same knowledge point, reducing recall completeness. Therefore, a similarity boundary range that can maintain high recall completeness and high semantic accuracy is selected as the similarity boundary, and the value corresponding to this similarity boundary is used as the initial tolerance threshold.
[0039] The correct recall rate, false recall rate, and knowledge coverage rate are statistically analyzed under different similarity intervals. When a certain similarity interval can simultaneously satisfy the conditions that the correct recall rate is higher than the preset accuracy requirement, the false recall rate is lower than the preset false recall requirement, and the knowledge coverage rate remains stable, the lower boundary of the corresponding interval is taken as the similarity boundary. The preset accuracy requirement is preferably set to 0.75 to 0.90. When the preset accuracy requirement is lower than 0.75, even if there are many semantically deviating teaching knowledge fragments in the recall results, the system may still determine that the current similarity interval is valid, thereby reducing the accuracy of the tolerance relationship construction. When the preset accuracy requirement is higher than 0.90, it will lead to an excessive pursuit of strict matching, which may easily miss teaching knowledge fragments that are different in expression but actually related, thereby reducing the knowledge coverage ability. The preset false recall requirement is preferably set to 0.10 to 0.25. When the preset false recall requirement is lower than 0.10, the control over false recall is too strict, which may lead to the filtering of a large number of marginally related but auxiliary teaching knowledge fragments. When the preset false recall requirement is higher than 0.25, it may allow too many low-relevance teaching knowledge fragments to enter the candidate set, increasing the probability of conflict and contextual redundancy in the subsequent tolerance relationship construction.
[0040] For example, in a mathematics teaching scenario, when the similarity reaches 0.65 or higher, most teaching knowledge segments can maintain relatively stable conceptual connections and problem-solving logic consistency. In this case, 0.65 can be used as the initial tolerance threshold for the corresponding subject.
[0041] During system operation, the tolerance threshold is dynamically adjusted based on the number of follow-up questions from students, the number of answer corrections, and teacher feedback. When the recall results are too scattered, the tolerance threshold is increased; when the recall results are too few, the tolerance threshold is decreased. The tolerance threshold is used to control the minimum similarity requirement for establishing tolerance relationships between teaching knowledge segments.
[0042] The adjustment logic of the tolerance threshold is to read the question type label and teaching status signal in the teaching event marker. When the question type is determined to be a subjective open discussion and the student's mastery is lower than the preset benchmark, the tolerance threshold is lowered to expand the generalization boundary of the tolerance information particles. When the question type is determined to be an objective standard question and the student's mastery is higher than the preset benchmark, the tolerance threshold is raised to tighten the similarity admission conditions of the tolerance information particles.
[0043] The preset benchmark is preferably set between 0.60 and 0.75. When the preset benchmark is lower than 0.60, the system is prone to over-expanding the recall range, resulting in an increase in redundant knowledge fragments. When the preset benchmark is higher than 0.75, a large number of students are likely to be judged as having low mastery, thus frequently lowering the tolerance threshold and affecting the accuracy of semantic screening. Therefore, setting the preset benchmark between 0.60 and 0.75 can better balance the knowledge expansion capability and the accuracy of evidence screening.
[0044] It should be noted that in current technologies, teaching knowledge fragments representing the initial candidate set are usually obtained through vector retrieval and keyword matching. This invention creatively incorporates the intersection-union ratio of the structured feature set of teaching knowledge fragments into the tolerance threshold determination, resulting in corresponding tolerance-class information granules that can be aggregated based on non-zero similarity. The data in these tolerance-class information granules can simultaneously represent the semantic relevance of teaching knowledge fragments and the meaning of coarse-grained multidimensional feature overlap. This solves the problems of information isolation, ambiguous boundaries, and insufficient semantic representation in traditional hard partitioning retrieval, laying a solid data structure foundation for the rank function calculation and refined layering processing of the matroid structure input to the structure layering module in the following text. Thus, through the multidimensional feature soft aggregation method, an innovative effect of high recall and accurate representation of multi-information granularity is obtained.
[0045] In a specific embodiment, the specific processing logic of the structural layering module includes: Construct tolerance matroid structures for all tolerance-type information granules and calculate the rank function of the tolerance matroid structures; In the initial candidate set, with the joint objective of maximizing the rank gain of the rank function and maximizing the semantic relevance score with the teaching event label, a greedy algorithm is used to introduce teaching knowledge fragments one by one until the context length budget is reached, so as to obtain the independent evidence representative set. Retrieve the tolerance class information particles corresponding to each teaching knowledge fragment in the independent evidence representative set under the tolerance relation, and merge the teaching knowledge fragments included in each tolerance class information particle to obtain the closure evidence set; Teaching knowledge fragments that belong to the independent evidence representative set and satisfy the stability closed set condition are classified into the core evidence layer. If no teaching knowledge fragment in the independent evidence representative set satisfies the stability closed set condition, they are sorted in descending order according to the comprehensive selection weight, and the first N fragments are set as the core evidence layer, where N is an integer greater than or equal to 1. Teaching knowledge fragments that belong to the closure evidence set but not to the independent evidence representative set are classified into the boundary evidence layer; The stability closed set condition is that the rank gain of the teaching knowledge segment is not less than the rank gain threshold and the correlation with the teaching event label is not less than the correlation threshold.
[0046] Specifically, constructing a tolerance matroid structure for all tolerance-class information particles means treating each tolerance-class information particle as a set of evidence with internal relationships, and establishing a structured selection system among all tolerance-class information particles that can describe which teaching knowledge fragments belong to valid independent evidence; wherein, the tolerance matroid structure is used to characterize the independence, redundancy and coverage relationships among teaching knowledge fragments.
[0047] The joint objective of maximizing the rank gain of the rank function and maximizing the semantic relevance score with the teaching event label indicates that when selecting teaching knowledge fragments, the system does not only consider a single indicator, but also pursues two optimization directions simultaneously. The first optimization direction is to maximize the contribution of the current teaching knowledge fragment to the overall knowledge coverage, that is, to expand the effective knowledge coverage as much as possible. The second optimization direction is to maximize the semantic matching degree between the current teaching knowledge fragment and the current question text, the current learning state, and the current questioning scenario, that is, to enhance the relevance of the question as much as possible.
[0048] Among them, maximizing the rank gain of the rank function refers to the system prioritizing the selection of teaching knowledge fragments that can introduce new tolerance-type information particles and new knowledge coverage areas. For example, when a teaching knowledge fragment contains new question-type steps, new conceptual relationships, and new error-prone points, its addition will increase the rank function value of the tolerance matroid structure, indicating that the teaching knowledge fragment has a new contribution to the overall knowledge coverage. By pursuing the rank gain maximization, the system can reduce the problem of repeated selection of duplicate knowledge fragments.
[0049] Maximizing the semantic relevance score of teaching event markers means that the system prioritizes the selection of teaching knowledge fragments that are more closely matched with the current question text, the current learning state, and the current questioning time environment. For example, when the current question text is a function proof question and the student is currently in a low mastery state, the system will prioritize the selection of teaching knowledge fragments related to the function proof steps, typical errors, and basic derivation process. By pursuing the maximization of semantic relevance scores, the system can enhance the problem-focusing ability in the answer generation process.
[0050] The preferred setting range for the rank gain threshold is 0.15 to 0.40, and the preferred setting range for the relevance threshold is 0.60 to 0.85. When the rank gain threshold is too low, a large number of repetitive teaching knowledge fragments will be classified into the core evidence layer, reducing the independence of the evidence. When the rank gain threshold is too high, some important teaching knowledge fragments that have a supplementary role may be missed. When the relevance threshold is too low, it is easy to introduce teaching knowledge fragments that are not strongly related to the current question text, affecting the focus of the answer. When the relevance threshold is too high, it may lead to an overly narrow recall range, reducing the knowledge coverage.
[0051] In a specific embodiment, the rank function of the tolerance matroid structure is calculated as follows: ; in, A subset of evidence, For teaching knowledge segments Tolerance-type information granules, The value of the rank function. For the modulus of the set, This is the tolerance threshold. This refers to the tolerance relationship.
[0052] In a specific embodiment, the specific processing logic for obtaining the independent evidence representative set includes: After adding the currently unselected teaching knowledge segments to the selected evidence subset, the positive difference generated by the rank function is used as the current rank gain; Calculate the semantic relevance score between the teaching knowledge segment and the teaching event marker; The current rank gain and semantic relevance score are normalized, and the normalized current rank gain and semantic relevance score are weighted and summed to obtain the comprehensive selection weight. The teaching knowledge fragment with the highest comprehensive selection weight is added to the selected evidence subset until the total token length of the added teaching knowledge fragments reaches the context length budget, and then the independent evidence representative set is output.
[0053] Specifically, the selected evidence subset refers to the set of teaching knowledge fragments that have been selected and retained by the system during the greedy selection process. Each time, the teaching knowledge fragment with the highest comprehensive selection weight is selected from the unselected teaching knowledge fragments and added to the selected evidence subset. Based on the updated selected evidence subset, the contribution of subsequent teaching knowledge fragments is recalculated, and finally, the independent evidence representative set is obtained.
[0054] The positive difference generated by the rank function is used as the current rank gain because adding a teaching knowledge segment to the selected evidence subset may add tolerance-type information particles that were not originally covered. For example, when the newly added teaching knowledge segment can introduce new concept labels, question type labels, and step phrases, the rank function value will increase, and the added part is the positive difference. If no new coverage is generated after adding it, the rank function value remains unchanged, and the current rank gain approaches zero, indicating that there is a high degree of redundancy between the teaching knowledge segment and the selected evidence subset.
[0055] The specific processing logic for calculating the semantic relevance score between the teaching knowledge segment and the teaching event marker includes: inputting the teaching knowledge segment and the teaching event marker into the semantic matching model respectively, and extracting the corresponding contextual semantic representation; analyzing the consistency of concepts, question types, steps, and the degree of matching of learning states through the semantic alignment module; calculating the similarity based on the distance relationship between semantic vectors, and dynamically correcting the matching results in combination with the current learning state; and finally outputting the semantic relevance score between the corresponding teaching knowledge segment and the teaching event marker.
[0056] The semantic matching model is used to identify the matching relationship between two things in terms of concept expression, question structure, step logic and learning state, and output the corresponding semantic relevance score; the semantic matching model includes a semantic encoding layer, a semantic interaction layer and a relevance calculation layer.
[0057] The semantic encoding layer is used to extract contextual semantic features from teaching knowledge fragments and teaching event markers, respectively. The teaching knowledge fragments represent candidate knowledge content, and the teaching event markers represent the current question text, the current learning state, and the current questioning time environment. The semantic encoding layer preferably adopts a semantic encoding model based on the Transformer architecture and extracts the corresponding semantic representation results through a contextual attention mechanism.
[0058] The semantic interaction layer is used to establish semantic correspondence between teaching knowledge fragments and teaching event tags; it includes concept consistency analysis, question type consistency analysis, step correlation analysis, and learning state matching analysis. Among them, concept consistency analysis is used to determine whether the two involve the same or similar knowledge concepts; question type consistency analysis is used to determine whether the two belong to the same question type structure; step correlation analysis is used to determine whether the problem-solving steps in the teaching knowledge fragment are consistent with the derivation requirements of the current problem text; and learning state matching analysis is used to determine whether the difficulty of the teaching knowledge fragment is suitable for the current student's learning state.
[0059] The relevance calculation layer is used to generate the final semantic relevance score based on the semantic encoding results and semantic interaction results. Specifically, the relevance calculation layer obtains the basic semantic matching result by calculating the distance relationship between the semantic vector of the teaching knowledge fragment and the semantic vector of the teaching event label. Then, the matching result is corrected in combination with the current learning state, and the semantic relevance score between the corresponding teaching knowledge fragment and the teaching event label is output.
[0060] The semantic matching model preferably adopts the BERT dual-tower matching model. The semantic matching model is trained using textbook text, solution text, historical question and answer records and teacher-annotated data, so that the model can learn the semantic correspondence between teaching knowledge fragments and teaching questions, thereby improving the accuracy of semantic relevance score calculation and teaching adaptability.
[0061] The weights for the weighted summation of the normalized current rank gain and semantic relevance score are shown in Table 1. The study validated different weight combinations in various scenarios, including basic concept teaching, standard step derivation, comprehensive derivation, error analysis, and open discussion. The redundancy rate of the independent evidence representative set was used to calculate the proportion of repeated teaching knowledge fragments entering the independent evidence representative set. The semantic focus accuracy rate was used to calculate the proportion of generated answers consistent with the semantic target of the current question text. The step-by-step derivation completeness rate was used to calculate the proportion of key derivation steps completely retained during answer generation. The average teacher evaluation score used a percentage-based teaching quality scoring method. The average number of follow-up questions asked by students was used to calculate the average number of times students asked supplementary questions after receiving the answer. When the normalized weight of the semantic relevance score is too high, although the accuracy of question semantic focus can remain at a high level, the redundancy rate of the independent evidence representative set increases significantly, resulting in insufficient knowledge coverage. When the normalized weight of the current rank gain is too high, although the completeness rate of step-by-step derivation remains at a high level, the accuracy of question semantic focus decreases significantly, and it is easy to introduce marginal teaching knowledge fragments, resulting in increased contextual redundancy. Therefore, based on the above verification results, it can be determined that setting both the normalized weight of the current rank gain and the normalized weight of the semantic relevance score to 0.50 is the best way to balance knowledge coverage, question semantic focus, and step-by-step derivation stability.
[0062] The total token length refers to the total text length of all teaching knowledge fragments added to the selected evidence subset before being input into the large language model. The total token length is calculated based on the number of tokens after text encoding within the large language model. A token is the smallest semantic processing unit after the large language model segments the input text. One token can correspond to a Chinese character, word, symbol, or part of a semantic fragment. Before inputting the teaching knowledge fragments into the large language model, the corresponding word segmentation encoder is used to encode the teaching knowledge fragments into tokens. The total number of tokens after encoding all teaching knowledge fragments is counted to obtain the total token length.
[0063] The context length budget refers to the maximum available token capacity range pre-allocated by the system for a single reasoning process of the large language model; it is used to limit the total token length of the structured semantic prefix, compressed evidence block, and current question text input to the large language model; during the construction of the independent evidence representative set, the total token length corresponding to the currently selected teaching knowledge fragment is continuously counted; when a new teaching knowledge fragment is added and the total token length reaches or approaches the context length budget, the introduction of new teaching knowledge fragments is stopped and the current independent evidence representative set is output.
[0064] In this method, when the large language model supports an 8192-Token context window, it is preferable to reserve a portion of the token capacity for subsequent answer generation. Therefore, the context length budget can be preferably set to 60% to 85% of the maximum context window. By reserving the remaining token capacity, the context overflow problem can be avoided during the generation of step-by-step reasoning answers by the large language model. When the context length budget is less than 60% of the maximum context window, the system is prone to missing key teaching knowledge fragments due to insufficient evidence capacity, thereby reducing the completeness of knowledge coverage. When the context length budget is greater than 85% of the maximum context window, it is easy to introduce too many marginal teaching knowledge fragments, resulting in increased context redundancy and increased computational burden on the large language model during reasoning.
[0065] It should be noted that in current technologies, knowledge fragments representing the context input of a large model are typically obtained by setting a fixed threshold and a single relevance score. This invention integrates the rank function of the tolerance matroid structure into the step-by-step introduction strategy of the greedy algorithm, resulting in a corresponding independent evidence representative set and a closure evidence set that can be dynamically adjusted according to the context length budget. The data in this independent evidence representative set and closure evidence set can simultaneously represent the maximum information space rank gain under the minimum number of tokens and the meaning related to the deep semantics of the teaching event label. This solves the problems of evidence information redundancy, key evidence being buried by noise, and blurred distinction between core and boundary in traditional retrieval enhancement generation technology within a limited context window. It lays a foundation of evidence set with high information density and logical hierarchy for the step-by-step derivation and triggering suspension mechanism input into the large language model in the following text. The innovative effect of maximizing information coverage and refined redundancy removal is obtained through matroid theory optimization.
[0066] In a specific embodiment, the alignment control module includes a determination unit, a prefix construction unit, a splicing unit, and an output unit; The decision unit is used to calculate the conflict rate within the boundary evidence layer by comparing the conflict fragment pairs determined by the relation index with all teaching knowledge fragment pairs, and to determine whether the suspension condition is triggered. When it is determined that the suspension condition has not been triggered, the control flow is distributed to the prefix construction unit and the splicing unit; When the suspension condition is triggered, the large language model answer generation process is intercepted and suspended. The key missing features that cause the largest decrease in conflict rate in the boundary evidence layer are extracted, and the clarification follow-up text is generated and output. Specifically, control flow refers to the logical scheduling mechanism within the system used to control the execution direction of the processing flow. In this method, control flow is used to determine whether to continue the large language model answer generation process or enter the clarification and follow-up questioning process based on the conflict rate result of the boundary evidence layer. When the suspension condition is not triggered, control flow continues to be distributed to the prefix construction unit and the splicing unit. When the suspension condition is triggered, control flow interrupts the answer generation process and switches to the clarification and follow-up questioning generation process.
[0067] Key missing features are the feature items required to fill in the key condition slots and the feature items required to eliminate ambiguity in mutually exclusive concept nodes.
[0068] The prefix construction unit is used to filter out the set of word prototypes from the word embedding space of the large language model, extract the semantic anchor phrases of the current question text and the teaching knowledge fragments in the core evidence layer, and construct a structured semantic prefix using the semantic anchor phrases and the set of word prototypes. The splicing unit is used to retain teaching knowledge fragments with rank gains higher than a preset intensity based on the rank gain of independent evidence representing a set of teaching knowledge fragments, extract summaries of teaching knowledge fragments with rank gains close to zero, and assemble them into compressed evidence blocks. The output unit is used to compile and concatenate the structured semantic prefix, compressed evidence block, and current question text into the final prompt input large language model; The control large language model combines evidence identifiers within the core evidence layer to output step-by-step deduction answers. The step-by-step deduction answers include the final conclusion, the step-by-step deduction process, tips on common mistakes, and suggestions for variation exercises.
[0069] Specifically, the large language model in this method is a large language model built based on the Transformer architecture. The specific processing logic for selecting the word prototype set from the word embedding space of the large language model includes: reading the word vector representations corresponding to high-frequency teaching semantic words in the pre-trained word vectors within the large language model; high-frequency teaching semantic words are those whose frequency in textbook texts, lecture notes, problem-solving texts, and historical Q&A corpora exceeds a preset word frequency threshold; calculating the semantic distance between the word vectors corresponding to each high-frequency teaching semantic word, and performing concept clustering based on the semantic distance results; using the cosine similarity between word vectors as the clustering criterion, when the cosine similarity between two word vectors is not lower than a preset clustering threshold, the corresponding high-frequency teaching semantic words are grouped into the same cluster. The system categorizes high-frequency teaching semantic words. When a high-frequency teaching semantic word simultaneously meets the clustering conditions with multiple concept categories, it is assigned to the concept category with the smallest average semantic distance. Through continuous iterative clustering, corresponding concept clustering results are formed. These results represent the set of concept categories formed by high-frequency teaching semantic words with similar semantics. For example, "function," "monotonism," and "derivative" are clustered into a function analysis concept cluster; "proof," "derivation," and "conclusion" are clustered into a logical deduction concept cluster; and "substitution," "simplification," and "alternation" are clustered into a step-by-step operation concept cluster. Based on the concept clustering results, the core word vectors corresponding to the center positions of each concept category are selected as candidate word vectors. The preset word frequency threshold is preferably set to appear no less than 20 to 100 times. When the preset word frequency threshold is below this range, the system tends to retain a large number of low-frequency noise words, occasional expressions, and unstable teaching semantic words, leading to more semantic discrepancies in the concept clustering results. When the preset word frequency threshold is above this range, it tends to filter out some professional concept words that, although appearing less frequently, have important teaching significance, reducing the knowledge coverage of the word prototype set for the teaching scenario. The preset clustering threshold is preferably set between 0.70 and 0.90. When the preset clustering threshold is lower than 0.70, the system is prone to incorrectly aggregating teaching semantic words with weak semantic associations into the same concept category, thereby reducing the category purity of the concept clustering results. When the preset clustering threshold is higher than 0.90, it is prone to incorrectly splitting teaching semantic words that originally belong to the same teaching concept category but have different expressions, thereby reducing the semantic generalization ability of the concept clustering results. Therefore, setting the preset clustering threshold between 0.70 and 0.90 can better balance the category purity and semantic coverage of the concept clustering results.
[0070] Candidate word vectors undergo category purity analysis and semantic stability analysis. Category purity analysis is used to statistically determine the proportion of candidate word vectors belonging to their respective concept categories. A candidate word vector is considered to meet the category purity condition when the average similarity between it and word vectors within its own concept category is greater than the average similarity between it and word vectors from other concept categories. Semantic stability analysis is used to statistically determine the degree of contextual semantic shift of candidate word vectors in textbook texts, lecture notes, problem-solving texts, and historical Q&A. A candidate word vector is considered to meet the semantic stability condition when the semantic distance fluctuation value in different teaching scenarios does not exceed a preset fluctuation threshold. Candidate word vectors that do not meet the category purity and semantic stability conditions are removed. The preset fluctuation threshold is preferably set between 0.10 and 0.30. When the preset fluctuation threshold is below 0.10, it is easy to incorrectly filter out some candidate word vectors that maintain core semantic consistency despite reasonable changes in teaching scenarios, thereby reducing the knowledge coverage capability of the word prototype set. When the preset fluctuation threshold is above 0.30, it is easy to allow candidate word vectors with large semantic drift to enter the word prototype set, reducing the semantic constraint stability of the structured semantic prefix on the large language model.
[0071] Candidate word vectors that satisfy the category purity and semantic stability conditions are retained as a word prototype set; the word vectors in the word prototype set are used to represent stable teaching semantic categories and to provide semantic guidance in the subsequent process of constructing structured semantic prefixes.
[0072] Semantic anchor phrases are key phrases that can stably express the core semantics of the current problem text and the main knowledge content of the core evidence layer. Semantic anchor phrases usually include concept names, question type expressions, key condition descriptions, core step phrases, and error-prone prompts. Semantic anchor phrases are used to establish the semantic correspondence between the current problem text and the core evidence layer.
[0073] The specific processing logic for constructing structured semantic prefixes using semantic anchor phrases and word prototype sets includes: firstly, extracting semantic anchor phrases from the current question text and the core evidence layer; secondly, matching the word prototypes in the word prototype set that are semantically closest to the semantic anchor phrases; and thirdly, organizing the corresponding word prototypes according to a hierarchical structure based on concept categories, step logic, and question type relationships to generate structured semantic description fragments with knowledge guidance, which serve as structured semantic prefixes. These structured semantic prefixes are used to strengthen the constraint on the reasoning direction before the large language model generates the answer.
[0074] The preferred setting range for the preset intensity is 0.05 to 0.20. When the preset intensity is too low, a large number of low-value teaching knowledge fragments will be retained in the complete text, increasing contextual redundancy. When the preset intensity is too high, some teaching knowledge fragments that still have supplementary significance may be compressed incorrectly. The above range can balance the efficiency of context compression and the integrity of knowledge retention.
[0075] The specific processing logic for extracting summaries from teaching knowledge fragments with rank gain approaching zero includes identifying content in the teaching knowledge fragment that has a high degree of repetition with the selected evidence subset, and retaining the differences that still have supplementary significance. The teaching knowledge fragment is segmented into sentences, and concept tags, question type tags, step phrases, and error cause tags are extracted from each sentence. The semantic relevance, keyword coverage, and step association between each sentence and the current problem text are calculated. Semantic relevance measures the semantic closeness between the corresponding sentence and the current problem text; keyword coverage measures the number of core keywords from the current problem text contained in the corresponding sentence; and step association measures the association between the corresponding sentence and the current problem-solving logic. Sentence importance scores are generated based on these results, and sentences are sorted from high to low importance. Sentences with high importance scores are retained as core statements, while duplicate derivation steps, duplicate definition descriptions, and duplicate question type explanations are deleted. Differences with supplementary significance are retained, and a summary text of the corresponding teaching knowledge fragment is generated.
[0076] The specific processing logic for assembling compressed evidence blocks includes converting the complete retained text and summary text into a structured fragment format according to the order of teaching knowledge fragments in the independent evidence representative set; attaching corresponding evidence identifiers, concept tags, and step tags to each fragment; splicing according to the arrangement rules of core evidence layer priority and boundary evidence hierarchy; compressing and deduplicating duplicate tags and phrases; and finally generating compressed evidence blocks suitable for large language model input.
[0077] The compilation of the current question text refers to converting the current question text into a unified input format suitable for processing by a large language model. Specifically, this includes standardizing the current question text, annotating keywords, organizing the conditional structure, and adding semantic tags. The current question text is then uniformly concatenated with the structured semantic prefix and compressed evidence block according to the preset prompt template to form the final prompt input.
[0078] The preset prompt template includes a task description area, a question description area, an evidence description area, a reasoning requirement area, and an output format area. The task description area specifies that the current task is a teaching question-and-answer reasoning task and limits the large language model to step-by-step deduction based on teaching knowledge fragments. The question description area is used to write the standardized text of the current question and the corresponding keyword annotation results. The evidence description area is used to write structured semantic prefixes and compressed evidence blocks. The reasoning requirement area limits the large language model to generate the answer in the order of concept analysis, conditional deduction, step expansion, and result verification. The output format area limits the final output content to include the final conclusion, the step-by-step deduction process, common mistakes, and suggestions for variation exercises.
[0079] In a specific embodiment, the suspension conditions specifically include: When the conflict rate of the boundary evidence layer is lower than the preset threshold, it is determined that the suspension condition has not been triggered. When the conflict rate of the boundary evidence layer is not lower than the preset threshold, or when an abnormal trigger item is triggered, the suspension condition is determined to be triggered. Abnormal triggering items include keywords in the current question text in the boundary evidence layer that are mapped to two or more concept nodes with mutually exclusive relationships through relation indexing, and key condition slots that are empty after extracting condition slots based on the preset condition template corresponding to the question type.
[0080] Specifically, the preferred setting range for the preset threshold is 0.25 to 0.45. When the preset threshold is too low, the system will frequently trigger the suspension condition, affecting the smoothness of normal question and answer. When the preset threshold is too high, it may miss boundary evidence layers with obvious conflicts, resulting in inconsistent answers output by the large language model.
[0081] The fact that keywords in the current problem text are mapped to two or more mutually exclusive concept nodes through the relation index means that the same keyword in the current problem text corresponds to multiple knowledge concepts that cannot be true at the same time in the relation index. For example, the same keyword corresponds to both sufficient and necessary conditions, or to two different applicable scenarios of formulas. In this case, it indicates that there is semantic ambiguity and missing conditions in the current problem text, and the system needs to further clarify it.
[0082] Preset condition templates refer to pre-established condition structure rule templates for different question types. For example, for function questions, the preset condition template includes slots for domain, monotonicity, and analytical expression; for geometry questions, the preset condition template includes slots for graph type, side length relationship, and angle relationship. Preset condition templates are used to detect whether the key conditions in the current question text are complete.
[0083] A condition slot refers to the field location in a preset condition template used to store corresponding condition information; each condition slot corresponds to a specific condition category, such as known conditions, target conditions, constraint conditions, and unit conditions; the condition content in the current question text is filled into the corresponding condition slot through information extraction.
[0084] A critical condition slot refers to a condition slot that has a decisive influence on the reasoning process of the current problem. If a critical condition slot is empty, it means that the current problem text lacks critical reasoning conditions. For example, in a function evaluation problem, the condition slot corresponding to the function expression is a critical condition slot; in a geometric proof problem, the condition slot corresponding to the graphical relationship is a critical condition slot.
[0085] It should be noted that traditional techniques control the text generated by large models by directly concatenating prompts to obtain answers, which can easily lead to semantic illusions and forced, blind answers when conditions are missing. This invention deeply integrates structured semantic prefixes and compressed evidence blocks, and inputs the resulting prompts into the large language model. Traditional answer generation is usually updated through an uninterrupted, integrated method, which leaves the technical problems of not being able to perceive logical conflicts and missing key conditions, and lacking robustness in output. The update control method adopted in this invention, which calculates the conflict rate of the boundary evidence layer and detects abnormal triggers by the decision unit, can intelligently intercept and suspend the large model generation process, effectively solving the problems of blind reasoning and illusory output of large models. It can also eliminate the logical interference of mutually exclusive nodes in the knowledge base, obtain step-by-step derivation answers or clarifying follow-up questions with high teaching accuracy, and has a good effect of significantly suppressing model illusions and adaptively guiding teaching questions and answers.
[0086] This invention extracts a representative set of independent evidence using a rank function of a tolerance matroid structure combined with a greedy algorithm. A decision unit performs alignment control based on the conflict rate of the boundary evidence layer and abnormal trigger items, adaptively generating clarification and follow-up question texts and step-by-step derivation answers. A preprocessing module achieves deep fusion of coarse-grained multidimensional indexing of original teaching resources and teaching event tags. A tolerance calculation module overcomes the limitations of hard partitioning by utilizing tolerance-class information granularity, improving the recall rate and information granularity representation of the initial candidate set. A structure layering module utilizes tolerance matroid optimization to maximize information coverage and finely divide the core and boundary evidence layers within the context length budget, eliminating data redundancy. An alignment control module achieves deep semantic alignment of the large language model through structured semantic prefixes and compressed evidence blocks. It intelligently intercepts and suspends the generation process when faced with conflicts or empty key condition slots, effectively suppressing the illusion of a large language model and ensuring that the output step-by-step derivation answers possess both pedagogical accuracy and logical robustness.
[0087] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0088] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the protection scope of the present invention. All data acquisition actions in this application are carried out in compliance with the relevant data protection laws and policies of the country where the application is located and with the authorization granted by the owner of the corresponding device.
Claims
1. An intelligent teaching question-and-answer system based on natural language processing, characterized in that, It includes a preprocessing module, a tolerance calculation module, a structural layering module, and an alignment control module; The preprocessing module is used to segment the original teaching resources into teaching knowledge fragments and build an index, and to receive the current question text input by the student to generate teaching event markers; The tolerance calculation module is used to retrieve the initial candidate set through indexing and to construct tolerance relationships and tolerance class information granules. The structural layering module is used to construct the rank function of the tolerance matroid structure through tolerance-type information granules, select the independent evidence representative set based on the greedy algorithm, and divide it into the core evidence layer and the boundary evidence layer. The alignment control module is used to construct a structured semantic prefix and concatenate it with compressed evidence blocks into the input large language model, and output step-by-step derivation answers and clarification follow-up texts based on the core evidence layer and the boundary evidence layer.
2. The intelligent teaching question-and-answer system based on natural language processing as described in claim 1, characterized in that, The preprocessing module includes an acquisition unit and a feature construction unit; The acquisition unit is used to acquire original teaching resources and segment the original teaching resources into text according to the smallest knowledge fragments to obtain teaching knowledge fragments. The minimum knowledge fragment includes a textbook definition block, a lecture theorem block, a PPT method block, a block describing common mistakes, and a problem-solving step block. The feature construction unit is used to extract the structured features of each teaching knowledge segment, form a feature set from the structured features, and build an index for the teaching knowledge segments in parallel. The structured features include concept tags, question type tags, step phrases, and error reason tags; The indexes include vector indexes, structured feature indexes, and relation indexes.
3. The intelligent teaching question-and-answer system based on natural language processing as described in claim 2, characterized in that, The preprocessing module also includes a marker generation unit; The tag generation unit is used to receive the current question text input by the student and obtain the student's current learning status and the time information of the current question. The current question text is converted into a text vector using a text encoder. The current learning state and the time information of the current question are mapped into a teaching state signal. The text vector and the teaching state signal are then fused and encoded to generate a teaching event marker.
4. The intelligent teaching question-and-answer system based on natural language processing as described in claim 3, characterized in that, The specific processing logic of the tolerance calculation module includes: Using text vectors and vector indexes, semantic retrieval is performed in the teaching knowledge base to obtain the first candidate set; By using keywords in the current problem text and employing structured feature indexing, keyword retrieval is performed in the teaching knowledge base to obtain a second candidate set; The first candidate set and the second candidate set are merged to obtain the initial candidate set, and the tolerance relationship is constructed using the initial candidate set; Based on tolerance relations, the teaching knowledge fragment x in the initial candidate set and the teaching knowledge fragments with non-zero similarity to it are aggregated to obtain tolerance-type information particles centered on the teaching knowledge fragment x.
5. The intelligent teaching question-and-answer system based on natural language processing as described in claim 4, characterized in that, The specific processing logic for constructing tolerance relationships using the initial candidate set includes: The similarity is the ratio of the number of elements in the intersection of the feature set of teaching knowledge fragment x and the feature set of teaching knowledge fragment y in the initial candidate set to the number of elements in the union. When the similarity is not less than the tolerance threshold, it is determined that x and y satisfy the tolerance relationship, and the tolerance relationship value is the similarity. When the similarity is less than the tolerance threshold, it is determined that x and y do not satisfy the tolerance relationship, and the tolerance relationship value is 0.
6. The intelligent teaching question-and-answer system based on natural language processing as described in claim 5, characterized in that, The specific processing logic of the hierarchical structural module includes: Construct tolerance matroid structures for all tolerance-type information granules and calculate the rank function of the tolerance matroid structures; In the initial candidate set, with the joint objective of maximizing the rank gain of the rank function and maximizing the semantic relevance score with the teaching event label, a greedy algorithm is used to introduce teaching knowledge fragments one by one until the context length budget is reached, so as to obtain the independent evidence representative set. Retrieve the tolerance class information particles corresponding to each teaching knowledge fragment in the independent evidence representative set under the tolerance relation, and merge the teaching knowledge fragments included in each tolerance class information particle to obtain the closure evidence set; Teaching knowledge fragments that belong to the independent evidence representative set and satisfy the stability closed set condition are classified into the core evidence layer. If no teaching knowledge fragment in the independent evidence representative set satisfies the stability closed set condition, they are sorted in descending order according to the comprehensive selection weight, and the first N fragments are set as the core evidence layer, where N is an integer greater than or equal to 1. Teaching knowledge fragments that belong to the closure evidence set but not to the independent evidence representative set are classified into the boundary evidence layer; The stability closed set condition is that the rank gain of the teaching knowledge segment is not less than the rank gain threshold and the correlation with the teaching event label is not less than the correlation threshold.
7. The intelligent teaching question-and-answer system based on natural language processing as described in claim 6, characterized in that, The expression for calculating the rank function of the tolerance matroid structure is: ; in, A subset of evidence, For teaching knowledge segments Tolerance-type information granules, The value of the rank function. For the modulus of the set, This is the tolerance threshold. This refers to the tolerance relationship.
8. The intelligent teaching question-and-answer system based on natural language processing as described in claim 7, characterized in that, The specific processing logic for obtaining the independent evidence representative set includes: After adding the currently unselected teaching knowledge segments to the selected evidence subset, the positive difference generated by the rank function is used as the current rank gain; Calculate the semantic relevance score between the teaching knowledge segment and the teaching event marker; The current rank gain and semantic relevance score are normalized, and the normalized current rank gain and semantic relevance score are weighted and summed to obtain the comprehensive selection weight. The teaching knowledge fragment with the highest comprehensive selection weight is added to the selected evidence subset until the total token length of the added teaching knowledge fragments reaches the context length budget, and then the independent evidence representative set is output.
9. The intelligent teaching question-and-answer system based on natural language processing as described in claim 8, characterized in that, The alignment control module includes a determination unit, a prefix construction unit, a splicing unit, and an output unit; The determination unit is used to calculate the conflict rate within the boundary evidence layer by comparing the conflict fragment pairs determined by the relation index with all teaching knowledge fragment pairs, and to determine whether the suspension condition is triggered. When it is determined that the suspension condition has not been triggered, the control flow is distributed to the prefix construction unit and the splicing unit; When the suspension condition is triggered, the large language model answer generation process is intercepted and suspended. The key missing features that cause the largest decrease in conflict rate in the boundary evidence layer are extracted, and the clarification follow-up text is generated and output. The prefix construction unit is used to filter out the word prototype set from the word embedding space of the large language model, extract the semantic anchor phrases of the current question text and the teaching knowledge fragments in the core evidence layer, and construct a structured semantic prefix using the semantic anchor phrases and the word prototype set. The splicing unit is used to retain the complete text of teaching knowledge fragments with rank gains higher than a preset intensity based on the rank gain of independent evidence representing a set of teaching knowledge fragments, extract summaries of teaching knowledge fragments with rank gains approaching zero, and assemble them into compressed evidence blocks. The output unit is used to compile and concatenate the structured semantic prefix, compressed evidence block and current question text into the final prompt input large language model; The control large language model combines the evidence identifiers within the core evidence layer to output a step-by-step deduction answer. The step-by-step deduction answer includes the final conclusion, the step-by-step deduction process, tips on common mistakes, and suggestions for variation exercises.
10. The intelligent teaching question-and-answer system based on natural language processing as described in claim 9, characterized in that, The specific suspension conditions include: When the conflict rate of the boundary evidence layer is lower than the preset threshold, it is determined that the suspension condition has not been triggered. When the conflict rate of the boundary evidence layer is not lower than the preset threshold, or when an abnormal trigger item is triggered, the suspension condition is determined to be triggered. The abnormal triggering items include: in the boundary evidence layer, keywords in the current question text are mapped to two or more concept nodes with mutual exclusion relationships through relationship indexing, and after extracting condition slots based on the preset condition template corresponding to the question type, there are key condition slots that are empty.
Citation Information
Patent Citations
Natural language processing methods, natural language processing devices, and intelligent question-answering systems
CN111026842B