Question block division method and device, electronic equipment and storage medium

The semantic and structural information of the test paper is extracted through the deep learning model and combined with reinforcement learning, which solves the problem that the traditional test paper question block division method relies on fixed rules, achieves more accurate and flexible question block division, and improves the adaptability and adaptability of the intelligent education system. accuracy.

CN118779449AActive Publication Date: 2024-10-15IFLYTEK CO LTD

Patent Information

Application Number
CN202410848438.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-15
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

The traditional method of dividing test paper question blocks relies on fixed rules, cannot fully utilize the structural information and textual semantic information of the test paper content, and lacks a real-time learning mechanism, resulting in insufficient information utilization and poor adaptability.

Method used

The deep learning model is used to extract the semantic information and structural information of the test paper through the first encoder and the second encoder, and the label sequence is generated through the decoder. It is combined with the reinforcement learning mechanism for real-time optimization, reducing rule dependence and improving information utilization efficiency.

Benefits of technology

It achieves more accurate and flexible question block division, enhances the model's adaptability to different test paper contents and structures, and improves the processing flexibility and accuracy of the intelligent education system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779449A_ABST
    Figure CN118779449A_ABST
Patent Text Reader

Abstract

The invention provides a question block division method and device, electronic equipment and a storage medium, and belongs to the technical field of education, and the method comprises the steps: obtaining an original sequence and an element sequence representing test paper contents; encoding the original sequence through a first encoder to extract semantic information of the original sequence, and generating a first semantic representation; encoding the element sequence through a second encoder to extract the structural information of the element sequence, and generating a second semantic representation; splicing the first semantic representation and the second semantic representation to fuse semantic and structural information of the test paper to obtain a test paper semantic representation; the semantic representation of the test paper is decoded through a decoder, a label sequence is generated, and the label sequence is used for representing the position of each row of content in the test paper in the question block structure. According to the method, the rule dependence is reduced, the information utilization efficiency is improved, and a learning mechanism is introduced through the decoding process, so that the model can adapt to different test paper contents and structures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of educational technology, and in particular to a method, device, electronic device and storage medium for dividing a topic into blocks. Background Art

[0002] In intelligent education applications, intelligent analysis of test papers is a core link, and question segmentation is a key step to achieve this goal. Question segmentation refers to accurately identifying and marking the start and end line numbers of each question in the test paper document. This process is crucial for the subsequent execution of question analysis, answer extraction, intelligent grading, and functional test paper composition.

[0003] Patent document (CN201610290763.3) decomposes the electronic test paper into major questions and minor questions through structured analysis technology, and classifies the question types. This method converts the test paper into XML format and generates an electronic test paper in HTML format, but it relies on preset rules and formatting processing procedures. Patent document (CN201910885041.6) divides the test paper into multiple paragraphs according to the test paper structure characteristics by establishing a test paper information feature library, and automatically splits the test paper into independent test papers by identifying the introduction paragraph and the serial number paragraph, but it is still based on preset rules. Patent document (CN202011496539.2) uses image processing technology to identify the objective questions and test number areas in the test paper, and performs image correction through affine correction technology. This method mainly focuses on image processing, but fails to make full use of the structural information and text semantic information of the test paper content. Summary of the invention

[0004] The present application provides a method, device, electronic device and storage medium for dividing test questions into blocks, aiming to solve the problems of strong rule dependence, insufficient information utilization and lack of real-time learning mechanism in the traditional method of dividing test questions into blocks.

[0005] In a first aspect, the present application provides a method for dividing a topic into blocks, which is applied to a topic block division model. The topic block division model includes a first encoder, a second encoder, and a decoder. The method for dividing a topic into blocks includes:

[0006] Obtaining the original sequence and element sequence representing the content of the test paper;

[0007] Encoding the original sequence by the first encoder to extract its semantic information and generate a first semantic representation; and encoding the element sequence by the second encoder to extract its structural information and generate a second semantic representation;

[0008] splicing the first semantic representation and the second semantic representation to fuse the semantic information and structural information of the test paper, thereby obtaining a semantic representation of the test paper;

[0009] The test paper semantic representation is decoded by the decoder to generate a label sequence, and the label sequence is used to indicate the position of each line of content in the test paper in the question block structure.

[0010] In a second aspect, the present application further provides a question block division device, which is applied to a question block division model, wherein the question block division model includes a first encoder, a second encoder and a decoder, and the question block division device includes:

[0011] An acquisition module, used for acquiring an original sequence and an element sequence representing the content of the test paper;

[0012] An encoding module, configured to encode the original sequence by the first encoder to extract its semantic information and generate a first semantic representation; and to encode the element sequence by the second encoder to extract its structural information and generate a second semantic representation;

[0013] A fusion module, used for splicing the first semantic representation and the second semantic representation to fuse the semantic information and structural information of the test paper to obtain a semantic representation of the test paper;

[0014] The decoding module is used to decode the semantic representation of the test paper through the decoder to generate a label sequence, and the label sequence is used to indicate the position of each line of content in the test paper in the question block structure.

[0015] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of the method for dividing question blocks as described in any one of the first aspects are implemented.

[0016] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for dividing question blocks as described in any one of the first aspects are implemented.

