Content parsing model training methods and content parsing methods
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-21
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]然而,监督微调要求模型输出结果与标注样本元素完全一致,仅因元素表述形式、集合排列顺序存在差异,即便模型识别的特征元素整体一致,也会被判定为错误并施加惩罚,易产生矛盾训练信号
Smart Images

Figure CN122571103A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of content parsing technology, and in particular to a content parsing training method and a content parsing method. Background Technology
[0002] With the rapid development of artificial intelligence technology, large language models have been widely applied in the field of education. Among them, the question knowledge point classification system is a major model whose function is to identify the knowledge points tested in the questions from a predefined set of knowledge point candidates. Currently, the question knowledge point classification system adopts a supervised fine-tuning method, using manually labeled element samples to ensure that the model output is consistent with the manually labeled sample elements.
[0003] However, supervised fine-tuning requires the model's output to be completely identical to the labeled sample elements. Even if the model identifies identical features, differences in element representation or set arrangement can lead to errors and penalties, potentially generating contradictory training signals. Furthermore, supervised fine-tuning lacks fine-grained learning signals. When the model correctly identifies some knowledge points but misses others, it still incurs the same penalty as a complete error, preventing positive feedback and reducing learning efficiency. Summary of the Invention
[0004] In view of this, embodiments of this specification provide a content parsing training method. One or more embodiments of this specification simultaneously relate to a content parsing method, a question / knowledge point parsing method, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.
[0005] According to a first aspect of the embodiments of this specification, a content parsing method is provided, including: Obtain the sample content and the set of sample elements; The initial parsing model is invoked to parse the sample content element by element, and the predicted element set of the sample content is obtained. By comparing the sample element set and the prediction element set, a sample prediction index is obtained, which reflects the degree of matching between the sample element set and the prediction element set. Based on the sample prediction metrics, reinforcement learning is applied to the initial parsing model to obtain a trained content parsing model.
[0006] According to a second aspect of the embodiments of this specification, a content parsing method is provided, including: Retrieve the content to be parsed; The content parsing model is invoked to parse the content to be parsed, and the set of elements of the content to be parsed is obtained. The content parsing model is trained based on the method provided in the first aspect above.
[0007] According to a third aspect of the embodiments of this specification, a method for analyzing knowledge points in a question is provided, including: Get the question to be analyzed; The content parsing model is invoked to analyze the knowledge points of the question to be parsed, thereby obtaining the set of knowledge points of the question to be parsed. The content parsing model is trained based on the methods provided in the first or second aspect above.
[0008] According to a fourth aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the methods provided in the first or second aspect above.
[0009] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the method provided in the first or second aspect described above.
[0010] According to a sixth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the method provided in the first or second aspect described above.
[0011] This specification provides a content parsing model training method according to one embodiment, comprising: acquiring sample content and a set of sample elements; calling an initial parsing model to parse the sample content into elements, thereby obtaining a set of predicted elements for the sample content; comparing the set of sample elements and the set of predicted elements to obtain a sample prediction index, wherein the sample prediction index is used to reflect the degree of matching between the set of sample elements and the set of predicted elements; and performing reinforcement learning on the initial parsing model based on the sample prediction index to obtain a trained content parsing model.
[0012] This invention introduces a sample element set and a predicted element set as comparison benchmarks. Because these sets possess the technical characteristics of being unordered, having no restrictions on the arrangement order, and not constraining the sentence structure, as long as the feature elements identified by the model are generally consistent, even if the element order differs or the textual expression has normal variations, the two element sets can still be considered a match. This fundamentally avoids the current practice of supervised fine-tuning requiring the output sequence to be completely identical to the labeled text, eliminating the problem of error penalties and contradictory training signals caused by differences in expression form and set arrangement order. Simultaneously, this invention generates a sample prediction index based on the overall matching degree of the two element sets, using the overall matching degree to determine the relationship between the two sets, thus solving the problem of current supervised fine-tuning only having two evaluation criteria: correct and incorrect. When the model identifies some knowledge points but misses others, it can obtain a corresponding positive gradient reward signal, rather than being judged as completely incorrect and penalized. Finally, reinforcement learning training is performed on the initial analytical model based on the sample prediction index, providing fine-grained differential optimization signals based on the set matching degree. This guides the model to focus on iterative optimization of the knowledge point matching ability itself, gradually improving the knowledge point recognition ability and giving the model stronger annotation tolerance and scenario application capabilities. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating a content parsing training method provided in one embodiment of this specification; Figure 2 This is a flowchart illustrating the calculation of a sample prediction index according to one embodiment of this specification; Figure 3 This is a flowchart illustrating a method for analyzing knowledge points in a problem, as provided in one embodiment of this specification. Figure 4 This is an architecture diagram of a content parsing system provided in one embodiment of this specification; Figure 5 This is a schematic diagram of the structure of a content parsing model training device provided in one embodiment of this specification; Figure 6 This is a schematic diagram of the structure of a content parsing device provided in one embodiment of this specification; Figure 7 This is a schematic diagram of the structure of a question and knowledge point analysis device provided in one embodiment of this specification; Figure 8 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0014] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0015] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items. The term “at least one” as used in one or more embodiments of this specification means “one or more,” and “a plurality of” means “two or more.” The term “comprising” is an open-ended description and should be understood as “including but not limiting,” and may include other content in addition to what has been described.
[0016] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0017] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in one or more embodiments of this specification are obtained through open-source datasets or public datasets that comply with their license agreements, or are obtained with full authorization from the relevant parties. Moreover, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0018] In one or more embodiments of this specification, a large model refers to a deep learning model with a large number of model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of model parameters. A large model can also be called a foundation model. It is pre-trained using large-scale unlabeled corpora to produce a pre-trained model with hundreds of millions of parameters. Such models can adapt to a wide range of downstream tasks and have good generalization ability. Examples include Large Language Models (LLMs) and multi-modal pre-training models.
[0019] In practical applications, large models only require a small number of samples to fine-tune the pre-trained model before they can be applied to different tasks. Large models can be widely used in fields such as Natural Language Processing (NLP) and Computer Vision. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and Image Generation, as well as natural language processing tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios of large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
[0020] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0021] Large-scale language models are artificial intelligence models based on deep learning architectures and pre-trained on massive amounts of text data. They possess powerful natural language understanding, logical reasoning, code generation, and multi-turn dialogue capabilities, and can predict and generate coherent natural language text sequences based on context.
[0022] Reinforcement learning (RL) is a machine learning training paradigm in which an agent continuously interacts with the environment to obtain reward feedback signals, iteratively optimizes its own decision-making strategy, and thus completes adaptive learning of the target task.
[0023] Support Vector Machine (SVM) is a supervised machine learning algorithm. Its core idea is to find an optimal hyperplane in the feature space that separates samples of different classes while maximizing the margin between the two classes. The minority sample points that determine this hyperplane are called "support vectors," thus giving SVM good generalization ability and robustness.
[0024] Bidirectional Encoder Representations from Transformers (BERT) is a pre-trained language model based on the Transformer architecture. Its core innovation lies in the use of a bidirectional encoding mechanism, which can simultaneously utilize the contextual information on the left and right sides of words for representation learning. It is pre-trained on large-scale unlabeled text through two tasks: masked language model and next sentence prediction, and can then be fine-tuned in downstream tasks.
[0025] Robustly Optimized BERT Pretraining Approach (RoBERTa) is an improved version of BERT. RoBERTa makes several optimizations to BERT: removing the next-sentence prediction task, using larger-scale training data and longer training time, employing a dynamic masking strategy, and using larger batch sizes. These improvements enable RoBERTa to achieve superior performance compared to BERT on various natural language processing tasks.
[0026] Reinforcement Learning from Human Feedback (RLHF) is a commonly used training framework for large-scale model alignment. It trains a reward model based on human-labeled data and uses reward signals to guide and optimize the output strategy and value orientation of large-scale language models.
[0027] Proximal Policy Optimization (PPO) is a classic reinforcement learning algorithm that limits the magnitude of a single policy update by pruning constraints, preventing excessively large parameter update steps from causing training crashes and ensuring smooth convergence of the model during training.
[0028] Group Relative Policy Optimization (GRPO) is a lightweight reinforcement learning algorithm that abandons the traditional value evaluation network and adopts a grouping mechanism with multiple candidate outputs for the same input. It calculates the relative advantage by standardizing the rewards within the group and completes the iterative optimization of the model policy.
[0029] Group Sequence Policy Optimization (GSPO) is an improved reinforcement learning algorithm based on relative policy optimization. It increases the granularity of importance weight calculation from the character level to the complete sequence level, effectively suppressing variance fluctuations in long text training and improving training stability.
[0030] Supervised Fine-Tuning (SFT) is a mainstream training method for adapting large models to specific tasks. It uses high-quality, manually labeled task samples to perform supervised parameter fine-tuning on pre-trained base models, enabling the models to adapt to the input-output logic and response specifications of specific tasks.
[0031] Rollout: This is a sampling mechanism in the large model generation stage. For the same input text, the model generates multiple different candidate output sequences through policy reasoning, providing diverse samples for subsequent group training and reward evaluation.
[0032] Prompt: Also known as a prompt or instruction, it is a command, question, or contextual information entered by the user when interacting with a large language model. It aims to guide the large language model to understand the task intent and generate output that meets expectations. A high-quality prompt design can significantly stimulate the potential capabilities of a large language model, enabling it to complete complex reasoning, style imitation, or output tasks with specific formats without updating parameters, thus significantly improving output quality and relevance.
[0033] Tokens are the smallest basic units for text processing, encoding, and generation in large language models. Text is segmented into individual tokens by the model using a tokenizer. These tokens can be a Chinese character, a letter, a word, a punctuation mark, or a word fragment. All semantic encoding, probability prediction, loss calculation, and sequence generation in the model are performed on a token-by-total basis.
[0034] With the continuous development of artificial intelligence technology, LLM has been widely applied in intelligent education scenarios. Classifying knowledge points in educational questions is a core task of intelligent education systems. For a given question and its corresponding subject, grade level, question stem, options, answer, and explanation, the system needs to automatically identify and distinguish the knowledge points being tested from a predefined candidate set of knowledge points.
[0035] The candidate set of knowledge points typically contains dozens to hundreds of knowledge point labels. These labels have complex relationships of semantic similarity and hierarchical inclusion, which makes it difficult for the model to distinguish them accurately. At the same time, there are primary and secondary relationships among knowledge points. There is no strict linguistic distinction between primary and secondary knowledge points. The same knowledge point may play the role of primary or secondary knowledge point in different question contexts. Simple multi-classification tasks are difficult to model such hierarchical relationships of contextual association.
[0036] In the early stage, manual rule matching and keyword retrieval methods were adopted. Only relying on manually written templates to map the question text to predefined knowledge point labels, and completing the maintenance of the rule system manually. This not only has a high maintenance cost, but also has a limited semantic coverage range and cannot adapt to question scenarios with complex semantic expressions. Later, traditional machine learning models such as SVM and random forest were introduced. By manually extracting question features, a multi-label classifier was constructed to achieve knowledge point classification. However, limited by the ability of manual feature design, it is difficult to construct the semantic association between questions and knowledge points, resulting in a decrease in accuracy. After that, fine-tuning was carried out relying on pre-trained deep learning models such as BERT and RoBERTa, which greatly improved the text semantic understanding ability. However, the overall model can only achieve flat multi-label classification, and cannot effectively model the hierarchical subordination and semantic boundary fuzzy association relationships between primary and secondary knowledge points, and it is difficult to distinguish the dynamic change scenarios of the primary and secondary roles of the same knowledge point in different question contexts.
[0037] The current solution is the knowledge point classification method of LLM and SFT. This solution constructs a prompt by combining the complete information of the question and the predefined knowledge point candidate list, and inputs it into the LLM in the form of an instruction, forcing the model to output the primary knowledge point list and the secondary knowledge point list in a fixed JSON (JavaScript Object Notation) format. In the training stage, currently, SFT takes maximizing the log-likelihood of the standard annotated output sequence as the training objective, and its training objective formula is to maximize the log-likelihood of the standard annotated output sequence, as shown in the following formula (1): <00,00109>
[0038] (1) where, Lrepresents the SFT loss function, π θ represents the probability distribution of the model, y t represents the true target token at the t-th position, and the superscript * indicates that this is the correct answer marked in the dataset. y is the complete output sequence of the annotation (including the JSON structure and the knowledge point text). Its meaning is to let the model learn to generate as many words as the true target y <t in the given input x and the previously generated prefix y t as possible. The model takes the per-token cross-entropy loss as the optimization basis, requiring that each Token character, JSON structure symbol, and knowledge point text generated by the model must be exactly the same as the manually annotated sequence, and strictly implementing per-character exact match supervision.
[0039] Meanwhile, large-scale reinforcement learning techniques have also been iteratively developed. Among them, PPO constrains the policy update step size through a clipping mechanism and relies on an additional reward model and a Critic value network to complete the advantage function estimation. GRPO adopts a same-input, multi-output group sampling method, uses the mean reward within the group as a baseline to calculate the relative advantage, calculates the importance ratio at the token position, and completes the policy update. GSPO improves the granularity of importance weight calculation from the token level to the complete sequence level, achieves sequence-level constraints through the stopping gradient trick, and ensures training stability with a minimal clip update range.
[0040] However, existing training schemes for educational question knowledge point classification based on LLM and SFT still have significant shortcomings in practical applications. First, supervised fine-tuning requires the model output to be completely consistent with the labeled sample elements. Even if the model recognizes the same feature elements as a whole, differences in element representation or set arrangement can lead to errors and penalties, easily generating contradictory training signals. Second, current supervised fine-tuning only has two evaluation dimensions: correct and incorrect, lacking fine-grained learning gradient signals. When the model misses only a few minor knowledge points and the overall recognition result is partially correct, it will still be penalized for mismatched JSON structure characters, failing to receive corresponding positive reinforcement and reducing the model's training efficiency.
[0041] Meanwhile, the token-by-token loss mechanism cannot distinguish between output format errors and knowledge point recognition errors. It applies the same penalty to two completely different types of errors: those with valid formats but redundant predictions of irrelevant knowledge points, and those with disordered formats that cannot be parsed. Furthermore, supervised fine-tuning forces the model to additionally learn and memorize meaningless token content such as fixed JSON structure characters, resulting in redundant supervision overhead and weakening the core capabilities of semantic understanding and accurate knowledge point matching. Finally, supervised fine-tuning only optimizes the final output sequence and cannot set rewards for the intermediate processes of knowledge point selection and reasoning. Moreover, existing general reinforcement learning algorithms such as PPO, GRPO, and GSPO are not customized for hierarchical multi-label classification tasks involving primary and secondary knowledge points, lacking dedicated reward mechanisms. They struggle to adapt to the characteristic that set matching takes precedence over hierarchical attribution, and cannot simultaneously meet the practical needs of labeling tolerance, hierarchical incentives, and training stability.
[0042] To address the above issues, this specification provides a content parsing training method. One or more embodiments of this specification relate to a content parsing method, a question / knowledge point parsing method, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0043] See Figure 1 , Figure 1This specification illustrates a flowchart of a content parsing training method according to an embodiment, which specifically includes the following steps: Step 102: Obtain the sample content and sample element set.
[0044] It should be noted that sample content refers to complete and related information containing the content to be trained. For example, complete content-related data, including question information, subject, grade level, question stem, options, answer, and explanation, serves as the raw input material for the model to analyze knowledge points.
[0045] A sample element set refers to the collection of knowledge point tags annotated by annotators in the content corresponding to the sample content. For example, it can be a manually annotated set of knowledge points, which includes knowledge point elements. Alternatively, it can be a subset of main knowledge points and a subset of secondary knowledge points annotated manually. The main knowledge points are the core knowledge points tested in the training content, while the secondary knowledge points are auxiliary knowledge points that are involved in the training content but are not core. The main knowledge point subset and the secondary knowledge point subset are integrated to form the sample element set.
[0046] For example, the sample content is as follows: the subject is Chinese language and the grade level is primary school. The question stem is a text of questions related to fables with the theme of "Chinese Wisdom in Fables", along with question options, standard answers, and question explanations. The main knowledge point subset and the secondary knowledge point subset are manually labeled based on the sample content. The two subsets are then merged and summarized to form the sample element set corresponding to the question.
[0047] In practical applications, there are many ways to obtain sample content and sample element sets, and the specific method should be selected according to the actual situation. This specification does not impose any limitations on the comparison of embodiments. In one possible implementation of this specification, the sample content can be constructed according to a set input data format. The sample content has a unified field structure, including a question information (question_info) field and a candidate knowledge point (candidate_keypoints) field. The question_info field encapsulates the complete question text, including subject, grade level, question stem, options, answer, and explanation. The candidate_keypoints field is a predefined list of knowledge point candidate tags, typically selecting 10 to 50 tags to form the candidate set. Simultaneously, the sample content also includes manually labeled fields, including a main knowledge point list (main_keypoint) and a secondary knowledge point list (normal_keypoint). The subset of main knowledge points corresponding to main_keypoint and the subset of secondary knowledge points corresponding to normal_keypoint are merged and integrated into a unified set without hierarchical distinction, which serves as the sample element set corresponding to the question.
[0048] Step 104: Call the initial parsing model to parse the elements of the sample content and obtain the predicted element set of the sample content.
[0049] It should be noted that the initial parsing model refers to the LLM that has not been trained by set matching reinforcement learning as described in this manual. It has basic text understanding, knowledge point recognition and JSON structure output capabilities and is used to parse knowledge point elements in sample content.
[0050] Element parsing refers to the process by which the initial parsing model identifies and filters the set of elements corresponding to the sample content from predefined candidate tags of knowledge points based on the sample content, and outputs them in a specified format.
[0051] The predicted element set refers to the set of elements output by the initial parsing model after parsing the same sample content, which serves as the set for matching and comparison with the sample element set.
[0052] For example, elementary school fable topics are used as sample content. Based on a pre-set set of candidate tags for knowledge points, the initial parsing model outputs a set of predicted elements in JSON format after element parsing.
[0053] In practical applications, there are many ways to implement the initial parsing model to parse the elements of the sample content. The specific method should be chosen according to the actual situation, and the embodiments in this specification do not impose any limitations on this. In another possible implementation method, a weakly supervised pseudo-label-guided parsing method can be used to obtain the predicted element set of the sample content. An initial pseudo-label set is first constructed through non-model rule processing, and then the model is guided to complete the verification and correction to obtain the predicted element set of the sample content.
[0054] In one optional embodiment of this specification, the above-mentioned invocation of the initial parsing model to perform element parsing on the sample content and obtain the predicted element set of the sample content may include the following steps: Based on the sample element set and sample content, a parsing prompt message is constructed. The parsing prompt message is used to guide the initial parsing model to parse the sample content based on the sample element set. Input the parsing prompts into the initial parsing model to obtain the set of predicted elements for the sample content.
[0055] It should be noted that the parsing prompts are instructional texts constructed based on the sample content and the candidate knowledge point list corresponding to the sample element set. They are used to set the model role, clarify task requirements, etc., and guide the initial parsing model to complete the parsing of knowledge point elements according to the specified rules.
[0056] For example, the sample content is a text from a primary school Chinese language subject's fable-themed question. The candidate knowledge point list corresponding to the sample element set includes tags such as "cultural allusion," "narrative work title," "narrative work genre," and "whole book reading title." Based on the question information and the candidate knowledge point list, a parsing hint information is constructed, including a system role description, the original question text, a list of candidate knowledge points, and output in JSON format. This parsing hint information is fed into the initial parsing model, which identifies the knowledge points corresponding to the question according to the hint information, and then organizes them to obtain the corresponding prediction element set.
[0057] Specifically, the input data format includes the `question_info` and `candidate_keypoints` fields. The prompt information is assembled and parsed according to a fixed Prompt template, which is divided into two parts: a System role description and a User task description. The System side is configured as follows: the model is defined as a professional education knowledge point classification expert, explicitly requiring the differentiation between primary and secondary knowledge points from candidate knowledge points, and stating that primary knowledge points are the core examination objectives of the question, while secondary knowledge points are auxiliary examination content. The User side inputs complete `question_info` question information, lists all `candidate_keypoints` candidate knowledge points, and mandates that the model output the primary and secondary knowledge point lists in a fixed JSON format.
[0058] The assembled complete parsing hints are input into the initial parsing model. After semantic understanding, candidate knowledge point selection, and primary and secondary knowledge point division, the initial parsing model outputs compliant JSON structured data. The output is parsed to obtain the main_keypoint list and the normal_keypoint list, which are then merged and summarized to form a complete set of predicted elements.
[0059] In practical applications, there are many ways to input parsing prompts into the initial parsing model to obtain the predicted element set of sample content. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. One possible implementation in this specification involves constructing and executing the model according to a preset input data format and the Prompt module. Another possible implementation uses a dynamic adaptive Prompt generation method to improve the model's adaptability and generalization ability across different question scenarios. The dynamic adaptive Prompt generation method does not rely on a fixed Prompt template and can adaptively adjust the prompt content according to different question scenarios, further improving the scenario adaptability of the parsing prompts and providing a more flexible guidance method for the model's stable output in diverse question parsing tasks.
[0060] By applying the solutions in the embodiments of this specification and constructing parsing prompts, the output specifications of the initial parsing model can be standardized, forcing the model to filter and identify only within a predefined range of candidate knowledge points, thus avoiding the output of irrelevant knowledge points. Simultaneously, by unifying output format constraints, subsequent automated parsing and set comparison processing are facilitated.
[0061] Step 106: Compare the sample element set and the prediction element set to obtain the sample prediction index, which reflects the degree of matching between the sample element set and the prediction element set.
[0062] It is important to note that the sample prediction index is a quantitative evaluation result obtained by comparing the sample element set with the prediction element set as a whole, and is used to reflect the degree of matching similarity between the two sets of knowledge points.
[0063] For example, the sample element set corresponding to the sample content contains knowledge points: narrative genre and cultural allusion. After the initial parsing model parses the sample content, the predicted element set only contains the knowledge point: narrative genre. The two sets are compared as a whole, and the corresponding sample prediction index is calculated based on the degree of overlap and inclusion relationship to measure the matching degree of the model's knowledge point identification in this instance.
[0064] In practical applications, there are many ways to obtain sample prediction metrics by comparing the sample element set and the prediction element set. The specific method chosen depends on the actual situation, and the examples in this specification do not impose any limitations. One possible implementation in this specification is to obtain the sample prediction metrics based on a set similarity calculation method using element weights. First, assign a weight to each element in the sample element set, for example, by setting different weights based on the element's importance, frequency of occurrence, or label confidence. Calculate the sum of the weights of the elements at the intersection of the prediction element set and the sample element set, and divide this sum by the sum of the weights of all elements in the sample element set to obtain the weighted matching degree. This weighted matching degree is then directly used as the sample prediction metric.
[0065] In one optional embodiment of this specification, the above-mentioned comparison of the sample element set and the prediction element set to obtain the sample prediction index may include the following steps: By comparing the set of sample elements and the set of predicted elements, the set relationship can be obtained; Based on the set relationships, determine the sample prediction indicators.
[0066] It should be noted that set relations refer to the relationship between two sets obtained after comparing the sample element set and the prediction element set as a whole, and are used to distinguish the matching status of the two sets. Set relations can include inclusion, equality, and other similar relationships.
[0067] For example, the sample element set contains knowledge point A and knowledge point B; the prediction element set obtained from the initial analytical model only contains knowledge point A. Comparing the sample element set with the prediction element set determines that the two sets have an inclusion relationship. Based on this inclusion relationship, the corresponding sample prediction index is determined.
[0068] The scheme implemented in this specification obtains the set relationship by comparing the sample element set and the prediction element set, and then determines the sample prediction index based on the set relationship. On the one hand, it no longer adopts the current evaluation method of forced sequence matching per token and character in supervised fine-tuning, but instead performs a logical comparison from the perspective of the entire knowledge point set, avoiding the problem of misjudgment and punishment due to subjective differences in the manual annotation of primary and secondary knowledge points or differences in model hierarchical division. On the other hand, by using the set subordination logic as the judgment basis, the assignment of the sample prediction index no longer depends on the surface similarity of the text, but on the quantification of the matching degree based on the actual overlap and inclusion relationship of knowledge points, making the evaluation criteria more in line with the knowledge point classification task.
[0069] In one optional embodiment of this specification, determining the sample prediction index based on set relationships may include the following steps: When the set relation indicates that the set of sample elements is the same as the set of predicted elements, the first indicator is determined as the sample prediction indicator. When the set relation indicates that the set of predicted elements is a proper subset of the set of sample elements, the second indicator is determined as the sample prediction indicator. When the set relation indicates that the sample element set is different from the sample element set, and the predicted element set is not a proper subset of the sample element set, the third indicator is determined as the sample prediction indicator, wherein the first indicator is greater than the second indicator, and the second indicator is greater than the third indicator.
[0070] It should be noted that the first indicator refers to the score when the sample element set and the predicted element set are completely identical; the second indicator refers to the score when the predicted element set falls within the range of the sample element set, but the number of elements is less than that of the sample element set; and the third indicator refers to the score when the sample element set and the predicted element set are completely different and there is no inclusion relationship between them.
[0071] For example, let's set the score for the first indicator to 1.0, the score for the second indicator to 0.5, and the score for the third indicator to 0. For the aforementioned elementary school fable-type questions, the manually labeled sample element set is {narrative genre, cultural allusion}. First case: The model identifies all knowledge points, i.e., the predicted sample element is {narrative genre, cultural allusion}, indicating that the two sets are completely identical. In this case, the first indicator with a score of 1.0 is selected as the sample prediction indicator. Second case: The model identifies some knowledge points, i.e., the predicted sample element is {narrative genre}, indicating that the predicted element set is a proper subset of the sample elements. In this case, the second indicator with a score of 0.5 is selected as the sample prediction indicator. Third case: The model identifies irrelevant knowledge points, i.e., the predicted sample element is {narrative title}, indicating that the predicted element set is neither the same as the sample element set nor has a subset relationship with it. In this case, the third indicator with a score of 0 is selected as the sample prediction indicator.
[0072] In practical applications, there are many ways to implement the classification of different scenarios based on set relationships and the corresponding setting of indicator levels. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. One possible implementation in this specification involves configuring the grading rules and preset fixed scores for the first, second, and third indicators according to the three set relationships. Another possible implementation in this specification employs a multi-dimensional weighted scoring method based on intersection or difference decomposition to achieve more refined indicator setting logic. This method does not preset fixed three-level indicator levels but dynamically generates scores based on the specific details of knowledge point identification through multi-dimensional decomposition and weighted combination, flexibly adapting to reward and punishment strategies in different business scenarios.
[0073] The solution implemented in this specification, by distinguishing three sets of logical relationships and configuring clear scores, compared with the current supervised fine-tuning technical solution that only judges the single mode of correct and incorrect, adopts a three-level fixed score, which can accurately distinguish between three states: completely correct recognition, partially correct recognition, and recognition error. For partially correct cases that only omit minor knowledge points, a positive score of 0.5 is given as recognition, and they are no longer penalized in the same way as completely incorrect recognition. At the same time, the overall evaluation standard is more in line with the real business logic of educational knowledge point classification tasks, which is conducive to improving the model's annotation fault tolerance and knowledge point recognition generalization ability.
[0074] In one optional embodiment of this specification, the above-mentioned set of predicted elements includes multiple subsets of predicted elements, and the multiple subsets of predicted elements have different degrees of importance relative to the sample content; Comparing the sample element set and the prediction element set to obtain the sample prediction index may include the following steps: The target set of predicted elements is obtained by taking the union of multiple subsets of predicted elements. By comparing the set of sample elements with the set of target prediction elements, the sample prediction index is obtained.
[0075] It should be noted that the predicted element subsets refer to different categories of subsets in the initial analytical model output, categorized according to the importance of knowledge points to the sample content. Specifically, these include the primary knowledge point subset and the secondary knowledge point subset predicted by the model, with significant differences in the weighting of these two subsets in the sample content examination. The target predicted element set refers to an integrated set of knowledge points obtained by merging multiple predicted element subsets of different importance through a union operation. This set no longer distinguishes between the hierarchy and importance differences of primary and secondary knowledge points, retaining only all knowledge point elements identified by the model.
[0076] For example, for sample content of elementary school fable questions, the model outputs two subsets of predicted elements with different levels of importance after parsing: the main knowledge point subset is an empty set, and the secondary knowledge point subset is {narrative genre}. The union of these two subsets is then performed to obtain the target predicted element set {narrative genre}. This target predicted element set is compared with the manually labeled sample element set {narrative genre, cultural allusion}. According to the aforementioned rules, it is determined to be a proper subset relationship, and a score of 0.5 is assigned to the second indicator. Even if the model divides the knowledge points into different positions within the main or secondary knowledge point subsets during output, as long as the identified knowledge point elements are consistent, the target predicted element set obtained after the union is exactly the same, and the final sample prediction indicator remains consistent.
[0077] In practical applications, there are many ways to merge multiple subsets of predicted elements to generate a target set of predicted elements. The specific method chosen depends on the actual situation, and the embodiments in this specification do not impose any limitations on this. In one possible implementation, the subsets of predicted elements of different importance levels output by the model can be uniformly processed by taking the union of their sets, and the merged overall set can be used as the comparison object.
[0078] The scheme implemented in this specification splits the set of predicted elements into multiple subsets of predicted elements with different levels of importance, and takes the union of multiple subsets of predicted elements before comparison to obtain the target set of predicted elements. In essence, while retaining the model's ability to distinguish the primary and secondary importance of knowledge points, it eliminates the hierarchical differences in the classification of primary and secondary knowledge points in the model output, and uses only the total number of knowledge points actually identified by the model as the basis for comparison.
[0079] In one optional embodiment of this specification, the above-mentioned sample element set includes multiple sample element subsets; Comparing the sample element set and the prediction element set to obtain the sample prediction index may include the following steps: The target set of sample elements is obtained by taking the union of multiple subsets of sample elements. By comparing the target sample element set with the predicted element set, the sample prediction index is obtained.
[0080] It should be noted that the sample element subset refers to a subset manually divided according to the importance of knowledge points, mainly including the manually annotated primary knowledge point subset and secondary knowledge point subset. The target sample element set refers to the unified standard knowledge point set formed by integrating multiple sample element subsets with different importance levels from the sample element set through a union operation. The target sample element set no longer distinguishes between primary and secondary knowledge point levels, and only retains all manually annotated knowledge point elements.
[0081] For example, for elementary school fable-related questions, two subsets of sample elements are manually generated: a primary knowledge point subset of {narrative genre} and a secondary knowledge point subset of {cultural allusions}. The union of these subsets is then performed to obtain the target sample element set of {narrative genre, cultural allusions}. This target sample element set is then compared with the predicted element set output by the model, and the corresponding predicted index score is determined based on the set relationships.
[0082] In practical applications, there are many ways to merge multiple subsets of sample elements to generate a target set of sample elements. The specific method chosen depends on the actual situation, and the embodiments in this specification do not impose any limitations on this. In one possible implementation, the subsets of sample elements of different importance levels from the manually annotated end are uniformly processed by taking the union of their sets, and the merged overall set is used as the standard benchmark for comparison.
[0083] The solution implemented in this specification constructs a target sample element set by taking the union of multiple sample element subsets from the manually annotated side. This unifies the annotated content, which originally had a primary and secondary hierarchy, into a unified set of knowledge points without hierarchical differences. Regardless of how the manual annotators classify the knowledge points into primary and secondary categories or what subjective differences exist in the annotation, a fixed and unified comparison benchmark can be obtained in the end. This eliminates the impact of the primary and secondary classification bias of manual annotation on the evaluation results, enhances the stability and annotation fault tolerance of the model training process, and is more in line with the actual application scenarios of educational questions where the boundaries between primary and secondary knowledge points are blurred and there are large subjective differences in annotation.
[0084] Step 108: Based on the sample prediction metrics, perform reinforcement learning on the initial parsing model to obtain the trained content parsing model.
[0085] It should be noted that reinforcement learning refers to a machine learning training method that uses sample prediction indicators as reward signals to continuously adjust model strategies and optimize model parameters. Through multiple rounds of iteration, the model's decision-making strategy in knowledge point parsing tasks continues to converge and be continuously optimized.
[0086] For example, the sample prediction metrics obtained above are given three gradient scores: 1.0, 0.5, and 0. These scores are used as the reward value for each question, and the GSPO algorithm is used to iteratively update the initial parsing model. Higher metric scores correspond to larger positive gradient updates; lower scores suppress the model's current strategy updates. After multiple rounds of sample cyclic training and parameter backpropagation iterations, the initial parsing model gradually converges, ultimately forming a content parsing model that can stably identify the primary and secondary knowledge points of a question and is unaffected by subjective differences in the primary and secondary labeling.
[0087] In practical applications, there are many types of algorithms and iterative update methods for reinforcement learning of the initial analytical model based on sample prediction metrics. The specific choice can be flexibly made according to hardware computing power, training time, and sequence length requirements. This specification's embodiments do not impose any limitations on these. In one possible implementation, the GSPO grouping sequence strategy optimization algorithm, which is the core specification of this specification, is preferentially used to complete model training. In another possible implementation, the GRPO algorithm or PPO algorithm can be used as equivalent alternatives. The GRPO algorithm uses a token-level importance ratio position-by-position update strategy to achieve lightweight training. The PPO algorithm relies on a reward model and a Critic value network to complete the advantage function estimation, making it suitable for general large-scale model training scenarios.
[0088] This invention introduces a sample element set and a predicted element set as comparison benchmarks. Because these sets possess the technical characteristics of being unordered, having no restrictions on the arrangement order, and not constraining the sentence structure, as long as the feature elements identified by the model are generally consistent, even if the element order differs or the textual expression has normal variations, the two element sets can still be considered a match. This fundamentally avoids the current practice of supervised fine-tuning requiring the output sequence to be completely identical to the labeled text, eliminating the problem of error penalties and contradictory training signals caused by differences in expression form and set arrangement order. Simultaneously, this invention generates a sample prediction index based on the overall matching degree of the two element sets, using the overall matching degree to determine the relationship between the two sets, thus solving the problem of current supervised fine-tuning only having two evaluation criteria: correct and incorrect. When the model identifies some knowledge points but misses others, it can obtain a corresponding positive gradient reward signal, rather than being judged as completely incorrect and penalized. Finally, reinforcement learning training is performed on the initial analytical model based on the sample prediction index, providing fine-grained differential optimization signals based on the set matching degree. This guides the model to focus on iterative optimization of the knowledge point matching ability itself, gradually improving the knowledge point recognition ability and giving the model stronger annotation tolerance and scenario application capabilities.
[0089] In one optional embodiment of this specification, since the set of predicted elements output by the model is directly compared without verifying the validity of the output format, there is a problem that JSON format errors cannot be distinguished. Therefore, in this embodiment of the specification, before comparing the set of sample elements and the set of predicted elements to obtain the sample prediction index, the following steps may also be included: Perform format validation on the predicted element set and obtain the format validation result; By comparing the set of sample elements with the set of predicted elements, we obtain the sample prediction metrics, including: If the format validation result is successful, the sample element set and the prediction element set are compared to obtain the sample prediction index.
[0090] It's important to note that format validation refers to checking the original structure of the predicted element set output by the initial parsing model. This primarily verifies whether it conforms to the preset JSON format, whether the fields are complete, and whether the fields of the main knowledge point subset and secondary knowledge point subset are standardized and compliant. The format validation result indicates whether the structured output of the predicted element set is valid and is categorized as either valid or failed.
[0091] For example, if the model outputs a standard JSON format list of primary and secondary knowledge points with complete fields and a standardized structure, and the format validation is deemed successful, the model will continue with the complete process of set comparison, set relationship determination, and assignment of sample prediction metrics. If the model outputs garbled characters, missing parentheses, or fields corresponding to primary and secondary knowledge points, and cannot correctly parse the subset of knowledge points, the format validation will be deemed a failure. In this case, the model will not proceed to the regular set comparison process and will be handled separately according to preset exception rules to avoid invalid data interfering with the normal training and evaluation system.
[0092] The solution implemented in this specification, by adding a format verification pre-step before set comparison, achieves layered control over output format compliance and knowledge point recognition accuracy, distinguishing between two different types of defects: format errors and knowledge point content recognition errors. Only after passing verification can the model proceed to the matching evaluation stage, improving the accuracy of model training evaluation, reducing interference from invalid and abnormal samples on the training gradient signal, and making model training feedback more accurate and reliable.
[0093] In one optional embodiment of this specification, since only the processing logic for successful format validation is set, and the score configuration for format validation failure is lacking, problems such as abnormal output without clear evaluation criteria and incomplete training reward mechanism may easily occur. Therefore, in this embodiment of the specification, after performing format validation on the set of predicted elements and obtaining the format validation result, the following steps may also be included: If the format validation result is a validation failure, the fourth indicator is determined as the sample prediction indicator, wherein the fourth indicator is less than the first indicator and less than the second indicator.
[0094] It should be noted that the fourth indicator refers to the score corresponding to the failure of model output format verification, which is lower than the first indicator and also lower than the second indicator.
[0095] For example, the first indicator has a score of 1.0, the second indicator has a score of 0.5, the third indicator has a score of 0, and the fourth indicator is preset to have a score of 0. When the model outputs a disordered format, cannot properly parse the subset of knowledge points, and the format validation result is "validation failed," the fourth indicator's score is 0. This score is significantly lower than the scores of the first and second indicators.
[0096] In practical applications, the specific score of the fourth indicator can be flexibly configured according to the training reward and punishment requirements, and the choice should be made based on the actual situation. This specification does not impose any limitations on this. In one possible implementation, the score of the fourth indicator is set equal to the score of the third indicator, making its score clearly lower than the first and second indicators. In another possible implementation, the score of the fourth indicator is set less than the score of the third indicator, making its score clearly lower than the first and second indicators.
[0097] By applying the solution in the embodiments of this specification, a fourth indicator is configured separately for format validation failures, and its score is limited to be lower than the first and second indicators. This fills the evaluation gap for abnormal model output scenarios and constructs a complete multi-level reward and punishment system. It not only imposes separate penalties on model behaviors with incorrect formatting and non-standard output, but also distinguishes between different levels of score levels for format errors, partial correct recognition, and complete correct recognition.
[0098] As an example, this specification provides a mathematical definition of a set matching reward function, namely the following formula (2): (2) Where r(y,G) represents the sample prediction index. P(y)=set(main_keypoint)∪set(normal_keypoint), is the target prediction element set, obtained by taking the union of multiple subsets of prediction elements output by the model. G=set(main_label)∪set(normal_label), is the target sample element set, obtained by taking the union of multiple subsets of manually labeled sample elements. G denotes that P is a strictly non-empty subset of G. If P=G, it means a complete match, and the model should output a score of 1. If P∈G, it means a partial match, and the model should output a score of 0.5. If P≠G, including P being larger than G, P being an empty set, or P not equal to G, the model should output a score of 0.
[0099] Table 1 shows the output scenarios and corresponding rewards of the set matching reward function.
[0100] Table 1. Output and Reward Correspondence of Set Matching Reward Function
[0101] For ease of understanding, the following examples illustrate the reward function provided in embodiments of this specification. For example, Figure 2 This document illustrates a flowchart of a sample prediction index calculation method provided in one embodiment. The initial parsing model outputs structured data containing main knowledge points and secondary knowledge points as required, forming prediction elements. The prediction elements are then validated for JSON format, field integrity, and subset structure validity. If format validation fails, the fourth index is determined as the sample prediction index and used as the reward value for this sample. In this embodiment, the score for the fourth index is 0.
[0102] If the format validation passes, continue with the next step: Construct a set of predicted elements by taking the union of multiple subsets of predicted elements output by the model, resulting in the target set of predicted elements to be compared. Construct a set of sample elements by taking the union of multiple manually labeled subsets of sample elements, resulting in the target set of sample elements for benchmarking. Compare the target set of sample elements with the target set of predicted elements, determining if they are identical, proper subsets, or dissimilar with no inclusion relationship.
[0103] Based on Table 1 above, determine whether the target sample element set and the target prediction element set are completely identical. If yes, the first indicator is determined as the sample prediction indicator, indicating a perfect match. If no, determine whether the target prediction element set is a strict subset of the target sample element set. If yes, the second indicator is determined as the sample prediction indicator, indicating a subset match. If no, the third indicator is determined as the sample prediction indicator, indicating the inclusion of irrelevant knowledge points or a complete error.
[0104] In one optional embodiment of this specification, a content parsing method is also provided, which includes: Retrieve the content to be parsed; The content parsing model is invoked to parse the content to be parsed, thereby obtaining the set of elements of the content to be parsed. The content parsing model is trained based on the content parsing model training method provided in the embodiments of this specification.
[0105] This invention introduces a sample element set and a predicted element set as comparison benchmarks. Because these sets possess the technical characteristics of being unordered, having no restrictions on the arrangement order, and not constraining the sentence structure, as long as the feature elements identified by the model are generally consistent, even if the element order differs or the textual expression has normal variations, the two element sets can still be considered a match. This fundamentally avoids the current practice of supervised fine-tuning requiring the output sequence to be completely identical to the labeled text, eliminating the problem of error penalties and contradictory training signals caused by differences in expression form and set arrangement order. Simultaneously, this invention generates a sample prediction index based on the overall matching degree of the two element sets, using the overall matching degree to determine the relationship between the two sets, thus solving the problem of current supervised fine-tuning only having two evaluation criteria: correct and incorrect. When the model identifies some knowledge points but misses others, it can obtain a corresponding positive gradient reward signal, rather than being judged as completely incorrect and penalized. Finally, reinforcement learning training is performed on the initial analytical model based on the sample prediction index, providing fine-grained differential optimization signals based on the set matching degree. This guides the model to focus on iterative optimization of the knowledge point matching ability itself, gradually improving the knowledge point recognition ability and giving the model stronger annotation tolerance and scenario application capabilities.
[0106] In one optional embodiment of this specification, a method for analyzing question knowledge is also provided, which includes: Get the question to be analyzed; The content parsing model is invoked to perform knowledge point parsing on the question to be parsed, thereby obtaining the set of knowledge points for the question to be parsed. The content parsing model is trained based on the content parsing model training method provided in the embodiments of this specification, or it is trained based on the content parsing method provided in the embodiments of this specification.
[0107] This invention introduces a sample element set and a predicted element set as comparison benchmarks. Because these sets possess the technical characteristics of being unordered, having no restrictions on the arrangement order, and not constraining the sentence structure, as long as the feature elements identified by the model are generally consistent, even if the element order differs or the textual expression has normal variations, the two element sets can still be considered a match. This fundamentally avoids the current practice of supervised fine-tuning requiring the output sequence to be completely identical to the labeled text, eliminating the problem of error penalties and contradictory training signals caused by differences in expression form and set arrangement order. Simultaneously, this invention generates a sample prediction index based on the overall matching degree of the two element sets, using the overall matching degree to determine the relationship between the two sets, thus solving the problem of current supervised fine-tuning only having two evaluation criteria: correct and incorrect. When the model identifies some knowledge points but misses others, it can obtain a corresponding positive gradient reward signal, rather than being judged as completely incorrect and penalized. Finally, reinforcement learning training is performed on the initial analytical model based on the sample prediction index, providing fine-grained differential optimization signals based on the set matching degree. This guides the model to focus on iterative optimization of the knowledge point matching ability itself, gradually improving the knowledge point recognition ability and giving the model stronger annotation tolerance and scenario application capabilities.
[0108] For example, Figure 3 The diagram illustrates a flowchart of a problem-solving method for knowledge points according to an embodiment of this specification. Figure 3 As shown. The process involves obtaining the question information from the training dataset as sample content. A predefined set of candidate knowledge points is obtained to limit the model's parsing scope. In the Prompt module, the question information and candidate knowledge point set are used to construct parsing hints. Meanwhile, manually labeled knowledge points are generated, consisting of a subset of primary knowledge points and a subset of secondary knowledge points, forming a set of sample elements. The primary and secondary knowledge points are then merged into a labeled set G.
[0109] The parsing prompts are input into the initial parsing model. In the Rollout sampling module, the current strategy model π_old is used to generate n=16 candidate answers to the question information, from which a set of predicted elements containing multiple subsets of predicted elements with different levels of importance is extracted. The predicted element set is then format-validated, and the format validation result is obtained. If the format validation fails, the fourth indicator is determined as the sample predicted indicator. If the format validation passes, the union of multiple subsets of sample elements is taken to obtain the predicted element set P. Based on the relationship between set P and set G, the first, second, or third indicator is determined as the sample predicted indicator.
[0110] The within-group index scores r_i are standardized to obtain the advantage estimate A_i = (r_i - μ) / σ, which is used for subsequent policy updates. Here, μ represents the average of the index scores r_i for each group, and σ represents the standard deviation of the index scores r_i for each group. Based on the sample prediction index, the GSPO algorithm is used to perform reinforcement learning on the initial parsing model, calculating the sequence-level policy loss. The update amplitude is constrained by a very small clip range (ε ≈ 0.0003) to ensure training stability. The loss is aggregated using a two-level seq-mean-token-mean algorithm, backpropagation is performed, and the model policy parameters are updated. This iteration continues until the model converges, resulting in the trained content parsing model.
[0111] The content parsing training method provided in the embodiments of this specification also involves a content parsing method and a question knowledge point parsing method. It is not limited to a single task scenario of classifying primary and secondary knowledge points in education, but can be extended to any multi-label classification task scenario with a hierarchical label structure. Examples include the classification of primary and accompanying diagnoses in the field of medical diagnosis, and the hierarchical classification of first-level and second-level categories in the field of e-commerce products—any task where the overall accuracy of the set recognition has a higher priority than the hierarchical classification of labels.
[0112] Considering the large number of model parameters in the task processing model and the limited computing resources of the client, the content parsing method proposed in the embodiments of this specification can be applied to, for example... Figure 4 The content parsing system shown is not limited to this. See also Figure 4 , Figure 4 This specification illustrates an architecture diagram of a content parsing system according to an embodiment of the present specification. The content parsing system may include a client 402 and a server 404. Client 402 is used to send content to be parsed or questions to be parsed to the server 404. The server-side 404 is used to receive content or questions to be parsed uploaded by the client 402, call the content parsing model, parse the content or questions to be parsed, obtain the corresponding set of elements or set of knowledge points, and then return the parsing results to the client 402. The client-side 402 response is also used to receive and display the set of elements or the results of knowledge point analysis returned by the server-side 404 response.
[0113] like Figure 4As shown, the content parsing model is deployed in server 404. Server 404 can connect to one or more clients 402 via a local area network (LAN), wide area network (WAN), internet connection, or other types of data network. Client 402 may include, but is not limited to, smartphones, tablets, laptops, PDAs, personal computers, smart home devices, and in-vehicle devices. Client 402 can also interact with the user through a graphical user interface to invoke the task processing model, thereby implementing the visual task processing method provided in the embodiments of this specification.
[0114] It is worth noting that the content parsing method provided in the embodiments of this specification is generally executed by the server. However, in other embodiments of this specification, if the client's runtime resources can meet the deployment and runtime conditions of the content parsing model, the client can also have similar functionality to the server, thereby executing the parsing method provided in the embodiments of this specification. In other embodiments, the content parsing method provided in the embodiments of this specification can also be executed jointly by the client and the server.
[0115] Corresponding to the above embodiments of the content parsing model training method, this specification also provides embodiments of the content parsing model training apparatus. Figure 5 A schematic diagram of a content parsing model training device according to one embodiment of this specification is shown. Figure 5 As shown, the device includes: The first acquisition module 502 is configured to acquire sample content and a set of sample elements, wherein the set of sample elements includes multiple subsets of sample elements with different levels of importance. The parsing training module 504 is configured to call the initial parsing model to perform element parsing on the sample content to obtain the predicted element set; The prediction index module 506 is configured to compare the sample element set and the prediction element set to obtain a prediction index, wherein the sample prediction index is used to reflect the degree of matching between the sample element set and the prediction element set. The reinforcement learning module 508 is configured to perform reinforcement learning on the initial parsing model based on the sample prediction index to obtain a trained content parsing model.
[0116] Optionally, the first acquisition module 502 is further configured to acquire sample content; acquire the main knowledge point subset and the secondary knowledge point subset generated by manual annotation to form a sample element set; and take the union of multiple sample element subsets to generate a target sample element set with a unified benchmark.
[0117] Optionally, the first acquisition module 502 is further configured to construct appropriate parsing prompts for any training sample content; input the parsing prompts into the initial parsing model; and output a set of prediction elements containing multiple subsets of prediction elements with different levels of importance.
[0118] Optionally, the first acquisition module 502 is further configured to perform format verification on the set of predicted elements to obtain the format verification result; when the verification passes, perform set comparison and index determination; when the verification fails, directly assign the fourth index as the sample prediction index.
[0119] Optionally, the first acquisition module 502 is further configured to, before comparing the sample element set and the predicted element set, take the union of the sample element subset and the predicted element subset respectively, smooth out the differences in primary and secondary hierarchical affiliation, and obtain the target sample element set and the target predicted element set that can be used for matching and comparison.
[0120] Optionally, the device further includes: a prompting construction module, configured to construct parsing prompt information based on sample content and sample element set, guiding the initial parsing model to complete element parsing within a preset knowledge point candidate range and output the predicted element set in a standardized format.
[0121] Optionally, the prediction index module 506 is further configured to compare the sample element set and the prediction element set to obtain a set relationship; and to determine the sample prediction index based on the set relationship.
[0122] Optionally, the prediction index module 506 is further configured to determine the first index as the sample prediction index when the set relation indicates that the sample element set and the prediction element set are the same; to determine the second index as the sample prediction index when the set relation indicates that the prediction element set is a proper subset of the sample element set; and to determine the third index as the sample prediction index when the set relation indicates that the sample element set and the prediction element set are different and the prediction element set is not a proper subset of the sample element set, wherein the first index is greater than the second index, and the second index is greater than the third index.
[0123] Optionally, the reinforcement learning module 508 is further configured to use the sample prediction index as the reinforcement learning signal, and use the GSPO algorithm, or optionally the GRPO or PPO algorithm, to iteratively update the parameters of the initial parsing model to obtain the trained content parsing model.
[0124] The scheme implemented in this specification introduces a sample element set and a prediction element set as comparison benchmarks. Because these sets possess the technical characteristics of being unordered, having no restrictions on the arrangement order, and not constraining the sentence structure, as long as the feature elements identified by the model are generally consistent, even if the element order differs or the textual expression has normal variations, the two element sets can still be considered a match. This fundamentally avoids the current deficiency in supervised fine-tuning, which requires the output sequence to be completely identical to the labeled text, and eliminates the problem of incorrect penalties and contradictory training signals caused by differences in expression form and set arrangement order. Furthermore, this invention generates a sample prediction index based on the overall matching degree of the two element sets, using the overall matching degree to determine the relationship between the two sets, thus solving the problem of current supervised fine-tuning only having two evaluation criteria: correct and incorrect. When the model identifies some knowledge points but misses others, it can obtain a corresponding positive gradient reward signal, rather than being judged as completely incorrect and penalized. Finally, reinforcement learning training is performed on the initial parsing model based on the sample prediction index. Fine-grained differential optimization signals are provided based on the set matching degree to guide the model to focus on the matching ability of the knowledge points themselves for iterative optimization, gradually improve the knowledge point recognition ability, and make the model have stronger annotation fault tolerance and scenario application ability.
[0125] The above is a schematic scheme of a content parsing model training device according to this embodiment. It should be noted that the technical solution of this content parsing model training device and the technical solution of the content parsing model training method described above belong to the same concept. For details not described in detail in the technical solution of the content parsing model training device, please refer to the description of the technical solution of the content parsing model training method described above.
[0126] Corresponding to the above method embodiments, this specification also provides embodiments of a content parsing device. Figure 6 A schematic diagram of a content parsing apparatus according to one embodiment of this specification is shown. Figure 6 As shown, the device includes: The second acquisition module 602 is configured to acquire the content to be parsed; The parsing execution module 604 is configured to input the content to be parsed into the content parsing model to obtain the set of elements of the content to be parsed, wherein the content parsing model is trained based on the aforementioned content parsing model training method.
[0127] Optionally, the device further includes a result output module, configured to perform structured organization and compliance verification of the element set output by the model, and output standardized element parsing results according to business requirements for use by upper-layer business systems.
[0128] By applying the solution in the embodiments of this specification, the trained content parsing model can be invoked simply by inputting the content to be parsed. It automatically completes semantic understanding and element parsing and outputs a standardized set of elements. It gets rid of the dependence of traditional models on strict character-by-character matching of the output sequence, has stronger annotation fault tolerance and semantic adaptation capabilities, can adapt to the parsing needs of different types of text content, lowers the threshold for business deployment, and improves the efficiency of automated content parsing and the versatility of applications.
[0129] The above is a schematic scheme of a content parsing device according to this embodiment. It should be noted that the technical solution of this content parsing device and the technical solution of the content parsing method described above belong to the same concept. For details not described in detail in the content parsing device, please refer to the description of the technical solution of the content parsing method described above.
[0130] Corresponding to the above-described examples of methods for analyzing knowledge points in questions, this specification also provides examples of devices for analyzing knowledge points in questions. Figure 7 This specification illustrates a schematic diagram of a problem-solving device according to one embodiment. Figure 7 As shown, the device includes: The third acquisition module 702 is configured to acquire the questions to be parsed. The knowledge point parsing module 704 is configured to input the question to be parsed into the content parsing model to obtain the set of knowledge points of the question to be parsed. The content parsing model is trained based on the above-mentioned content parsing model training method.
[0131] Optionally, the device also includes a classification and labeling module, which is configured to classify the knowledge points of the questions to be analyzed and label the main and secondary knowledge points according to the output set of knowledge points, and can be applied to educational business scenarios such as question bank organization, intelligent test paper generation, and learning analysis.
[0132] The solution implemented in this specification is designed for educational scenarios, allowing access to questions to be analyzed. It automatically completes semantic understanding of the questions and classification of knowledge points based on a trained content analysis model, accurately outputting a standardized set of knowledge points. It is unaffected by subjective differences in the form of the questions or the annotation of primary and secondary knowledge points, adapting to the question analysis needs of multiple disciplines and grade levels, and significantly improving the automation level and practicality of knowledge point annotation in educational question banks and intelligent teaching applications.
[0133] The above is a schematic scheme of a question knowledge point analysis device according to this embodiment. It should be noted that the technical solution of this question knowledge point analysis device and the technical solution of the question knowledge point analysis method described above belong to the same concept. For details not described in detail in the question knowledge point analysis device, please refer to the description of the technical solution of the question knowledge point analysis method described above.
[0134] Figure 8This specification illustrates a structural block diagram of a computing device according to one embodiment. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.
[0135] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Networks (WLAN) interface, a Wi-MAX (World Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0136] In one embodiment of this specification, the above-described components of the computing device 800 and Figure 8 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 8 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0137] The computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 800 can also be a mobile or stationary server.
[0138] The processor 820 is used to execute computer programs / instructions, which, when executed by the processor, implement the steps of the above-mentioned content parsing model training method, content parsing method, or question knowledge point parsing method.
[0139] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the technical solutions of the content parsing model training method, content parsing method, or question knowledge point parsing method described above. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solutions of the content parsing model training method, content parsing method, or question knowledge point parsing method described above.
[0140] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described content parsing model training method, content parsing method, or question knowledge point parsing method.
[0141] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solutions of the content parsing model training method, content parsing method, or question knowledge point parsing method described above. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solutions of the content parsing model training method, content parsing method, or question knowledge point parsing method described above.
[0142] An embodiment of this specification also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-described content parsing model training method, content parsing method, or question knowledge point parsing method.
[0143] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product belongs to the same concept as the technical solutions of the above-mentioned content parsing model training method, content parsing method, or question knowledge point parsing method. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solutions of the above-mentioned content parsing model training method, content parsing method, or question knowledge point parsing method.
[0144] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0145] Computer instructions include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in computer-readable media can be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0146] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0147] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0148] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
[0149] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A content parsing model training method, characterized in that, include: Obtain the sample content and the set of sample elements; The initial parsing model is invoked to parse the sample content element by element, thereby obtaining the predicted element set of the sample content; By comparing the set of sample elements and the set of predicted elements, a sample prediction index is obtained, wherein the sample prediction index is used to reflect the degree of matching between the set of sample elements and the set of predicted elements. Based on the sample prediction index, reinforcement learning is performed on the initial parsing model to obtain a trained content parsing model.
2. The method according to claim 1, characterized in that, The step of comparing the set of sample elements and the set of predicted elements to obtain the sample prediction index includes: By comparing the set of sample elements and the set of predicted elements, the set relationship is obtained; Based on the set relationship, the sample prediction index is determined.
3. The method according to claim 2, characterized in that, The step of determining the sample prediction index based on the set relationship includes: When the set relationship indicates that the set of sample elements is the same as the set of predicted elements, the first indicator is determined as the sample prediction indicator; When the set relation indicates that the set of predicted elements is a proper subset of the set of sample elements, the second indicator is determined as the sample prediction indicator. When the set relation indicates that the set of sample elements is different from the set of sample elements, and the set of predicted elements is not a proper subset of the set of sample elements, the third indicator is determined as the sample prediction indicator, wherein the first indicator is greater than the second indicator, and the second indicator is greater than the third indicator.
4. The method according to claim 1, characterized in that, The set of predicted elements includes multiple subsets of predicted elements, and the multiple subsets of predicted elements have different degrees of importance relative to the sample content; The step of comparing the set of sample elements and the set of predicted elements to obtain the sample prediction index includes: The union of the multiple subsets of predicted elements is used to obtain the target set of predicted elements. The sample prediction index is obtained by comparing the sample element set with the target prediction element set.
5. The method according to claim 1, characterized in that, The set of sample elements includes multiple subsets of sample elements; The step of comparing the set of sample elements and the set of predicted elements to obtain the sample prediction index includes: The target sample element set is obtained by taking the union of the multiple subsets of sample elements. By comparing the target sample element set and the prediction element set, the sample prediction index is obtained.
6. The method according to claim 1, characterized in that, The step of calling the initial parsing model to parse the sample content element by element to obtain the predicted element set of the sample content includes: Based on the set of sample elements and the sample content, a parsing prompt message is constructed, wherein the parsing prompt message is used to guide the initial parsing model to perform element parsing of the sample content based on the set of sample elements; The parsing prompt information is input into the initial parsing model to obtain the set of predicted elements of the sample content.
7. The method according to any one of claims 1 to 6, characterized in that, Before comparing the sample element set and the prediction element set to obtain the sample prediction index, the method further includes: Perform format validation on the predicted element set to obtain the format validation result; The step of comparing the set of sample elements and the set of predicted elements to obtain the sample prediction index includes: If the format verification result is successful, the sample element set and the prediction element set are compared to obtain the sample prediction index.
8. The method according to claim 7, characterized in that, After performing format validation on the predicted element set and obtaining the format validation result, the method further includes: If the format verification result is a verification failure, the fourth indicator is determined as the sample prediction indicator, wherein the fourth indicator is less than the first indicator and less than the second indicator.
9. A content parsing method, characterized in that, include: Get the content to be parsed; The content parsing model is invoked to parse the elements of the content to be parsed, thereby obtaining the set of elements of the content to be parsed, wherein the content parsing model is trained based on the method described in any one of claims 1 to 8.
10. A method for analyzing knowledge points in exam questions, characterized in that, include: Get the question to be analyzed; The content parsing model is invoked to perform knowledge point parsing on the question to be parsed, thereby obtaining a set of knowledge points for the question to be parsed. The content parsing model is trained based on the method described in any one of claims 1 to 9.
11. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that, It stores a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 10.
13. A computer program product, characterized in that, Includes a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 10.