Progressive question generation method based on semantic analysis and knowledge graph
By preprocessing the question-generating requirement text and analyzing the knowledge graph of universities, a hierarchical semantic constraint framework is constructed. Combined with large language model generation and user feedback optimization, the problems of inaccurate semantic parsing and insufficient alignment with the course outline in the question generation of university professional courses are solved. This achieves accuracy and diversity in question generation, and improves teaching consistency and system adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HOHAI UNIV
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies for setting questions in university professional courses suffer from insufficient semantic understanding, inadequate alignment with course outlines, unstable generation quality, and a lack of user feedback for optimization, making it difficult for questions to meet teaching objectives and the requirements for rigorous assessment.
By preprocessing the question-setting text, extracting the required keywords and optional limiting words, and constructing a hierarchical semantic constraint framework by combining the professional knowledge graph of universities and the course syllabus, candidate question materials are generated by using hard matching recall and soft expansion of the knowledge graph. Domain fine-tuning is carried out using a large language model and combined with adversarial training. Multi-objective learning ranking and teaching logic verification are introduced to form an incremental sample update mechanism.
It improves the accuracy and diversity of question generation, enhances the constraint controllability and teaching consistency of the generation process, realizes the adaptive optimization of the system, and improves the matching degree between questions and question-setting requirements and the long-term adaptability.
Smart Images