[0017] The present application provides a method, device, electronic device and storage medium for dividing question blocks. The method first uses a first encoder and a second encoder to extract the semantic information of the original sequence and the structural information of the element sequence. It does not rely on fixed rules, but adapts to different test paper contents and structures by learning the data itself. Secondly, the semantic and structural information of the test paper is fused by splicing the first semantic representation and the second semantic representation, which means that the model can consider the meaning and structure of the test paper content at the same time, thereby making more comprehensive use of information. Finally, a label sequence is generated through a decoder. This process can be regarded as a learning mechanism. The model can adjust itself according to the difference between the generated label sequence and the actual label sequence, thereby achieving a certain degree of real-time learning and optimization.

[0018] Therefore, this application automatically extracts and integrates the semantic and structural information of the test paper through a deep learning model to generate a label sequence, thereby reducing rule dependence and improving information utilization efficiency. A learning mechanism is introduced through the decoding process, so that the model can adapt to different test paper contents and structures. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 It is a flow chart of the method for dividing the topic blocks provided by this application;

[0021] Figure 2 It is a schematic diagram of a question block division model provided in an embodiment of the present application;

[0022] Figure 3 is a schematic diagram of a training reward model provided in an embodiment of the present application;

[0023] Figure 4 is a schematic diagram of a reward model provided in an embodiment of the present application;

[0024] Figure 5 It is a schematic diagram of an optimization question block division model provided in an embodiment of the present application;

[0025] Figure 6 is a schematic diagram of shared parameters provided in an embodiment of the present application;

[0026] Figure 7 It is a structural schematic diagram of the question block division device provided by the present application;

[0027] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein.

[0030] The following is an explanation of the terms used in this application.

[0031] Reinforcement Learning (RL) is a branch of machine learning that focuses on how an agent can take a series of actions in an environment to obtain the maximum cumulative reward. Unlike supervised learning and unsupervised learning, reinforcement learning emphasizes learning the optimal strategy through trial-and-error, that is, what actions should be taken in a given state.

[0032] In this application, an agent refers to a chunking model that is responsible for dividing the content in a test paper or educational material into different chunks. In reinforcement learning, the goal of an agent is to maximize some form of reward. In this application, the reward is feedback from a teacher who actually uses the chunking model in the educational process and provides feedback on its performance. In order to convert the teacher's feedback into a signal that the agent can understand and learn, this application proposes a reward model that is responsible for converting the teacher's feedback into specific reward signals so that the chunking model can adjust its optimization strategy based on these signals to better meet educational needs.

[0033] In order to solve the problem that the traditional method of dividing the topic depends on fixed rules or templates (these rules may not be applicable to all types of test papers or educational materials), and cannot make full use of all relevant information in the test paper (especially semantic information and structural information), and lacks the ability to make real-time adjustments and optimizations according to actual usage. The present application provides a method, device, electronic device and storage medium for dividing the topic block. By using a deep learning model such as a topic block division model, it does not rely on fixed rules, but adapts to different test paper contents and structures by learning the data itself. In addition, by splicing the first semantic representation and the second semantic representation, the model can simultaneously consider the meaning and structure of the test paper content, thereby making more comprehensive use of information. The decoder also generates a label sequence, and the model can adjust its own parameters according to the difference between the generated label sequence and the actual label sequence, so as to achieve a certain degree of real-time learning and optimization.

[0034] This application can be applied to intelligent education systems to help automatically divide the question blocks in test papers or educational materials, improve teaching efficiency and personalized learning experience. It can also be applied to online learning platforms. Online education platforms can use the question block division method described in this application to optimize the organization and presentation of questions, making the learning content more structured and easy to understand. It can also be applied to educational assessment. For example, in the field of educational assessment and test preparation, the question block division method described in this application can help generate more reasonable question block divisions, which helps to evaluate students' learning progress and understanding.

[0035] In general, this application automatically processes and optimizes the division of question blocks through a deep learning model, which not only improves the flexibility and accuracy of test paper processing, but also enhances the model's adaptability to different educational scenarios, thus having broad application prospects in the field of intelligent education.

[0036] Combine the following Figure 1-Figure 8 The subject block division method, device, electronic device and storage medium of the present application are described.

[0037] Please refer to Figure 1 , Figure 1 A method for dividing a question block is applied to a question block dividing model, wherein the question block dividing model includes a first encoder, a second encoder and a decoder, and the method for dividing a question block includes:

[0038] S110, obtaining the original sequence and element sequence representing the test paper content.

[0039] Specifically, the original sequence refers to the text or data of the test paper content in its original, unprocessed form. For example, if the test paper is a series of math questions, then the original sequence is the text description of these questions, arranged in the order in which they appear in the test paper. The element sequence refers to the key information extracted from the original sequence, which helps to understand the structure and content of the test paper. The element sequence can include the type of question (such as multiple-choice questions, fill-in-the-blank questions, answer questions, etc.), difficulty level, knowledge point label, etc. These elements can help the model better understand the organization of the test paper and the focus of the content.

[0040] In the process of question segmentation, both types of sequences are very important. The original sequence provides complete information about the test content, while the element sequence provides structured information that helps the model understand and process this content. By combining these two types of sequences, the model can more accurately identify and segment different question segments in the test, thereby achieving more efficient and accurate question segmentation.

[0041] S120, encoding the original sequence through the first encoder to extract its semantic information and generate a first semantic representation; and encoding the element sequence through the second encoder to extract its structural information and generate a second semantic representation.

[0042] Specifically, the first encoder and the second encoder can be a neural network component, such as an encoder based on a recurrent neural network (RNN), a long short-term memory network (LSTM), or a Transformer architecture. The first semantic representation is an intermediate representation generated after the original sequence is processed by the first encoder. It captures the semantic information in the original sequence and reflects the meaning and contextual relationship of the test content. The second semantic representation is an intermediate representation generated after the element sequence is processed by the second encoder. It captures the structural information in the element sequence and reflects the organization and structural characteristics of the test content.

[0043] The purpose of this step is to extract useful information from the original sequence and the element sequence respectively, and convert this information into a representation that can be further processed by the model. In this way, the model can simultaneously consider the meaning (semantic information) and organization (structural information) of the test content, thereby more comprehensively understanding and processing the test content, and providing a more accurate basis for the subsequent question block division.

[0044] S130, concatenating the first semantic representation and the second semantic representation to fuse the semantic information and structural information of the test paper to obtain a semantic representation of the test paper.

[0045] Specifically, concatenation is an operation that connects two or more vectors or sequences in a certain dimension to form a longer vector or sequence. In this step, concatenation means connecting the first semantic representation and the second semantic representation in a certain dimension (such as the feature dimension) so that they can be considered by the model at the same time. The test paper semantic representation is the final representation obtained by concatenating the first semantic representation and the second semantic representation, which integrates the semantic and structural information of the test paper.

[0046] The purpose of this step is to create a more comprehensive and rich representation that not only contains the meaning of the test content, but also the way the content is organized. Such a comprehensive representation helps the model understand and process the test more accurately, thereby making better decisions in the task of question segmentation.

[0047] S140, decoding the semantic representation of the test paper by the decoder to generate a label sequence, where the label sequence is used to indicate the position of each line of content in the test paper in the question block structure.

[0048] Specifically, the decoder is a neural network component that is generally used in pair with the encoder. The task of the decoder is to extract information from the intermediate representation generated by the encoder and generate a label sequence. The label sequence is the result of the decoder output, which is used to indicate the position of each line of content in the test paper in the question block structure. In other words, the label sequence can divide the content of the test paper into different question blocks, and each question block can correspond to a question type (such as multiple-choice questions, fill-in-the-blank questions, answer questions, etc.).

[0049] The purpose of this step is to convert the semantic and structural information of the test paper content into an actual question block division, so that the question type corresponding to each part of the test paper and its position in the question block structure can be clearly indicated. Such a label sequence is very useful for automated test paper analysis, scoring or teaching assistance tools, because it can help these tools understand and process the test paper content more accurately.

[0050] The above steps S110 to S140 are described in detail below.

[0051] Please refer to Figure 2 , Figure 2 It is a schematic diagram of the question block division model provided in an embodiment of the present application.

[0052] Exemplarily, in S110, the original sequence and element sequence representing the test paper content are obtained, and the implementation steps include:

[0053] S111, obtain the original test paper.

[0054] Specifically, the test paper in the Word document format of the original test paper is converted into HTML (Hypertext Markup Language) format to generate an original sequence, namely an HTML sequence. HTML is a standard markup language for creating web pages, which can represent document content in a structured manner. This conversion is to facilitate subsequent automated processing, because the HTML format is easier to be parsed and operated by computer programs.

[0055] S112, parsing the test paper in HTML format line by line, identifying the elements of each line to generate an element sequence.

[0056] Specifically, the feature sequence can be obtained by parsing the HTML sequence line by line using a preset feature extraction function. This means that the feature extraction function will check the HTML code line by line to identify different elements in each line. The elements may include question type descriptions (such as multiple-choice questions, fill-in-the-blank questions, etc.), question descriptions (specific content of the questions), questions (specific questions to be answered), options (answer options for multiple-choice questions), text (other text information), pictures (image content in the test paper), etc., which can be represented by fac=Fac(html). fac=Fac(html) means that these elements are extracted using a feature extraction function called Fac(). It receives HTML code as input and outputs a structured representation containing the identified elements (such as a dictionary, list, or other data structure). fac is the output of this function, which represents the feature information extracted from the HTML code.

[0057] The purpose of this step is to convert the test paper content from one format to another more easily processed format and extract key information from it for further analysis and processing. This parsing process is very important for automated test paper analysis systems because it allows the system to understand and process the content of the test paper to perform tasks such as automatic scoring, content analysis, or teaching assistance.

[0058] In one embodiment, the topic division method described in the present application further includes:

[0059] S100, using the original sequence and the element sequence to train the topic division model, to obtain the initial topic block division model, denoted as M_pt.

[0060] In other words, the question segmentation model M_pt obtained through the training process is a pre-trained model. This means that M_pt has been trained on a specific dataset and can be used as a starting point for other related tasks. In subsequent tasks, M_pt can be fine-tuned to adapt to new datasets. The advantage of a pre-trained model is that it has learned the common features in the data, so it can usually converge faster and perform better on new tasks.

[0061] Exemplarily, S100 includes:

[0062] S101, input the original sequence and the element sequence into the question block division model.

[0063] This step shows that the model input is two sequences: one is the extracted element sequence (including question type, question description, question and other elements), and the other is the original HTML sequence (including the HTML code of the test paper content). It can be input offline.

[0064] S102, using two encoders of the question block division model to encode the original sequence and the element sequence.

[0065] In this step, the topic segmentation model uses two encoders to process the input sequence. The first encoder Encoder_html is responsible for encoding the HTML sequence into an intermediate representation to obtain the first semantic representation E_html, while the second encoder Encoder_fac is responsible for encoding the feature sequence into an intermediate representation to obtain the second semantic representation E_fac. The purpose of this is to extract structural information and semantic information from the feature sequence and HTML sequence respectively.

[0066] S103, concatenating the intermediate representations obtained by the two encoders.