Figure CN121658670B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of educational informatization, and in particular to a progressive question generation method based on semantic analysis and knowledge graphs. Background Technology
[0002] With the advancement of information technology construction in higher education, intelligent question bank platforms have gradually become an important support for course teaching, homework assignment, and examination evaluation. Question generation technology has also evolved from manual writing and rule-based template-based question generation to automatic question generation based on question bank retrieval, and then to the stage of combining natural language processing technology for question requirement analysis and question element extraction. In recent years, large language models have significantly improved their text generation capabilities, making it possible to automatically generate question stems, reference answers, and explanations. Simultaneously, university professional knowledge graphs are used to organize course knowledge systems, manage knowledge point tags, and support associative reasoning, thereby improving the consistency and controllability of questions and professional content.
[0003] However, for practical applications in university professional courses, existing technologies still have the following shortcomings, making it difficult to reliably meet the requirements of teaching objectives and assessment rigor in generating questions:
[0004] 1. Insufficient semantic understanding of question requirements makes it difficult to accurately distinguish between core knowledge points and additional conditions such as difficulty, question type, and application scenario, which can easily lead to generated questions deviating from requirements or unstable constraint control.
[0005] 2. The lack of an effective alignment mechanism with the course syllabus and chapter levels, as well as the lack of consistency verification and teaching logic constraints, can easily lead to problems such as mismatched chapter scope, skipping of knowledge points, or unreasonable teaching paths.
[0006] 3. The lack of a closed-loop optimization mechanism based on user feedback makes it difficult to transform teacher or student evaluations into continuously updated incremental samples, resulting in insufficient long-term adaptability of the system to different courses and teaching preferences.
[0007] Therefore, a question generation method that can overcome the shortcomings of the existing technology is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0008] One objective of this invention is to propose a progressive question generation method based on semantic analysis and knowledge graphs. Addressing the problems of inaccurate semantic parsing, insufficient alignment with course outlines, unstable generation quality, and lack of continuous optimization based on user feedback in existing technologies for university professional course question generation, the following technical solution is proposed: Preprocessing the question generation requirement text and extracting a set of required keywords and a set of optional limiting words; performing concept mapping based on university professional knowledge graphs and course outlines, constructing a hierarchical semantic constraint framework including hard and soft constraints, and performing consistency detection; generating a candidate question material set using a dual-path approach of hard matching recall and soft knowledge point expansion; performing domain fine-tuning on a pre-trained large language model and combining it with adversarial training to generate candidate questions; re-ranking using a learning ranking model, and performing teaching logic verification and quality evaluation; and generating incremental samples based on user feedback to update the generation and ranking models. This invention achieves the technical effects of improving the accuracy and diversity of question generation, enhancing constraint controllability and teaching consistency, and realizing closed-loop adaptive optimization.
[0009] This invention provides a progressive question generation method based on semantic analysis and knowledge graphs, including:
[0010] S1. Receive the question-setting request text, preprocess it, perform semantic parsing, and extract the set of required keywords representing core knowledge points and the set of optional limiting words representing additional conditions; S2. Based on the university's professional knowledge graph, perform conceptual mapping between the set of required keywords and the set of optional limiting words, associate the university's professional knowledge graph with the course syllabus, construct a hierarchical semantic constraint framework containing hard and soft constraints, and perform consistency checks; S3. Based on the consistent hierarchical semantic constraint framework, combine the question text or question templates in the question bank to generate a candidate question material set, generating a set including: performing hard matching recall based on the set of required keywords to obtain a hard matching recall set, expanding knowledge points based on the university's professional knowledge graph under the hierarchical constraints of the course syllabus and recalling them accordingly to obtain a soft expansion set, and then... S4. Based on the target course domain corpus, perform domain adaptation on the pre-trained large language model to obtain a domain-fine-tuned large language model. Encode the candidate topic material set and the hierarchical semantic constraint framework that has passed consistency detection into the model input and generate a candidate topic set. S5. Perform multi-objective re-ranking on the candidate topic set. S6. Perform teaching logic verification and quality evaluation on the re-ranked candidate topic set, and output the passing candidate topics as the final topic set and the corresponding generation process information. S7. Receive the feedback information of the final topic set, and store it as an incremental sample set in association with the corresponding hierarchical semantic constraint framework and generation process information. Perform incremental updates on the domain-fine-tuned large language model and the learning ranking model.
[0011] Optionally, S1 includes:
[0012] S11. Receive the question-setting request text input by the user, perform text cleaning and word segmentation on the question-setting request text to obtain preprocessed text; S12. Perform distributed caching storage on the data corresponding to the preset high-frequency fields in the preprocessed text, and use a hash sharding strategy to partition the key space. Calculate the eviction probability of the data in the distributed cache storage using an enhanced least recently used eviction strategy. :
[0013] ;
[0014] And based on the elimination probability Perform cache eviction or retention, where As a time decay weight;
[0015] S13. Perform dependency parsing using the preprocessed text as input, and select the optimal dependency tree from the candidate dependency tree set. The optimal dependency tree satisfy:
[0016] ;
[0017] And based on the optimal dependency tree Extract the terms corresponding to the core knowledge points to obtain a set of required keywords;
[0018] S14. Using the preprocessed text as input, perform sequence labeling to identify terms corresponding to additional conditions, obtaining a set of optional limiting terms, wherein the label sequence... The sequence scores satisfy:
[0019] ;
[0020] In the formula Let be the transition matrix of the conditional random field. Encode features for BERT;
[0021] Output the set of required keywords and the set of optional qualifiers.
[0022] Optionally, S2 includes:
[0023] S21. Using the set of required keywords and the set of optional limiting words as input, perform entity linking in the university professional knowledge graph, perform synonym normalization and ambiguity resolution on the set of required keywords to obtain the knowledge graph node set corresponding to the set of required keywords, and perform tag mapping on the set of optional limiting words to obtain the condition tag set corresponding to the set of optional limiting words; S22. Using the set of knowledge graph nodes and the set of condition tags as input, associate and match the university professional knowledge graph with the course syllabus, determine the target chapter range and chapter level of the knowledge graph node set in the course syllabus, and set the level weight of the knowledge graph node set based on the chapter level; S23. Using Using the target chapter range, chapter level, level weight, knowledge graph node set, and condition label set as input, a hierarchical semantic constraint framework is constructed. The knowledge graph node set and its target chapter range in the course syllabus are defined as hard constraints, and the condition label set is defined as soft constraints. S24: A consistency check is performed using the hierarchical semantic constraint framework as input. The consistency check includes: verifying that the knowledge graph node corresponding to the hard constraint belongs to the target chapter range based on the course syllabus, and verifying that there is no preset mutual exclusion relationship between the condition labels corresponding to the soft constraint based on the university's professional knowledge graph. The result is a hierarchical semantic constraint framework that has passed the consistency check.
[0024] Optionally, S3 includes:
[0025] S31. Using the question text and question templates in the question bank as input, establish an inverted index with terms as keys and question identifiers as values, and associate each question identifier in the inverted index with its knowledge point tag to obtain the indexed question bank; S32. Using the set of required keywords and the hierarchical semantic constraint framework that has passed consistency testing as input, recall question texts and question templates containing the set of required keywords in the indexed question bank based on the inverted index to obtain a hard-matching recall set, and calculate the recall rate of the hard-matching recall set. :
[0026] ;
[0027] In the formula This represents the number of questions in the hard-match recall set that match the set of required keywords. The total number of questions in the index question bank that match the set of required keywords is the hard match recall set and the recall rate. Output;
[0028] S33. Using the knowledge graph node set, the chapter level and the level weight in the hierarchical semantic constraint framework as input, expand along the nodes adjacent to the knowledge graph node set in the university professional knowledge graph, calculate the semantic similarity between the adjacent nodes and the set of required keywords, and apply the level weight decay constraint to the adjacent nodes according to the chapter level to determine the expansion depth. Select the nodes that simultaneously satisfy the semantic similarity threshold and the expansion depth constraint to form the expanded knowledge point set.
[0029] S34. Using the extended knowledge point set as input, retrieve the question text and question template that match the knowledge point tags corresponding to the extended knowledge point set from the index question bank to obtain the soft extended set;
[0030] S35. Using the hard-matched recall set and the soft-expansion set as input, the two are deduplicated and merged, and the source path of each merged question is recorded. The candidate question material set is then output.
[0031] Optionally, S4 includes:
[0032] S41. Obtain the target course domain corpus, which includes the question stem text, reference answer, analysis text, and knowledge point tags and difficulty levels corresponding to the question stem text, and construct a training sample set for domain fine-tuning; S42. Using the training sample set as input, perform supervised learning training on the pre-trained large language model, and execute adversarial training during the supervised learning training process, wherein the input sequence for the training samples is as follows: The target output is The loss function is The model is Disturbance is The disturbance amplitude constraint is The parameters are updated by solving the following objective function. To obtain a domain-fine-tuned large language model:
[0033] ;
[0034] S43. Using the candidate question material set and the hierarchical semantic constraint framework that has passed consistency detection as input, the question text or question template in the candidate question material set and the hard constraints and soft constraints in the hierarchical semantic constraint framework are concatenated according to the preset field order to generate the model input sequence.
[0035] S44. Using the model input sequence as input, input the model input sequence into the domain fine-tuning large language model to generate a candidate question set, wherein each candidate question in the candidate question set includes a question stem text, a reference answer and an analysis text, and output the candidate question set.
[0036] Optionally, S5 includes:
[0037] S51. Using the candidate question set as input, for each candidate question in the candidate question set, extract the question stem text, reference answer, and analysis text, and extract the knowledge point tags corresponding to the question stem text to form structured candidate question data; S52. Using the structured candidate question data, the set of required keywords, the set of optional limiting words, and the hierarchical semantic constraint framework that has passed consistency detection as input, calculate a feature vector for each candidate question. The feature vector includes: required keyword satisfaction feature, optional limiting word satisfaction feature, course syllabus matching feature, and question diversity feature, wherein the course syllabus matching feature... Based on the target chapter range calculation corresponding to the hard constraints in the hierarchical semantic constraint framework, the question diversity feature is calculated based on the semantic similarity between candidate questions; S53, using the feature vector of each candidate question as input, the feature vector of each candidate question is input into the learning ranking model to obtain the ranking score of each candidate question, wherein the learning ranking model is the LambdaMART model, and the LambdaMART model uses normalized loss cumulative gain as the optimization objective; S54, using the ranking score as input, the candidate question set is sorted according to the ranking score, and the re-ranked candidate question set is output.
[0038] Optionally, S6 includes:
[0039] S61. Using the reordered candidate question set as input, extract the question stem text, reference answer, and analysis text for each candidate question in the reordered candidate question set, and obtain the candidate knowledge graph node set corresponding to the candidate question based on knowledge point tags and entity links; S62. Using the candidate knowledge graph node set and the hierarchical semantic constraint framework that has passed consistency detection as input, perform a course syllabus consistency check. The course syllabus consistency check includes: verifying that the candidate knowledge graph node set belongs to the target chapter range corresponding to the hard constraints in the hierarchical semantic constraint framework, and outputting a subset of candidate questions that pass the course syllabus consistency check; S63. Using the subset of candidate questions that pass the course syllabus consistency check, the candidate knowledge graph node set, and the university professional knowledge graph as input, perform a chapter-level constraint check. The chapter-level constraint check includes: verifying in the university professional knowledge graph... The association between any two nodes in the candidate knowledge graph node set satisfies the preset chapter level constraint, and outputs a subset of candidate questions that pass the chapter level constraint verification; S64, using the subset of candidate questions that pass the chapter level constraint verification, the set of required keywords, and the set of optional limiting words as input, perform quality assessment. The quality assessment includes: semantically representing the stem text and parsing text of each candidate question and calculating its semantic similarity with the knowledge graph node set corresponding to the set of required keywords; retaining candidate questions with semantic similarity not lower than a preset similarity threshold; verifying the field integrity of the stem text, the reference answer, and the parsing text; and verifying that the condition label set corresponding to the set of optional limiting words is consistent with the difficulty level and question type label of the candidate questions; outputting the candidate questions that pass the quality assessment as the final question set; and outputting the generation process information corresponding to each question in the final question set.
[0040] Optionally, the S7 includes:
[0041] S71. Receive user feedback information for each question in the final question set. The feedback information includes an acceptance feedback signal or a rejection feedback signal, and optionally includes a reason tag corresponding to the rejection feedback signal. S72. Using the feedback information and the question corresponding to the feedback information as input, obtain the hierarchical semantic constraint framework and generation process information corresponding to the question, and associate and store the question, the feedback information, the hierarchical semantic constraint framework, and the generation process information to form an incremental sample set. S73. Using the incremental sample set as input, determine questions with acceptance feedback signals as positive incremental samples and questions with rejection feedback signals as negative incremental samples. Based on the semantic similarity between the question stem text and the parsing text, determine the semantic similarity of the negative incremental samples. Candidate questions with a similarity score not lower than a preset threshold are identified as the suppression set; S74, using the positive incremental samples and the suppression set as input, incremental updates are performed on the domain fine-tuning large language model. The incremental update includes using the question stem text, reference answer, and analysis text of the positive incremental samples as supervised learning samples to update the model parameters, and reducing the selection weight of the question text or question template corresponding to the suppression set during the generation sampling stage; S75, using the positive incremental samples and the negative incremental samples as input, incremental training data for learning the ranking model is constructed, and incremental updates are performed on the learning ranking model so that in the subsequent step S5, the learning ranking model assigns higher ranking scores to the features corresponding to the positive incremental samples and lower ranking scores to the features corresponding to the negative incremental samples.
[0042] Optionally, in step S64, the quality assessment further includes solvability verification and answer consistency verification. The solvability verification includes: converting the question stem text into an executable solution expression or solution script based on the question type label and executing the solution to obtain the verification answer. The answer consistency verification includes: comparing the verification answer with the reference answer and retaining candidate questions whose consistency meets the preset conditions.
[0043] Optionally, in step S71, the feedback information further includes the feedback user type and feedback confidence level; in step S73, sample weights are assigned to positive incremental samples and negative incremental samples based on the feedback confidence level; in step S74, during the sampling generation stage, the selection weight of the question text or question template corresponding to the inhibition set is reduced in a graded manner according to the sample weights, so as to reduce the excessive inhibition caused by a small number of rejection feedbacks during the cold start stage.
[0044] The beneficial effects of this invention are:
[0045] 1. By extracting a set of required keywords and a set of optional limiting words from the text of the question-generating requirements, and combining the professional knowledge graph of universities and the course syllabus to construct a hierarchical semantic constraint framework containing hard constraints and soft constraints, as well as a consistency detection mechanism, the question generation process has clear semantic boundaries and conflict avoidance capabilities, thereby improving the matching degree between the generated questions and the question-generating requirements and the course syllabus.
[0046] 2. A dual-path candidate material generation strategy of hard matching recall and knowledge graph soft expansion is adopted. After the generation of the large language model with domain fine-tuning, multi-objective learning ranking and re-ranking, teaching logic verification and quality assessment are introduced. This can improve the diversity and usability of questions while ensuring the correct coverage of knowledge points, and reduce the probability of problems such as off-topic questions, knowledge jumps and incomplete fields.
[0047] 3. Introduce a user feedback-driven closed-loop incremental update mechanism to associate the final question, semantic constraint framework and generation process information to form incremental samples, and perform incremental updates on the generation model and ranking model, thereby enabling the system to continuously adapt and optimize as teaching preferences and course arrangements change, and improve the stability and iteration efficiency of long-term operation. Attached Figure Description
[0048] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0049] Figure 1 This is a flowchart of a progressive question generation method based on semantic analysis and knowledge graph proposed in this invention. Detailed Implementation
[0050] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0051] refer to Figure 1 A progressive question generation method based on semantic analysis and knowledge graphs includes:
[0052] S1. Receive the question-setting request text, preprocess it, perform semantic parsing, and extract the set of required keywords representing core knowledge points and the set of optional limiting words representing additional conditions; S2. Based on the university's professional knowledge graph, perform conceptual mapping between the set of required keywords and the set of optional limiting words, associate the university's professional knowledge graph with the course syllabus, construct a hierarchical semantic constraint framework containing hard and soft constraints, and perform consistency checks; S3. Based on the consistent hierarchical semantic constraint framework, combine the question text or question templates in the question bank to generate a candidate question material set, generating a set including: performing hard matching recall based on the set of required keywords to obtain a hard matching recall set, expanding knowledge points based on the university's professional knowledge graph under the hierarchical constraints of the course syllabus and recalling them accordingly to obtain a soft expansion set, and then... S4. Based on the target course domain corpus, perform domain adaptation on the pre-trained large language model to obtain a domain-fine-tuned large language model. Encode the candidate topic material set and the hierarchical semantic constraint framework that has passed consistency detection into the model input and generate a candidate topic set. S5. Perform multi-objective re-ranking on the candidate topic set. S6. Perform teaching logic verification and quality evaluation on the re-ranked candidate topic set, and output the passing candidate topics as the final topic set and the corresponding generation process information. S7. Receive the feedback information of the final topic set, and store it as an incremental sample set in association with the corresponding hierarchical semantic constraint framework and generation process information. Perform incremental updates on the domain-fine-tuned large language model and the learning ranking model.
[0053] In this specific embodiment, S1 includes:
[0054] The question-generating requirement text is structured into a set of required keywords and a set of optional limiting words to provide stable input for subsequent knowledge graph mapping. The server receives the question-generating requirement text encoded in UTF-8 through an interface. The question-generating requirement text is processed by full-width and half-width normalization, case normalization, continuous whitespace compression, control character removal and punctuation normalization to obtain preprocessed text. The preprocessed text is then segmented into word sequences based on the LTP word segmentation model. At the same time, the word sequence is truncated to a maximum length of 256 words and the original character position offset is retained to support subsequent phrase merging.
[0055] Data corresponding to preset high-frequency fields is extracted from preprocessed text and written to a distributed cache. These high-frequency fields include question template identifiers, knowledge point terms, limiting phrases, and user preference identifiers. The distributed cache uses a Redis cluster and implements hash sharding by partitioning the key space using CRC16 hash slots. For each cache key, two types of metadata are maintained: access count and recent access timestamp. When the cache space usage reaches a preset threshold, an enhanced Least Recently Used (LRU) eviction policy is triggered, which calculates the eviction probability for candidate eviction keys. :
[0056] ;
[0057] in This represents the probability that a cache key will be evicted. This represents the access frequency count of the cache key within a fixed statistics window. Represents the time decay weight and takes the value of The time decay value is represented by an exponential decay mapping derived from the time interval between the current moment and the most recent access moment, and is limited to between 0 and 1. Subsequently, within each hash partition, the sampled cache key set is processed according to... Sort the data from largest to smallest and discard the cache key corresponding to the first sorted key to ensure that frequently accessed and recently accessed data is retained first.
[0058] Dependency parsing is performed using the term sequence as input. The dependency parsing adopts a dependency analysis model based on dual affine attention and outputs the arc probability matrix and dependency relationship type between term pairs. Based on the arc probability matrix, the maximum spanning tree is used to decode to obtain a unique optimal dependency tree. In the optimal dependency tree, noun terms and noun phrases that serve as core objects, core subjects and parallel headwords are selected according to the dependency relationship type. Term pairs that are adjacent and belong to the same headword domain are merged into phrases according to the original character position offset and stop words are removed to form a set of required keywords.
[0059] Sequence labeling is performed using the term sequence as input to identify terms corresponding to additional conditions, thereby forming an optional qualifying word set. The sequence labeling model is a BERT-CRF model, and its BERT encoder adopts a 12-layer Transformer structure with a hidden layer dimension of 768 and 12 self-attention heads. WordPiece sub-word segmentation is used to encode the term sequence into a sub-word sequence. The label set of the CRF layer is fixed. And the dimension of the transition matrix is In the inference phase, the Viterbi algorithm is used to decode and obtain the optimal tag sequence, and the continuous... and Tag fragments are merged into qualifying phrases according to their original character position offsets. At the same time, terms that are identified as qualifying phrases are removed from the mandatory keyword set to avoid the same term appearing repeatedly in the two sets. The mandatory keyword set and the optional qualifying phrase set are output.
[0060] In this specific embodiment, S2 includes:
[0061] The set of required keywords and the set of optional qualifiers are mapped to the professional knowledge graph and course syllabus of universities, thereby constructing a hierarchical semantic constraint framework containing hard constraints and soft constraints and completing consistency detection.
[0062] Using a set of required keywords and a set of optional qualifiers as input, entity links are executed in the professional knowledge graph of higher education institutions. The professional knowledge graph of higher education institutions is stored in a graph data structure and consists of concept nodes, attribute fields and relation edges. Each concept node contains at least a node identifier, a standard name, a set of synonyms, a node description text, and the identifier of the chapter of the course outline to which it belongs.
[0063] The entity linking process first generates candidate entities for each required keyword and obtains a candidate entity set. The candidate entity generation is jointly completed based on the exact matching of the synonym set and the text retrieval based on BM25, and the number of candidate entities is fixed at 5.
[0064] Subsequently, semantic similarity is calculated for each candidate entity to complete the ambiguity resolution. The semantic similarity is obtained by the cosine similarity of the 768-dimensional vector output by the Sentence-BERT encoder. The Sentence-BERT encoder adopts a 12-layer Transformer structure with a hidden layer dimension of 768, 12 self-attention heads, and a maximum input length of 256 sub-words. The node description text of the candidate entity and the context window of the required keywords in the preprocessed text are used as the encoding input. The candidate entity with the highest semantic similarity is selected as the link result and its node identifier is written into the knowledge graph node set. At the same time, synonym normalization is performed on the required keywords linked to the same node identifier to retain only the terms corresponding to the standard name.
[0065] A tag mapping is performed on the optional qualifier set to obtain a condition tag set. The condition tag set is stored using a preset tag system, which includes at least four categories: difficulty level tags, question type tags, application scenario tags, and audience tags. Each qualifier phrase is mapped to a unique condition tag through a rule dictionary and Sentence-BERT similarity dual-channel mapping, and the mapping confidence is recorded. The mapping confidence is taken as the maximum similarity, and the similarity threshold is fixed at 0.75. Qualifier phrases below the threshold are discarded to avoid introducing noise conditions.
[0066] Using a set of knowledge graph nodes and a set of condition labels as input, the knowledge graph of higher education institutions is associated and matched with the course syllabus. The course syllabus is stored in a tree structure, and each chapter node contains a chapter identifier, a chapter title, a chapter level, and a parent chapter identifier. The association and matching directly locates the chapter node in the course syllabus tree through the chapter identifier of the knowledge graph node and obtains the target chapter range. The target chapter range is jointly determined by the least common ancestor chapter node of the corresponding chapter node in the knowledge graph node set and the chapter subtree it covers. At the same time, the chapter level of the least common ancestor chapter node is determined as the chapter level.
[0067] Assign hierarchical weights to chapter levels for subsequent knowledge point expansion and constraint decay control. The hierarchical weights are assigned according to the formula... Confirmed, among which Indicates the chapter level as The corresponding hierarchical weight, Indicates the chapter level and the root chapter level is taken as And increasing downwards, Represents the hierarchical attenuation coefficient and takes and will Limiting it to between 1 and 4 to ensure chapters with more than 4 levels are uniformly categorized. Calculate the hierarchical weights to ensure the numerical stability and reusability of the hierarchical weights across courses;
[0068] A hierarchical semantic constraint framework is constructed using the target chapter scope, chapter level, level weight, knowledge graph node set, and condition label set as input. The hierarchical semantic constraint framework is stored in structured data objects and includes at least hard constraint fields and soft constraint fields. The hard constraint fields are composed of the knowledge graph node set and the target chapter scope and are used to limit the knowledge points and chapter boundaries that the generated questions must cover. The soft constraint fields are composed of the condition label set and are used to limit the difficulty level, question type, application scenario, and other additional conditions of the generated questions. At the same time, the chapter level and level weight are recorded in the hierarchical semantic constraint framework to support subsequent expansion depth control based on the course outline level.
[0069] A hierarchical semantic constraint framework is used as input to perform consistency checks. The consistency checks include course syllabus consistency checks and condition label mutual exclusion checks. For each node in the knowledge graph node set, the course syllabus chapter identifier of its respective node is read and it is determined whether it falls within the target chapter range. Nodes that do not fall within the target chapter range are replaced with their nearest superordinate concept node in the university's professional knowledge graph, and the course syllabus chapter identifier of the nearest superordinate concept node must fall within the target chapter range, thereby completing the alignment of knowledge points without expanding the chapter boundaries.
[0070] The condition label mutual exclusion verification is based on the pre-maintained mutual exclusion relation table in the university's professional knowledge graph. The mutual exclusion relation table is stored in the form of ordered label pairs and is used to represent the combination of conditions that cannot be true at the same time in the same question generation task. When two mutually exclusive condition labels are detected, the condition label with higher mapping confidence is retained and the condition label with lower mapping confidence is deleted. When the mapping confidence is equal, the condition label with higher priority is retained according to the priority order of difficulty level label, question type label, application scenario label, and audience label. The hierarchical semantic constraint framework with consistency detection is output.
[0071] In this specific embodiment, S3 includes:
[0072] A candidate question material set is generated under the constraints of a hierarchical semantic constraint framework that has passed consistency checks. The question text and question template in the question bank are used as input to build an index question bank. The index question bank consists of two parts: an inverted index and a question metadata table. The inverted index uses terms as keys and a list of question identifiers as values. The question metadata table uses question identifiers as primary keys and stores at least the question stem text, question template, reference answer, analysis text, knowledge point tags, and the chapter identifier of the course outline. The term generation process of the inverted index is consistent with the word segmentation rules in step S1 and performs stop word filtering and word form normalization on the terms. The knowledge point tags in the question metadata table are obtained by a one-to-one correspondence between the pre-annotated tags in the question bank and the node identifiers of the professional knowledge graph of the university, and each question identifier is associated with at least one knowledge point tag.
[0073] Hard matching recall is performed using the set of required keywords and a hierarchical semantic constraint framework that has passed consistency checks as input. Hard matching recall obtains the corresponding question identifier list for each required keyword in the set of required keywords through an inverted index and performs an intersection operation to obtain the set of matching question identifiers that satisfy the simultaneous appearance of all required keywords. At the same time, in order to control the size of the candidates, the set of matching question identifiers is truncated in descending order of the update timestamp in the question metadata table. Each question identifier and We take 500 to obtain the hard match recall set, and calculate the recall rate of the hard match recall set based on the size of the set of matched question identifiers and the size of the hard match recall set. for ,in This represents the recall rate of the hard-match recall set. This indicates the number of question identifiers in the hard-match recall set. This represents the total number of question identifiers that satisfy the condition that all required keywords appear simultaneously in the matching question identifier set.
[0074] Using the knowledge graph node set, the chapter level and level weight in the hierarchical semantic constraint framework as input, knowledge point expansion is performed to form an expanded knowledge point set. The knowledge point expansion is carried out on the adjacency list of the university professional knowledge graph with the knowledge graph node set as the starting node set and the expansion depth count is maintained. The upper limit of the expansion depth is jointly determined by the chapter level and level weight, and a fixed decay factor of 0.7 is used to decay the level weight layer by layer according to the expansion depth. The expansion is terminated when the decayed weight is less than 0.2. At the same time, the semantic similarity between each adjacent node and the set of required keywords is calculated, and only adjacent nodes with a semantic similarity of not less than 0.75 are retained. The semantic similarity is obtained by the cosine similarity of the 768-dimensional vector output by the Sentence-BERT encoder. The structure of the Sentence-BERT encoder is the same as that in step S2, so as to obtain an expanded knowledge point set that simultaneously satisfies the semantic similarity threshold and the expansion depth constraint.
[0075] The soft expansion recall is performed with the extended knowledge point set as input. The soft expansion recall maps the knowledge graph node identifiers in the extended knowledge point set to the corresponding knowledge point tag set and performs a matching query based on the knowledge point tag field in the index question bank to obtain the soft expansion set. At the same time, the soft expansion set is limited to the target chapter range of the hierarchical semantic constraint framework to ensure that the course outline chapter identifier of the recalled questions falls within the target chapter range.
[0076] Using the hard-match recall set and the soft-expansion set as input, perform deduplication and merging to obtain a candidate question material set. Deduplication uses the hash value of the normalized question stem text as the unique key, and retains question records that come from both the hard-match recall set and the soft-expansion set when duplicates occur. For each merged question record, the source path information is recorded. The source path information includes at least the source type identifier and a list of required keyword sets or extended knowledge point sets that trigger the source. Output the candidate question material set.
[0077] In this specific embodiment, S4 includes:
[0078] The system obtains a domain-fine-tuned large language model and generates a candidate question set from the candidate question material set under the constraints of a hierarchical semantic constraint framework. Training samples are extracted from the target course domain corpus, and a training sample set is constructed. The target course domain corpus consists of question stem text, reference answers, explanation text, knowledge point tags, difficulty level, and question type tags, with each field stored using UTF-8 encoding. Each training sample in the training sample set is organized as supervised learning dual data. ,in The input sequence is obtained by concatenating the question template or question text with its corresponding knowledge point tags, difficulty level, and question type tags in a fixed field order, and then adding field separators. The target output sequence is obtained by concatenating the question stem, reference answer, and analysis text according to a fixed output format and appending an end marker. The training sample set is set as follows: The dataset is divided into training, validation, and test sets. Before the division, multiple versions of samples with the same title are deduplicated to avoid data leakage.
[0079] Domain adaptation is performed on a pre-trained large language model using the training sample set as input to obtain a domain-fine-tuned large language model. The pre-trained large language model adopts a decoder-based Transformer structure and models the conditional probability distribution in an autoregressive manner. The number of layers in the pre-trained large language model is fixed at 24, the hidden layer dimension is fixed at 2048, the number of attention heads is fixed at 16, the vocabulary size is fixed at 50,000, and the word segmenter adopts BPE-based sub-word segmentation with a maximum input sequence length of 2048 sub-words. Domain adaptation adopts supervised fine-tuning training and performs adversarial training based on FGM in each training batch to improve robustness to noisy inputs and boundary conditions. The model parameters are denoted as follows. The model function is denoted as Furthermore, the output is a conditional probability distribution of the target output sequence, and the loss function is denoted as... Furthermore, a negative log-likelihood loss is applied, and the input sequence of the training samples is denoted as... Furthermore, the sub-word sequence is obtained after BPE segmentation, and the target output of the training sample is denoted as... Furthermore, it is a sequence of sub-words after BPE segmentation, denoted as adversarial perturbation. And it acts on the input embedding vector and interacts with it. Correspondingly, the disturbance amplitude constraint is denoted as And take and with The L2 norm of the constraint perturbation is obtained by solving the objective function. Update parameters The inner maximization is constructed by normalizing and scaling the input embedding gradient. And after calculating the countermeasure losses within the same batch, compare them with the original losses. The total loss is obtained by weighted summation and then updated back. The optimizer uses AdamW and the learning rate is fixed. The weight decay was fixed at 0.01, the batch size was fixed at 16, the number of training rounds was fixed at 3, and a 500-step linear warm-up and a gradient clipping threshold of 1.0 were used to stabilize the training process, thereby obtaining a domain-fine-tuned large language model.
[0080] The model input sequence for the generation stage is constructed using the candidate question material set and the hierarchical semantic constraint framework that has passed consistency detection as input. The model input sequence is concatenated with a fixed field order, and the field order is fixed as follows: course identifier, target chapter range, set of required keywords, set of optional limiting words, list of hard constraint node identifiers, list of soft constraint condition labels, candidate question material text and source path information. Unique separators are inserted between each field to ensure parsing. The candidate question material text is a normalized version of the question text or question template, and the normalization rule is the same as in step S1. The source path information is a list of source type identifiers and trigger identifiers, which is used to prompt the model to maintain knowledge coverage consistent with the recall path during generation.
[0081] The input sequence of the model is input into the domain fine-tuning large language model to generate a candidate question set in an autoregressive manner. The generation and decoding adopts beam search with a fixed beam width of 4 and a fixed maximum number of newly generated subwords of 512. At the same time, the generated output is forcibly constrained to a three-segment format containing a question stem text field, a reference answer field, and a parsing text field, and the boundaries of each segment are defined by field start control markers. Thus, the candidate question set is generated and output from the candidate question material set under the combined effect of hard and soft constraints.
[0082] In this specific embodiment, S5 includes:
[0083] Perform multi-objective reordering on the candidate question set and output the reordered candidate question set. Using the candidate question set as input, parse each candidate question according to the field start control flag in the three-segment format in step S4 to obtain the question stem text, reference answer and analysis text. Read the knowledge point tags corresponding to the candidate question from the question identifier and knowledge point tags inherited from the candidate question material set, thereby forming candidate question structured data. The candidate question structured data includes at least the question stem text field, reference answer field, analysis text field, knowledge point tag field and source path field.
[0084] Using structured candidate question data, a set of required keywords, a set of optional limiting words, and a hierarchical semantic constraint framework that has undergone consistency testing as input, a feature vector is calculated for each candidate question. This feature vector consists of numerical features and Boolean features, and is uniformly normalized to... The numerical features include required keyword satisfaction features and question diversity features. The required keyword satisfaction features are obtained by comparing the knowledge point tag field of the candidate question with the hard constraint node identifier list in the hierarchical semantic constraint framework and expressed as the hit ratio. The question diversity features are obtained by concatenating the question stem text and parsing text of each candidate question to generate a semantic vector and calculating its cosine similarity with the other candidate questions in the candidate question set. The semantic vector is output by the Sentence-BERT encoder, which adopts a 12-layer Transformer structure, a hidden layer dimension of 768, a self-attention head number of 12, a maximum input length of 256 sub-words, and outputs a 768-dimensional vector. The question diversity features take the complement value of the maximum similarity between the candidate question and the other candidate questions to suppress duplicate questions.
[0085] The Boolean features include optional qualifier satisfaction features and course syllabus matching features. The optional qualifier satisfaction features are obtained by comparing the set of condition labels obtained by mapping the optional qualifier set with the difficulty level label and question type label of the candidate question. The value is 1 when they match and 0 when they do not match. The course syllabus matching features are obtained by checking whether the chapter identifier of the course syllabus to which the candidate question belongs falls within the target chapter range in the hierarchical semantic constraint framework. The value is 1 when it falls within the target chapter range and 0 when it does not. Thus, a feature vector with fixed dimensions is obtained for each candidate question and stored in association with the question identifier.
[0086] The feature vectors of each candidate question are input into a learning and ranking model to obtain a ranking score for each candidate question. The learning and ranking model is a LambdaMART model that uses gradient boosting decision trees as base learners and learns and infers the set of candidate questions corresponding to the same question requirement in a group ranking manner. The LambdaMART model has a fixed number of trees (500), a maximum tree depth of 6, a learning rate of 0.05, a minimum number of samples per leaf node of 20, and a feature sampling ratio of 0.8. The normalized depreciation cumulative gain (NDCG@10) is used as the optimization objective. During the model training phase, candidate questions corresponding to historical question requirements and relevance levels generated from teacher feedback are used as supervision signals, and the relevance levels are mapped to integer labels from 0 to 3 to support multi-objective comprehensive trade-offs. During the model inference phase, a ranking score is output for the feature vector of each candidate question. ,in Indicates the first The ranking score of each candidate topic. This represents the index of the candidate question within the candidate question set. Indicates the first The feature vectors of candidate topics, LambdaMART() represents the inference function of the learning ranking model obtained by training with the above fixed hyperparameters and the NDCG@10 target;
[0087] Using the ranking score as input, sort the candidate question set from high to low according to the ranking score, and retain the source path field and knowledge point tag field associated with each candidate question in the ranking result, and output the re-ranked candidate question set.
[0088] In this specific embodiment, S6 includes:
[0089] The reordered candidate question set is subjected to teaching logic verification and quality assessment based on the university's professional knowledge graph and course syllabus, and the final question set and corresponding generation process information are output. Using the reordered candidate question set as input, each candidate question is parsed to obtain the question stem text, reference answer, and analysis text, and its knowledge point tags are read. Simultaneously, based on the knowledge point tags, direct node connection mapping is performed in the university's professional knowledge graph to obtain the first node set. Entity linking is then performed on the concatenated question stem text and analysis text to obtain the second node set. The entity linking process adopts the same candidate entity generation and ambiguity resolution process as step S2, with a fixed number of 5 candidate entities. Ambiguity resolution uses the cosine similarity of the output vectors of the Sentence-BERT encoder and selects the candidate entity with the highest similarity as the link result. The Sentence-BERT encoder uses a 12-layer Transformer structure with a hidden layer dimension of 768, 12 self-attention heads, and a maximum input length of 256. Each sub-word is used to combine the first node set and the second node set to obtain the candidate knowledge graph node set for the candidate topic, and each node is recorded with its node identifier, standard name and the chapter identifier of the course outline to which it belongs.
[0090] The course syllabus consistency check is performed using the candidate knowledge graph node set and the hierarchical semantic constraint framework that has passed consistency checks as input. The course syllabus consistency check reads the target chapter range in the hierarchical semantic constraint framework and checks whether the course syllabus chapter identifier of each node in the candidate knowledge graph node set falls within the target chapter range. If any node does not fall within the target chapter range, the candidate question is determined to have failed the course syllabus consistency check and is removed from the candidate question set, thereby obtaining a subset of candidate questions that have passed the course syllabus consistency check.
[0091] Taking the subset of candidate topics that have passed the course syllabus consistency check, the set of candidate knowledge graph nodes, and the university's professional knowledge graph as input, a chapter-level constraint check is performed. The chapter-level constraint check is based on the chapter level in the hierarchical semantic constraint framework and reads the parent-child relationship of each chapter node in the course syllabus tree structure. For any two nodes in the candidate knowledge graph node set of the same candidate topic, the chapter nodes to which they belong are obtained and the lowest common ancestor chapter node of the two in the course syllabus tree is calculated. At the same time, it is checked whether there is a relationship set between the two in the university's professional knowledge graph. is_a, part_of, prerequisite If a directed path is formed and its length does not exceed 3, and the sum of the hierarchical distances from the chapter nodes to the nearest common ancestor chapter node does not exceed 2, then the node pair is determined to pass the chapter hierarchical constraint verification. If any node pair does not meet the above conditions, the candidate question is removed, thus obtaining a subset of candidate questions that pass the chapter hierarchical constraint verification.
[0092] The quality assessment is performed using a subset of candidate questions that pass chapter-level constraint validation, along with a set of required keywords and a set of optional limiting words, as input. The quality assessment includes semantic similarity validation, field completeness validation, and constraint consistency validation. For semantic similarity validation, the question stem text and parsed text are concatenated and input into the Sentence-BERT encoder to obtain the question vector. The canonical name and node description text of each node in the candidate knowledge graph node set are concatenated and then input into the same Sentence-BERT encoder to obtain the node vector. And calculate semantic similarity:
[0093] ;
[0094] in This represents the cosine similarity score between the question vector and the node vector. This represents a 768-dimensional semantic representation vector obtained by encoding the question stem text and the parsed text. This represents a 768-dimensional semantic representation vector obtained from the text encoding of knowledge graph nodes. Represents the vector dot product. express The 2-norm, express The semantic similarity score of a candidate question is determined by the L2 norm of the candidate knowledge graph node set. A semantic similarity score of 0.75 or higher is considered to pass the semantic similarity check. The field integrity check determines that the question stem, reference answer, and analysis text are all non-empty strings with lengths of at least 20 characters, 1 character, and 30 characters, respectively. It also checks that the three-segment field start control tags are complete to avoid missing or fragmented fields. The constraint consistency check compares the set of optional constraint words with the set of condition labels and the difficulty level and question type labels of the candidate questions. If they match, they are retained; if they do not match, they are discarded. The candidate questions that pass the quality assessment are output as the final question set. At the same time, the generation process information is associated with each question in the final question set. The generation process information includes at least the set of required keywords, the set of optional constraint words, the target chapter range, the source path of hard matching recall or soft expansion recall, the ranking score, the course outline consistency check result, the chapter level constraint check result, and the semantic similarity score.
[0095] In this specific embodiment, S7 includes:
[0096] The system receives user feedback on the final question set and forms an incremental sample set to perform incremental updates on the domain fine-tuning large language model and learning ranking model. When displaying the final question set, the system binds a unique question identifier to each final question and provides a feedback entry point. It receives user-submitted feedback information and parses it into acceptance or rejection signals, while also parsing rejection reason tags, which are taken from a fixed tag set. The difficulty level is inappropriate, the question type is inappropriate, the knowledge points are off-topic, the explanation is incomplete, and the expression is not standardized. Furthermore, upon receiving feedback, the rejection reason label will be set to "none," and the timestamp of the feedback occurrence and the feedback user identifier will be recorded together.
[0097] Using feedback information and the corresponding question as input, the system reads the question's generation process information and its corresponding hierarchical semantic constraint framework from storage, and writes the question identifier, question stem text, reference answer, analysis text, knowledge point tag, hierarchical semantic constraint framework identifier, generation process information, feedback information, rejection reason tag, and feedback occurrence timestamp into the incremental sample set. The incremental sample set is persistently stored in a relational table structure and uses the question identifier and feedback occurrence timestamp as a composite primary key to avoid overwriting historical feedback.
[0098] Using the incremental sample set as input, the system identifies questions with acceptance feedback signals as positive incremental samples and questions with rejection feedback signals as negative incremental samples. Simultaneously, it constructs an inhibition set based on the semantic similarity between the question stem and the parsed text. The semantic similarity calculation employs a Sentence-BERT encoder with a 12-layer Transformer structure, 768 hidden layer dimensions, 12 self-attention heads, a maximum input length of 256 subwords, and an output 768-dimensional vector. The question stem and parsed text of each negative incremental sample are concatenated and encoded to obtain the vector. The question text or question template of each question in the candidate question material set is encoded into a vector. And calculate semantic similarity:
[0099] ;
[0100] in Indicates the first The negative incremental sample and the first The cosine similarity value between the source materials for each question. Indicates by the first The 768-dimensional semantic vector is obtained by encoding negative incremental samples. Indicates by the first The 768-dimensional semantic vector obtained by encoding the topic material Represents the vector dot product. express The 2-norm, express The 2-norm, when When the value is not less than the threshold of 0.85, the material identifier of the question material is added to the suppression set and associated with the negative incremental sample question identifier list that triggers it;
[0101] Using positive incremental samples and the suppression set as input, the domain fine-tuning large language model is incrementally updated. The incremental update constructs supervised learning dual data consistent with step S41 for each positive incremental sample. The large language model was then fine-tuned for the domain and trained for another 200 steps to update the model parameters. The optimizer uses AdamW and the learning rate is fixed. The weight decay is fixed at 0.01, the batch size is fixed at 8, and a gradient pruning threshold of 1.0 is used. Simultaneously, FGM adversarial training is maintained consistent with step S42, and the perturbation amplitude is constrained. To improve the robustness of incremental training;
[0102] During the generation sampling phase, a suppression strategy is implemented on the question materials corresponding to the suppression set. The system maintains a material selection weight for each question material and the default weight is 1.0. When the material identifier of the question material belongs to the suppression set, the material selection weight is fixed to 0.1 and normalized sampling is performed according to the material selection weight when constructing the model input sequence in step S43, thereby reducing the probability of question materials with semantic similarity to negative incremental samples entering the generation link.
[0103] Incremental training data for learning the ranking model is constructed using positive and negative incremental samples as input. The incremental training data takes feature vectors as input, and positive incremental samples are labeled as relevance level 3 and negative incremental samples are labeled as relevance level 0. Then, incremental updates are performed on the learning ranking model to assign higher ranking scores to the features corresponding to positive incremental samples and lower ranking scores to the features corresponding to negative incremental samples. The incremental update is achieved by adding 50 gradient boosting decision trees to the original LambdaMART model. In the additional training stage, the maximum depth of a single tree is fixed at 6, the learning rate is fixed at 0.05, the minimum number of samples in the leaf nodes is fixed at 20, and the feature sampling ratio is fixed at 0.8. NDCG@10 is continued as the optimization objective, thereby completing the closed-loop incremental update based on user feedback and making the subsequent generation and re-ranking results continuously converge with the incremental sample set.
[0104] In this specific embodiment, the quality assessment in step S64 further includes solvability verification and answer consistency verification;
[0105] First, read the question type tags of the candidate questions and limit the question type tags to: Multiple choice questions, fill-in-the-blank questions, calculation problems One of the three types is to simultaneously read the question stem, reference answer, and analysis text of the candidate question;
[0106] For solvability verification, the system converts the problem text into an executable solution script and executes it in a restricted execution environment to obtain the verification answer. The restricted execution environment is a Python 3.10 interpreter with only SymPy 1.12 and the math module in the Python standard library enabled, and file reading and writing, network access and system command calls are disabled. At the same time, the timeout for a single problem is fixed at 2 seconds and the maximum memory usage is fixed at 256 MB.
[0107] The solution script is generated by concatenating the question type-driven script template with the question stem analysis results. The question stem analysis is completed using a deterministic rule parser, which consists of a word segmenter, a numerical extractor, an expression extractor, and a constraint extractor. The word segmenter is consistent with step S1 to ensure the stability of term boundaries. The numerical extractor extracts integers, floating-point numbers, and fractions from the question stem text and converts them into SymPy rational numbers or high-precision floating-point numbers. The expression extractor extracts explicit mathematical expressions from the question stem text and converts them into SymPy expression trees. The constraint extractor extracts equality constraints, inequality constraints, and value range constraints from the question stem text and converts them into SymPy solveable objects.
[0108] When the question type is a calculation question, the system calls SymPy's solve or solveset in the solution script based on the extracted target quantity label and constraint set, sorts the solution results from smallest to largest, and selects the unique solution or selects the specified solution according to the question requirements to form the verification answer. When the question type is a fill-in-the-blank question, the system maps the target quantity to be filled in the question to a SymPy symbolic variable and calculates the value of the symbolic variable according to the definition of the question to form the verification answer. When the question type is a multiple-choice question, the system constructs a determinate expression for each option text and calculates its truth value or numerical result, and identifies the unique option that satisfies the question constraints as the verification answer.
[0109] If the target quantity is missing, the constraint set is empty, the expression parsing fails, or there is no solution, multiple solutions and cannot be unique according to the question stem rules, timeout, or resource limit exceedance during the script generation stage, the candidate question is determined to have failed the solvability check and is removed from the final question set.
[0110] For answer consistency verification, the system performs format and unit normalization on the reference answer and the verification answer and performs consistency comparison. Format normalization includes removing whitespace, replacing synonyms, and standardizing equivalent expressions. Unit normalization converts the units marked in the question to the International System of Units and applies them to the reference answer and the verification answer simultaneously.
[0111] When both the reference answer and the verification answer are numerical, the system calculates the consistency judgment value:
[0112] ;
[0113] in Indicates the consistency value of the answer and Indicates consistency and Indicates inconsistency. This indicates an indicator function that takes the value 1 if the condition within the parentheses is true, otherwise takes the value 0. This represents the absolute value operation. This represents the numerical result of the verification answer. This represents the numerical result of the reference answer. Indicates numerical tolerance and takes a fixed value. ;
[0114] When at least one of the reference answer and the verification answer is a symbolic expression, the system converts them into SymPy expressions and calculates the simplified result of the difference between them. If the simplified result is 0, they are considered to be consistent; otherwise, they are considered to be inconsistent.
[0115] When the question type is multiple choice, the system determines that the option identifier of the reference answer is the same as the option identifier of the verification answer, otherwise it determines that they are not the same.
[0116] The system retains only the candidate questions that pass both the solvability check and the answer consistency check as the final question set and records the question type label, solution script hash value, execution status code, verification answer and consistency judgment value of the candidate question in the generation process information.
[0117] In this specific embodiment, the feedback information received in step S71 further includes the feedback user type and feedback confidence level, and is used for hierarchical suppression of the suppression set and sample weighting for incremental training.
[0118] The system receives the feedback user type when the user submits feedback. With feedback confidence ,in Taken from a fixed set Teachers, teaching assistants, and students And it is determined by the role field of the logged-in account. Integer range input by the front slider Obtained and limited by normalization And set to when input is missing. The system will and The question identifier, the accepted or rejected feedback signal, and the rejection reason label are written into the incremental sample set.
[0119] In step S73, the system assigns sample weights to positive and negative incremental samples based on feedback confidence levels and uses these weights for subsequent incremental updates. The sample weights are denoted as... And according to the formula Calculation, where Represents the sample weights and their value range is 1. Indication and feedback of user types The corresponding type coefficient and when Teacher ,when Teaching assistant ,when During my student days This represents the normalized value indicating the confidence level of the feedback.
[0120] The system retains the sample weight for each negative increment sample when constructing the suppression set. This data is then associated with and stored as the identifier of the suppressed question material. Simultaneously, when constructing training data for positive and negative incremental samples, the sample weights are adjusted. The sample-level weights are written into the training data record for use by the domain fine-tuning of the large language model and the learning ranking model.
[0121] In step S74, during the sampling generation phase, the system performs a graded descent on the selection weights of the question text or question template corresponding to the suppression set based on the sample weights to avoid over-suppression caused by a small number of rejection feedbacks during the cold start phase. The system maintains the material selection weights for each question material and sets the default material selection weight to 1.0. When a question material identifier enters the suppression set, it reads all negative incremental sample weights associated with that question material identifier and calculates the maximum sample weight. With negative incremental sample count ,in This represents the maximum value of the associated negative incremental sample weights, and its range is [value missing]. This represents the number of negative incremental samples associated with the data and is a positive integer.
[0122] when and When the material selection weight is set to 0.7, and When the material selection weight is set to 0.4, and When the material selection weight is set to 0.2, and When the material selection weight is set to 0.2, and The material selection weight was set to 0.05, so that only mild suppression was applied to rejection feedback with low confidence and small sample size, and strong suppression was applied to high confidence or multiple rejection feedback.
[0123] When constructing the model input sequence in step S4, the system performs weighted sampling on the candidate topic material set according to the material selection weights and inputs the sampling results into the domain fine-tuning large language model. At the same time, during the incremental training phase of the domain fine-tuning large language model, the loss term for each positive incremental sample and negative incremental sample is weighted according to its sample weights. Weighting is used to give higher-confidence feedback a greater impact on parameter updates, and sample weights are increased during the incremental training phase of the learning ranking model. As training instance weights, the sensitivity of ranking scores to different feedback credibility is adjusted synchronously.
[0124] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
[0125] This invention organically combines semantic parsing, university professional knowledge graph constraints, dual-path candidate recall, domain-fine-tuned large language model generation, multi-objective re-ranking, teaching logic verification, and incremental updates based on user feedback. This creates a chain-like constraint and error-correcting effect on technical issues at each stage: On the input side, the question-generating requirements are structured using a set of required keywords and a set of optional limiting words; on the constraint side, a hierarchical semantic constraint framework aligned with the course syllabus solidifies the knowledge point scope, chapter level, and condition labels into hard and soft constraints, and eliminates mutually exclusive conditions and chapter mismatches in advance through consistency checks; on the generation side, hard matching recall ensures knowledge point hits, while soft expansion of the knowledge graph and hierarchical weight decay balance question diversity and avoid irrelevant expansion; candidate materials and semantic constraints are co-encoded into the input domain fine-tuning model to reduce the probability of off-topic questions; on the output side, learning ranking, teaching logic verification, and quality assessment are used to screen and correct candidate questions for usability. This overall improves the accuracy of question generation, the controllability of constraints, and the consistency with teaching, while reducing the risk of incomplete or unsuitable question types.
[0126] To address the challenge of balancing strict alignment with the curriculum syllabus with diversity and sustainable adaptability in university teaching scenarios, this invention makes problem-oriented improvements to the algorithm structure: First, it introduces a hierarchical semantic constraint framework of hard and soft constraints, and sets up consistency checks before generation, transforming constraints from "post-selection" to "pre-standardization," thus improving generation stability. Second, it employs a dual-path candidate construction method using hard matching and soft expansion, and records the source path and generation process information, providing traceable evidence for subsequent re-sorting, verification, and feedback updates. Third, it introduces adversarial training to enhance the robustness of the domain-specific fine-tuning model under noisy input and boundary conditions, and combines user feedback to construct incremental samples, iterating the generation and ranking models synchronously. Simultaneously, it suppresses negative feedback similar questions during the sampling phase, structurally achieving closed-loop adaptive optimization, thereby better and continuously achieving the aforementioned technical effects.
Claims
1. A progressive question generation method based on semantic analysis and knowledge graph, characterized in that, include: S1. Receive the question-setting request text, perform preprocessing, execute semantic parsing, and extract the set of required keywords representing core knowledge points and the set of optional limiting words representing additional conditions; S2. Based on the university's professional knowledge graph, conceptually map the set of required keywords and the set of optional limiting terms, associate the university's professional knowledge graph with the course syllabus, construct a hierarchical semantic constraint framework containing hard and soft constraints, and perform consistency checks; S3. Based on the consistent hierarchical semantic constraint framework, generate a candidate question material set by combining question texts or question templates in the question bank, generating a set including: performing hard matching recall based on the set of required keywords to obtain a hard matching recall set, expanding knowledge points based on the university's professional knowledge graph under the hierarchical constraints of the course syllabus and recalling them accordingly to obtain a soft expansion set, and combining the hard matching recall set and the soft expansion set to obtain a candidate question material set; S4. Based on the target course... Domain corpus is used to adapt the pre-trained large language model to obtain a domain-fine-tuned large language model. The candidate topic material set and the hierarchical semantic constraint framework that has passed consistency detection are co-encoded as model inputs to the domain-fine-tuned large language model to generate a candidate topic set. S5, Multi-objective re-ranking is performed on the candidate topic set. S6, Teaching logic verification and quality evaluation are performed on the re-ranked candidate topic set, and the candidate topics that pass are output as the final topic set, along with the corresponding generation process information. S7, Feedback information from the final topic set is received and stored as an incremental sample set in association with the corresponding hierarchical semantic constraint framework and generation process information. Incremental updates are performed on the domain-fine-tuned large language model and the learning ranking model. Specifically, S2 is: S21. Using the set of required keywords and the set of optional limiting words as input, perform entity linking in the university professional knowledge graph, perform synonym normalization and ambiguity resolution on the set of required keywords to obtain the knowledge graph node set corresponding to the set of required keywords, and perform tag mapping on the set of optional limiting words to obtain the condition tag set corresponding to the set of optional limiting words; S22. Using the set of knowledge graph nodes and the set of condition tags as input, associate and match the university professional knowledge graph with the course syllabus, determine the target chapter range and chapter level of the knowledge graph node set in the course syllabus, and set the level weight of the knowledge graph node set based on the chapter level; S23. Using Using the target chapter range, chapter level, level weight, knowledge graph node set, and condition label set as input, a hierarchical semantic constraint framework is constructed. The knowledge graph node set and its target chapter range in the course syllabus are defined as hard constraints, and the condition label set is defined as soft constraints. S24: A consistency check is performed using the hierarchical semantic constraint framework as input. The consistency check includes: verifying that the knowledge graph node corresponding to the hard constraint belongs to the target chapter range based on the course syllabus, and verifying that there is no preset mutual exclusion relationship between the condition labels corresponding to the soft constraint based on the university's professional knowledge graph. The result is a hierarchical semantic constraint framework that has passed the consistency check.
2. The progressive question generation method based on semantic analysis and knowledge graph as described in claim 1, characterized in that, S1 includes: S11. Receive the question-setting request text input by the user, perform text cleaning and word segmentation on the question-setting request text to obtain preprocessed text; S12. Perform distributed caching storage on the data corresponding to the preset high-frequency fields in the preprocessed text, and use a hash sharding strategy to divide the key space. Calculate the eviction probability of the data in the distributed cache storage using an enhanced least recently used eviction strategy. : ; And based on the elimination probability Perform cache eviction or retention, where As a time decay weight; S13. Perform dependency parsing using the preprocessed text as input, and select the optimal dependency tree from the candidate dependency tree set. The optimal dependency tree satisfy: ; And based on the optimal dependency tree Extract the terms corresponding to the core knowledge points to obtain a set of required keywords; S14. Using the preprocessed text as input, perform sequence labeling to identify terms corresponding to additional conditions, obtaining a set of optional limiting terms, wherein the label sequence... The sequence scores satisfy: ; In the formula Let be the transition matrix of the conditional random field. Encode features for BERT; Output the set of required keywords and the set of optional qualifiers.
3. The progressive question generation method based on semantic analysis and knowledge graph as described in claim 1, characterized in that, S3 include: S31. Using the question text and question templates in the question bank as input, establish an inverted index with terms as keys and question identifiers as values, and associate each question identifier in the inverted index with its knowledge point tag to obtain the indexed question bank; S32. Using the set of required keywords and the hierarchical semantic constraint framework that has passed consistency testing as input, recall question texts and question templates containing the set of required keywords in the indexed question bank based on the inverted index to obtain a hard-matching recall set, and calculate the recall rate of the hard-matching recall set. : ; In the formula This represents the number of questions in the hard-match recall set that match the set of required keywords. The total number of questions in the index question bank that match the set of required keywords is the hard match recall set and the recall rate. Output; S33. Using the knowledge graph node set, the chapter level and the level weight in the hierarchical semantic constraint framework as input, expand along the nodes adjacent to the knowledge graph node set in the university professional knowledge graph, calculate the semantic similarity between the adjacent nodes and the set of required keywords, and apply the level weight decay constraint to the adjacent nodes according to the chapter level to determine the expansion depth. Select the nodes that simultaneously satisfy the semantic similarity threshold and the expansion depth constraint to form the expanded knowledge point set. S34. Using the extended knowledge point set as input, retrieve the question text and question template that match the knowledge point tags corresponding to the extended knowledge point set from the index question bank to obtain the soft extended set; S35. Using the hard-matched recall set and the soft-expansion set as input, the two are deduplicated and merged, and the source path of each merged question is recorded. The candidate question material set is then output.
4. The progressive question generation method based on semantic analysis and knowledge graph as described in claim 1, characterized in that, S4 include: S41. Obtain the target course domain corpus, which includes the question stem text, reference answer, analysis text, and knowledge point tags and difficulty levels corresponding to the question stem text, and construct a training sample set for domain fine-tuning; S42. Using the training sample set as input, perform supervised learning training on the pre-trained large language model, and execute adversarial training during the supervised learning training process, wherein the input sequence for the training samples is as follows: The target output is The loss function is The model is Disturbance is The disturbance amplitude constraint is The parameters are updated by solving the following objective function. To obtain a domain-fine-tuned large language model: ; S43. Using the candidate question material set and the hierarchical semantic constraint framework that has passed consistency detection as input, the question text or question template in the candidate question material set and the hard constraints and soft constraints in the hierarchical semantic constraint framework are concatenated according to the preset field order to generate the model input sequence. S44. Using the model input sequence as input, input the model input sequence into the domain fine-tuning large language model to generate a candidate question set, wherein each candidate question in the candidate question set includes a question stem text, a reference answer and an analysis text, and output the candidate question set.
5. The progressive question generation method based on semantic analysis and knowledge graph as described in claim 1, characterized in that, S5 include: S51. Using the candidate question set as input, for each candidate question in the candidate question set, extract the question stem text, reference answer, and analysis text, and extract the knowledge point tags corresponding to the question stem text to form structured candidate question data; S52. Using the structured candidate question data, the set of required keywords, the set of optional limiting words, and the hierarchical semantic constraint framework that has passed consistency detection as input, calculate a feature vector for each candidate question. The feature vector includes: required keyword satisfaction feature, optional limiting word satisfaction feature, course syllabus matching feature, and question diversity feature, wherein the course syllabus matching feature... Based on the target chapter range calculation corresponding to the hard constraints in the hierarchical semantic constraint framework, the question diversity feature is calculated based on the semantic similarity between candidate questions; S53, using the feature vector of each candidate question as input, the feature vector of each candidate question is input into the learning ranking model to obtain the ranking score of each candidate question, wherein the learning ranking model is the LambdaMART model, and the LambdaMART model uses normalized loss cumulative gain as the optimization objective; S54, using the ranking score as input, the candidate question set is sorted according to the ranking score, and the re-ranked candidate question set is output.
6. The progressive question generation method based on semantic analysis and knowledge graph as described in claim 1, characterized in that, S6 include: S61. Using the reordered candidate question set as input, extract the question stem text, reference answer and analysis text for each candidate question in the reordered candidate question set, and obtain the candidate knowledge graph node set corresponding to the candidate question based on knowledge point tags and entity links. S62. Using the candidate knowledge graph node set and the hierarchical semantic constraint framework that has passed consistency testing as input, perform a course syllabus consistency check. The course syllabus consistency check includes: verifying that the candidate knowledge graph node set belongs to the target chapter range corresponding to the hard constraints in the hierarchical semantic constraint framework, and outputting a subset of candidate questions that pass the course syllabus consistency check. S63. Using the subset of candidate questions that pass the course syllabus consistency check, the candidate knowledge graph node set, and the university professional knowledge graph as input, perform a chapter-level constraint check. The chapter-level constraint check includes: verifying that the association relationship between any two nodes in the candidate knowledge graph node set satisfies the preset chapter-level constraints in the university professional knowledge graph, and outputting a subset of candidate questions that pass the chapter-level constraint check. S64. Using the candidate question subset that has passed the chapter-level constraint verification, the set of required keywords, and the set of optional limiting words as input, perform a quality assessment. The quality assessment includes: semantically representing the question stem text and parsing text of each candidate question and calculating its semantic similarity to the knowledge graph node set corresponding to the set of required keywords; retaining candidate questions with semantic similarity not lower than a preset similarity threshold; verifying the field integrity of the question stem text, the reference answer, and the parsing text; verifying that the condition label set corresponding to the set of optional limiting words is consistent with the difficulty level and question type label of the candidate questions; outputting the candidate questions that have passed the quality assessment as the final question set; and outputting the generation process information corresponding to each question in the final question set.
7. The progressive question generation method based on semantic analysis and knowledge graph as described in claim 1, characterized in that, S7 includes: S71. Receive user feedback information for each question in the final question set. The feedback information includes an acceptance feedback signal or a rejection feedback signal, and optionally includes a reason tag corresponding to the rejection feedback signal. S72. Using the feedback information and the question corresponding to the feedback information as input, obtain the hierarchical semantic constraint framework and generation process information corresponding to the question, and associate and store the question, the feedback information, the hierarchical semantic constraint framework, and the generation process information to form an incremental sample set. S73. Using the incremental sample set as input, determine questions with acceptance feedback signals as positive incremental samples and questions with rejection feedback signals as negative incremental samples. Based on the semantic similarity between the question stem text and the parsing text, determine the semantic similarity of the negative incremental samples. Candidate questions with a similarity score not lower than a preset threshold are identified as the suppression set; S74, using the positive incremental samples and the suppression set as input, incremental updates are performed on the domain fine-tuning large language model. The incremental update includes using the question stem text, reference answer, and analysis text of the positive incremental samples as supervised learning samples to update the model parameters, and reducing the selection weight of the question text or question template corresponding to the suppression set during the generation sampling stage; S75, using the positive incremental samples and the negative incremental samples as input, incremental training data for learning the ranking model is constructed, and incremental updates are performed on the learning ranking model so that in the subsequent step S5, the learning ranking model assigns higher ranking scores to the features corresponding to the positive incremental samples and lower ranking scores to the features corresponding to the negative incremental samples.
8. The progressive question generation method based on semantic analysis and knowledge graph as described in claim 6, characterized in that, In step S64, the quality assessment further includes solvability verification and answer consistency verification. The solvability verification includes: converting the question stem text into an executable solution expression or solution script based on the question type label and executing the solution to obtain the verification answer. The answer consistency verification includes: comparing the verification answer with the reference answer and retaining candidate questions whose consistency meets the preset conditions.
9. The progressive question generation method based on semantic analysis and knowledge graph as described in claim 7, characterized in that, In step S71, the feedback information further includes the feedback user type and feedback confidence level; in step S73, sample weights are assigned to positive incremental samples and negative incremental samples based on the feedback confidence level; in step S74, during the sampling generation stage, the selection weight of the question text or question template corresponding to the inhibition set is reduced in a graded manner according to the sample weights, so as to reduce the excessive inhibition caused by a small number of rejection feedbacks during the cold start stage.