[0067] That is to say, after splicing the intermediate representations obtained by the above Encoder_fac and Encoder_html, the test paper semantic representation E of the entire test paper is obtained, E=E_html+E_fac.

[0068] The purpose of this step is to concatenate the intermediate representations obtained by the two encoders to create a comprehensive semantic representation of the test paper. The "+" symbol here represents the concatenation operation, that is, connecting E_html and E_fac in a certain dimension to form a more comprehensive representation E.

[0069] S104: Use a decoder to decode the test paper semantic representation to generate a label sequence.

[0070] That is to say, a decoder is used to take E as input and decode the specific label sequence S, where the length of S is the total number of rows in the entire test paper. i ∈{B, I, O} represents each element S in the label sequence S i (where i is the position index in the sequence) can be any of the labels B, I or O, which are used to indicate the position of each line of content in the question block structure. S i ∈{B, I, O} corresponds to each line of the test paper, where B, I, and O are labels. B indicates that the line is the beginning of a new question (or question block), I indicates that the line is the middle part of the current question (or question block), that is, it is not the starting line, and O indicates that the line does not belong to any question (or question block) and may be a title, description, or other non-question content. These labels help the model understand and identify the question block structure in the test paper, so as to perform more accurate analysis and processing.

[0071] The purpose of the entire process of steps S101 to S104 is to obtain a comprehensive test paper semantic representation by using two encoders to process different input sequences separately and then concatenating their outputs. The test paper semantic representation is then used by the decoder to generate a label sequence that describes the position of each line of content in the test paper in the question block structure. The label sequence is very important for the automated test paper analysis system because it allows the system to understand and process the content of the test paper, thereby performing tasks such as automatic scoring, content analysis, or teaching assistance.

[0072] In some embodiments, the method for dividing the question blocks further includes post-processing the tag sequence, which may specifically include:

[0073] S105, concatenating each tag in the tag sequence into a continuous character string, which reflects the question type structure of the test paper content, and different tags in the character string correspond to different question block types and positions.

[0074] For example, concatenate each label of the label sequence [O,O,B,I,I,O] into a continuous string "OOBIIO". Different labels in the label sequence correspond to different question block types and positions:

[0075] The first O: indicates that the first row does not belong to any major question.

[0076] The second O: indicates that the second row does not belong to any major question either.

[0077] The third B: indicates that the third line is the beginning of a new question.

[0078] The fourth I: indicates that the fourth row is the middle part of this question.

[0079] The fifth I: indicates that the fifth row is also the middle part of this question.

[0080] The sixth O: Indicates that the sixth row does not belong to any major question.

[0081] In this way, it is clear which rows in the test belong to a question and where they are located in the question. This structured information is very useful for automated processing and analysis of test content, such as for tasks such as automatic scoring, question block identification or content analysis.

[0082] S106, matching is performed in the concatenated string to obtain substrings reflecting the starting and ending positions of the question, each substring corresponds to a question range, and the range is represented in the form of a two-tuple, including the starting line number and the ending line number of the question.

[0083] For example, you can use regular expressions to match in the concatenated string. In the regular expression, * is a quantifier, which means that the element before it can appear zero times, one time, or multiple times. For example, in the regular expression "BI*", it means matching a B followed by zero, one, or more I's. When searching with the regular expression "BI*", you can match B, BI, and BII. For the concatenated sequence "OOBIIO", the substring that can be matched is "BII". The range of the big question corresponding to this substring is (3,5), which means that the matched substring starts from index position 3 and ends at index position 5. The index position is usually counted from 0). In this example, rows 3-5 of the test paper will be divided into one big question.

[0084] The purpose of post-processing the generated label sequence in the above steps S105 to S106 is to further optimize and adjust the boundaries of the question blocks to ensure that the division of the question blocks is more accurate and meets actual needs.

[0085] Furthermore, online reinforcement learning and optimization of the initial question segmentation model can improve the accuracy of question segmentation and ensure that the question segmentation model can more accurately identify and segment the question segments in the test paper. In addition, optimizing the question segmentation model can better utilize teacher feedback and data from actual use, forming a continuous improvement feedback loop, and continuously improving the performance of the question segmentation model to meet the needs of automated processing and analysis in the education field.

[0086] The following is a reinforcement learning fine-tuning of the initial question block division model to continuously optimize the question block division model online.

[0087] For some examples, please refer to Figure 3 , Figure 3 Schematic diagram of the training reward model provided in the embodiment of the present application. The question block division method described in the present application is also applied to the reward model, and the question block division model is optimized by using the reward model, including:

[0088] S301, continuously acquiring an original sequence, a tag sequence, and a corrected sequence after correcting the tag sequence.

[0089] For example, the original sequence is recorded as html. The initial question block division model (recorded as M_pt, i.e., the initial question block division model) is used to divide the actual online test paper into question blocks, and a label sequence is generated, recorded as S_model. If the teacher is not satisfied with the question blocks automatically divided by the question block division model, the boundary of the question block can be manually adjusted through a graphical user interface (GUI). The background system will generate a new correction sequence based on the teacher's adjustment, recorded as S_teacher.

[0090] The system can continuously obtain receipts online. These data exist in the form of triples (html, S_model, S_teacher), including the original sequence html, the label sequence S_model generated by the question block division model, and the corrected sequence S_teacher after correction by the teacher.

[0091] S302, when the number of corrected sequences reaches or exceeds a preset threshold, the obtained original sequence, label sequence and corrected sequence are used as training data to train the reward model to evaluate the quality of the label sequence generated by the question block division model.

[0092] For example, when the number of collected correction data triplets reaches or exceeds the preset threshold B, the system uses these data to train a new model, which is called the “reward model” and is denoted by M. R . Reward Model M R It is used to evaluate the quality of question block division and provide feedback to optimize the question block division model.

[0093] Therefore, the question segmentation model is continuously optimized by combining automated question segmentation and teacher feedback to improve its accuracy and practicality.

[0094] For example, please refer to Figure 4 , Figure 4 is a schematic diagram of a reward model provided in an embodiment of the present application. In the above S302, the step of training the reward model includes:

[0095] S3021, obtain the semantic representation of the test paper extracted by the question block division model.

[0096] Specifically, the semantic representation of the test paper is calculated:

[0097] E=Encoder_fac(Fac(html))+Encoder_html(html).

[0098] Among them, E represents the test paper semantic representation, Encoder_html is an encoder that encodes the original sequence html. Encoder_fac is another encoder that encodes the feature sequence Fac(html). The outputs of these two encoders are added together to form the final test paper semantic representation E.

[0099] It should be noted that the two encoders in this step can reuse the dual encoders in the question block division model, but when training the reward model, the parameters of this part will not be updated to prevent affecting the test paper semantic representation ability that the question block division model has learned. In other words, when training the reward model, the parameters of the two encoders of the question block division model will not be updated. The reason for doing this is to maintain the test paper semantic representation ability that the question block division model has learned, and avoid negative impact on this part of the ability when training the reward model.

[0100] S3022: Using a preset third encoder, extract corresponding partition semantic representation from the label sequence or the correction sequence.

[0101] Specifically, the partition semantic representation of the label sequence S_model or the correction sequence S_teacher is calculated. This part uses a separate encoder (called the third encoder), that is, E_s=Encoder_s(s), where s represents S_model or S_teacher.

[0102] S3023, concatenate the test paper semantic representation and the partition semantic representation into vectors, and map the concatenated vectors into a scalar through a preset mapping model, the value of which represents the reward score of the reward model for the current label sequence.

[0103] Specifically, the reward score is based on the semantic representation of the test paper and the semantic representation of the label sequence, which can be used to guide the training of the question block division model to optimize the effect of question block division. The reward score is calculated by concatenating the results of S3021 and S3022 above, and using a mapping model P to map the concatenated vector (i.e., the test paper semantic representation E and the division semantics E_s) to a scalar r, r = P (E + E_s). The value of the scalar r can be a positive number, a negative number, or zero, depending on the quality of the label sequence.

[0104] The mapping model P can be a multi-layer feedforward neural network (FNN). A feedforward neural network is a neural network structure that consists of multiple layers, each layer contains multiple neurons, and information flows in only one direction in the network, from the input layer to the output layer. The feedforward neural network is used to convert the concatenated vector into a scalar. The last layer of the network is one or more neurons, whose output is used to represent the reward score.

[0105] For example, when training the reward model, a loss function needs to be configured, which is used to measure the difference between the label sequence and the correction sequence. Using the loss function as a guide, the question segmentation model is fine-tuned through a reinforcement learning mechanism to gradually reduce the difference between the label sequence and the correction sequence.

[0106] Specifically, for each corrected data triplet, the reward score generated by the reward model for the label sequence S_model is r1, and the reward score generated for the correction sequence S_teacher is r2. The loss function of the reward model is set to max(r1-r2+0.1,0).

[0107] Among them, the meaning of the loss function max(r1-r2+0.1,0) is: first calculate the difference between r1 and r2, that is, r1-r2. This difference represents the score difference between the model output and the corrected output. Then add a constant 0.1, that is, r1-r2+0.1. This constant is a preset boundary value used to ensure that the loss function does not become too small because the difference between r1 and r2 is too small. Finally, take the maximum value between the above result and 0, that is, max(r1-r2+0.1,0). This means that if the result of r1-r2+0.1 is a positive number, then the loss is the positive number; if it is a negative number, then the loss is 0. This design ensures that the loss function does not produce negative losses due to negative score differences, thereby avoiding unreasonable gradients during training.

[0108] This loss function is designed to encourage the reward model to learn how to distinguish between good chunking (represented by S_teacher) and not-so-good chunking (represented by S_model) during training. By minimizing this loss function, the reward model will learn to assign higher scores to S_teacher and lower scores to S_model.

[0109] In some embodiments, the method for dividing the topic blocks described in the present application further includes:

[0110] S303, using the trained reward model to perform reinforcement learning fine-tuning on the topic segmentation model.

[0111] Specifically, the reward model trained in S3021 to S3023 can be used to perform reinforcement learning fine-tuning on the initial question block division model M_pt obtained in S100 to align its behavior with the teacher's actual behavior.

[0112] That is to say, the reward model trained in S3021 to S3023 is an evaluation model that can give a reward score to the output of the question segmentation model (i.e., the label sequence). This reward model is trained based on the teacher's actual behavior (represented by S_teacher), so it can reflect what the teacher considers to be good behavior. The initial question segmentation model M_pt obtained in S100 is a model that has been pre-trained on large-scale data. The model already has certain capabilities, but its behavior is not yet fully aligned with the teacher's actual behavior.

[0113] Alignment refers to the process of training a generative model by using specific technical means to align the model's output with the user's preferences or expectations. In this application, alignment is achieved through reinforcement learning, with the goal of making the model's output consistent with the teacher's (i.e., teachers working in a real teaching environment) preferences.

[0114] The process of fine-tuning involves letting the initial chunking model M_pt make a series of decisions on the task (such as generating a label sequence), and then using the reward model to evaluate the quality of these decisions and give corresponding rewards. The chunking model adjusts its parameters based on these reward signals to maximize the cumulative reward. The goal is to align the behavior of the initial chunking model M_pt with the actual behavior of the teacher, which means that the model should learn to generate a correction sequence similar to that of the teacher. Through reinforcement learning fine-tuning, the model will gradually learn how to make better decisions to obtain higher reward scores.

[0115] In general, the whole process is to use a reward model based on teacher behavior to guide the reinforcement learning fine-tuning of the initial question segmentation model M_pt, with the aim of making the output of the question segmentation model closer to the teacher's standard.

[0116] Please refer to Figure 5 , Figure 5 is a schematic diagram of an optimized question segmentation model provided in an embodiment of the present application. For example, in the above S303, the reward model obtained through training is used to perform reinforcement learning fine-tuning on the question segmentation model, including:

[0117] S3031, initialize the current question segmentation model π to the pre-trained question segmentation model M_pt, and then optimize it in each subsequent training step.

[0118] That is, we use a pre-trained topic partition model M_pt as a starting point, and then optimize this pre-trained topic partition model M_pt through a series of training steps to make it a topic chunk partition model π, and improve its performance on the topic chunk partition task. This process involves multiple iterations, and each iteration will make the topic chunk partition model π closer to the optimal topic chunk partition strategy.

[0119] S3032, use reward model M R Score the topic segmentation sequence generated by the current topic segmentation model π to obtain r θ .

[0120] If the length of the current question division sequence is inconsistent with the length of the test paper, you can force the starting score to be r θThis is because only complete sequences can be rewarded. This distinction ensures that the model considers both the immediate reward and the long-term value of the sequence when generating the sequence. θ Forcing the value to zero ensures that the model does not receive positive feedback during training due to generating invalid sequences, thereby encouraging the model to learn to generate sequences that meet the length requirements.

[0121] S3032, calculating the KL-divergence between the current question block division model π and the initial question block division model M_pt. The value d of the KL-divergence is used to measure the distribution difference between the current question block division model π and the initial question block division model M_pt when generating label sequences.

[0122] Among them, KL-divergence (Kullback-Leibler divergence) is a measure of the difference between two probability distributions. In this step, the KL-divergence between the current question block partitioning model π and the initial question block partitioning model M_pt is calculated to obtain a value d. This value d reflects the difference in strategy between the current question block partitioning model π and the initial question block partitioning model M_pt.

[0123] Specifically, a new reward value R can be calculated based on the KL-value d.

[0124] For example, according to the formula R = r θ -λd is calculated, R is a new reward value, which is composed of two parts: θ is the reward score based on the reward model, d is the KL-divergence between the current chunking model π and the initial chunking model M_pt, and λ is an adjustable parameter. KL-divergence is used to measure the difference between two probability distributions, and here it is used as a regularization term to prevent the model from deviating too much from the initial model. By introducing the KL-divergence penalty in the reward, the update of the model can be restricted so that it does not over-fit to the reward model. Without this penalty, the model may overfit to the reward model, resulting in the generated label sequence being able to obtain high rewards, but in fact may be unreasonable or not meet the task requirements.

[0125] Therefore, through this processing method, the optimization process of the chunking model can be more stable because it not only takes into account the immediate reward, but also the difference from the initial model. This can avoid large fluctuations in the model during training and help the model learn a more robust and consistent strategy.

[0126] S3034, evaluating the potential value of each position in the tag sequence through the value model to obtain the value of the value function.

[0127] In the reinforcement learning framework, this step involves calculating the value of the value function V(s) at any position t of a sequence of length T. The value function is modeled by a neural network model, which evaluates the long-term reward at a specific state s. Unlike the reward function, the value function can give non-zero values ​​even if the length of the sequence is less than the predetermined test paper length. This is because even in the case of incomplete generated sequences, intermediate sequences may have potential value, that is, continuing to generate based on these sequences may result in a complete and valid sequence.

[0128] In contrast, in step S3032, when the sequence length is less than the test paper length, the value r of the reward function is forced to zero. This is because the reward should be obtained only when the sequence is complete, that is, when the length is consistent with the test paper length. This distinction ensures that the question segmentation model considers both the immediate reward and the long-term value of the label sequence when generating the sequence.

[0129] In short, the value function considers the potential value of a sequence even when it is incomplete, while the reward function only gives rewards when the sequence is complete. This design helps the chunking model balance immediate rewards and long-term value when generating sequences, thereby generating more reasonable and effective sequences.

[0130] S3033, perform reinforcement learning fine-tuning on the current question segmentation model according to the reward score, divergence and value of the value function, so as to iteratively optimize its question segmentation strategy so that its output label sequence is closer to the correction sequence.

[0131] First, calculate the advantage function

[0132] For each position t in a label sequence of length T, the advantage function is calculated The advantage function is the reward R minus the value function V(s), where s is the current state. The advantage function measures how good an action is relative to the average performance in a particular state. If Indicates that the current action is better than the average; if This means that the current action is not as good as the average level.

[0133] Next, the loss function L is calculated.

[0134] Among them, the loss function in It represents the ratio of the probability of generating the current token by the current model (i.e. the current question chunking model π) and the model before optimization (i.e. the question chunking model of the previous iteration, or the initial question chunking model M_pt).

[0135] Finally, update the current chunk partitioning model π and replace the online model.

[0136] By optimizing the above loss L, the parameters of the current question block division model π are updated to obtain an updated question block division model π'. Parameter update can be performed based on a common model optimization algorithm. In an embodiment of the present application, the Adam (Adaptive Moment Estimation) algorithm can be used for optimization. The Adam algorithm is an optimization algorithm used to train deep learning models. It combines the characteristics of two other optimization algorithms, momentum and root mean square propagation, to accelerate the training process of neural networks and increase the convergence speed.

[0137] Once the current chunking model π is fine-tuned by reinforcement learning, the resulting chunking model π' will be used to replace the online (i.e., actual) chunking model. This marks the completion of an automatic learning update cycle. After that, the system will enter the next update cycle and continue to use reinforcement learning to fine-tune and optimize the chunking model to adapt to new data and task requirements.

[0138] It can be seen that the optimization of the question segmentation model is a cyclic reinforcement learning process, in which the quality of its generated label sequence is continuously improved by calculating the advantage function, loss function, and updating the parameters. This process is iterative, and after each update cycle, the question segmentation model will be replaced in the online application so that it can play a role in the actual environment.

[0139] For some examples, please refer to Figure 6 , Figure 6 It is a schematic diagram of shared parameters provided by an embodiment of the present application. The model architecture used in the present application has the characteristics of shared parameters. Specifically, the model architecture involved in the present application includes a question block division model, and also includes a reward model and a value model. The two models, the reward model and the value model, share parameters in the non-output layer (i.e., the middle representation layer). This means that they can use the same neural network layer to process input data, which includes original sequences, element sequences, and label sequences. The label sequence can be a label sequence generated by the question type division model, or it can be a corrected sequence after teacher correction. The role of the shared representation layer is to receive the inputs of the original sequence, element sequence, and label sequence, and convert them into internal representations, which are then used in different parts of the output layer, corresponding to the reward model and the value model respectively.

[0140] This shared parameter design can reduce the overall number of model parameters, improve training efficiency, and help improve the generalization ability of the model because it enables both the reward model and the value model to learn from the same data representation.

[0141] During training, each data batch simultaneously updates the parameters of the shared representation layer, which means that the learning of the reward model and the value model is synchronized. This synchronous update ensures that the two models always use the latest shared parameters during training, thereby improving the stability and effect of training.

[0142] In short, the model architecture provided by this application is that the reward model and the value model share the parameters of the intermediate layer. This design allows them to use the same representation when processing input data while keeping their respective output layers independent in order to calculate rewards and values ​​separately.

[0143] The following is a description of the question block division device provided in the present application. The question block division device and the question block division apparatus described below and the question block division method described above can be referenced to each other.

[0144] Please refer to Figure 7 , Figure 7 The block division device 700 is applied to the block division model, the block division model includes a first encoder, a second encoder and a decoder, and the block division device 700 includes an acquisition module 710, an encoding module 720, a fusion module 730 and a decoding module 740.

[0145] Exemplarily, the acquisition module 710 is used to acquire the original sequence and element sequence representing the content of the test paper.

[0146] Exemplarily, the encoding module 720 is used to encode the original sequence through the first encoder to extract its semantic information and generate a first semantic representation; encode the element sequence through the second encoder to extract its structural information and generate a second semantic representation;

[0147] Exemplarily, the fusion module 730 is used to splice the first semantic representation and the second semantic representation to fuse the semantic information and structural information of the test paper to obtain a semantic representation of the test paper;

[0148] Exemplarily, the decoding module 740 is used to decode the test paper semantic representation through the decoder to generate a label sequence, and the label sequence is used to indicate the position of each line of content in the test paper in the question block structure.

[0149] Exemplarily, the element sequence is obtained by parsing the original sequence line by line using a preset element extraction function.

[0150] Exemplarily, the question block division device is also used for:

[0151] Each label in the label sequence is concatenated into a continuous string, wherein the string reflects the question type structure of the test paper content, and different labels in the string correspond to different question block types and positions;

[0152] Matching is performed in the concatenated strings to obtain substrings that reflect the starting and ending positions of the question. Each substring corresponds to a question range, which is represented by a two-tuple, including the starting line number and the ending line number of the question.

[0153] Exemplarily, the question block division device is also used for:

[0154] Continuously acquiring the original sequence, the tag sequence, and a corrected sequence after correcting the tag sequence;

[0155] When the number of the corrected sequences reaches or exceeds a preset threshold, the original sequence, the label sequence and the corrected sequence are obtained as training data to train the reward model to evaluate the quality of the label sequence generated by the question block division model.

[0156] Exemplarily, the question block division device is also used for:

[0157] Obtaining the test paper semantic representation extracted by the question block division model;

[0158] Using a preset third encoder, extracting corresponding partition semantic representations from the label sequence or the correction sequence;

[0159] The test paper semantic representation and the partition semantic representation are vector-concatenated, and the concatenated vector is mapped into a scalar through a preset mapping model, and the value of the scalar represents the reward score of the reward model for the current label sequence.

[0160] Exemplarily, the question block division device is also used for:

[0161] configuring a loss function, wherein the loss function is used to measure the difference between the label sequence and the correction sequence;

[0162] The loss function is used as a guide to drive the question segmentation model to be fine-tuned through a reinforcement learning mechanism to gradually reduce the difference between the label sequence and the correction sequence.

[0163] Exemplarily, the question block division device is also used for:

[0164] Calculating the divergence between the current question block division model and the initial question block division model, wherein the divergence value is used to measure the distribution difference between the current question block division model and the initial question block division model when generating a label sequence;

[0165] Evaluate the potential value of each position in the tag sequence by using the value model to obtain the value of the value function;

[0166] The current question segmentation model is fine-tuned through reinforcement learning according to the reward score, the divergence and the value of the value function, so as to iteratively optimize its question segmentation strategy so that the label sequence output by it is closer to the correction sequence.

[0167] It should be noted here that the above-mentioned question block division device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as those in the method embodiment will not be described in detail here.

[0168] Figure 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the method for dividing the question blocks.

[0169] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0170] On the other hand, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the question block division method provided by the above methods.

[0171] On the other hand, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the above-mentioned method of dividing the question blocks.

[0172] The embodiments of the present application provide an electronic device, a computer program product, and a processor-readable storage medium, on which the computer program stored enables the processor to implement all the method steps implemented in the above-mentioned method embodiments and to achieve the same technical effects. The parts and beneficial effects of this embodiment that are the same as those in the method embodiments will not be described in detail herein.

[0173] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0174] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for dividing a question block, characterized in that: Applied to a question block division model, the question block division model includes a first encoder, a second encoder and a decoder, and the question block division method includes: Obtaining the original sequence and element sequence representing the content of the test paper; Encoding the original sequence by the first encoder to extract its semantic information and generate a first semantic representation; and encoding the element sequence by the second encoder to extract its structural information and generate a second semantic representation; splicing the first semantic representation and the second semantic representation to fuse the semantic information and structural information of the test paper, thereby obtaining a semantic representation of the test paper; The test paper semantic representation is decoded by the decoder to generate a label sequence, and the label sequence is used to indicate the position of each line of content in the test paper in the question block structure.

2. The method for dividing the question blocks according to claim 1, characterized in that: The element sequence is obtained by parsing the original sequence line by line using a preset element extraction function.

3. The method for dividing the question blocks according to claim 1, characterized in that: The method for dividing the topic blocks also includes: Each label in the label sequence is concatenated into a continuous string, wherein the string reflects the question type structure of the test paper content, and different labels in the string correspond to different question block types and positions; Matching is performed in the concatenated strings to obtain substrings that reflect the starting and ending positions of the question. Each substring corresponds to a question range, which is represented by a two-tuple, including the starting line number and the ending line number of the question.

4. The method for dividing the question blocks according to claim 1, characterized in that: Also applied to the reward model, the method for dividing the question blocks further includes: Continuously acquiring the original sequence, the tag sequence, and a corrected sequence after correcting the tag sequence; When the number of the corrected sequences reaches or exceeds a preset threshold, the original sequence, the label sequence and the corrected sequence are obtained as training data to train the reward model to evaluate the quality of the label sequence generated by the question block division model.

5. The method for dividing the question blocks according to claim 4, characterized in that: The step of training the reward model comprises: Obtaining the test paper semantic representation extracted by the question block division model; Using a preset third encoder, extracting corresponding partition semantic representations from the label sequence or the correction sequence; The test paper semantic representation and the partition semantic representation are vector-concatenated, and the concatenated vector is mapped into a scalar through a preset mapping model, and the value of the scalar represents the reward score of the reward model for the current label sequence.

6. The method for dividing the question blocks according to claim 4, characterized in that: The step of training the reward model further comprises: configuring a loss function, wherein the loss function is used to measure the difference between the label sequence and the correction sequence; The loss function is used as a guide to drive the question segmentation model to be fine-tuned through a reinforcement learning mechanism to gradually reduce the difference between the label sequence and the correction sequence.

7. The method for dividing the question blocks according to claim 5, characterized in that: Also applied to the value model, the method for dividing the topic blocks further includes: Calculating the divergence between the current question block division model and the initial question block division model, wherein the divergence value is used to measure the distribution difference between the current question block division model and the initial question block division model when generating a label sequence; Evaluate the potential value of each position in the tag sequence by using the value model to obtain the value of the value function; The current question segmentation model is fine-tuned through reinforcement learning according to the reward score, the divergence and the value of the value function, so as to iteratively optimize its question segmentation strategy so that the label sequence output by it is closer to the correction sequence.

8. A device for dividing a question into blocks, characterized in that: Applied to a question block division model, the question block division model includes a first encoder, a second encoder and a decoder, and the question block division device includes: An acquisition module, used for acquiring an original sequence and an element sequence representing the content of the test paper; An encoding module, configured to encode the original sequence by the first encoder to extract its semantic information and generate a first semantic representation; and to encode the element sequence by the second encoder to extract its structural information and generate a second semantic representation; A fusion module, used for splicing the first semantic representation and the second semantic representation to fuse the semantic information and structural information of the test paper to obtain a semantic representation of the test paper; The decoding module is used to decode the semantic representation of the test paper through the decoder to generate a label sequence, and the label sequence is used to indicate the position of each line of content in the test paper in the question block structure.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method for dividing the question blocks as described in any one of claims 1 to 7 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for dividing question blocks as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Bidirectional LSTM named entity recognition method based on predicted position attention

    CN109933801A

  • Test question segmentation method and system and readable storage medium

    CN111680669A

  • Test paper layout segmentation method based on digital image, electronic equipment and storage medium

    CN112541922A

  • Controllable text abstract generation method and model, device and storage medium thereof

    CN116756304A

Cited By

  • Food value generation method and device, electronic equipment and computer readable medium

    CN119152497A