Method for training test question scoring model, test question scoring method and device
By using the scoring data of the sample test questions in the question bank to train the embedded second neural network model while keeping the parameters of the first test question unchanged, the existing automatic test question scoring model has solved the shortcomings in improving training effect and efficiency, and efficient and accurate test question scoring is achieved.
Patent Information
- Application Number
- CN202111675700.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2041-12-31
AI Technical Summary
The existing automatic test score model has shortcomings in improving training effect and efficiency, especially in maintaining a balance between universality and targetedness of the scoring model.
By using the scoring data of the sample test questions in the question bank to train the embedded second neural network model while keeping the parameters of the first test question unchanged, the second test question score model is obtained. This method combines pre-training and fine-tuning stages to improve the targetedness and efficiency of the scoring model.
It realizes that while ensuring the effectiveness of the scoring model for specific test questions, it improves training efficiency and scoring effect, and reduces the cost of calculation, maintenance and deployment.
Smart Images

Figure CN114548398B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for training a test question scoring model, a test question scoring method and a device. Background Art
[0002] In recent years, with the rapid development of computer technology and artificial intelligence, all walks of life have the demand to replace manual labor with machines, and there is also a strong demand in the domestic education field.
[0003] Using machines to automatically score test questions can greatly reduce the burden on teachers, so its application is becoming more and more widespread. For example, composition is a must-have question type for students' Chinese and English exams. At present, there are some automatic composition scoring methods in exam scoring scenarios, such as using deep learning calibration scoring models in large-scale exam scoring scenarios, and using deep learning general scoring models in classroom test scoring scenarios. However, no matter which scoring model is used, the effect and efficiency of training automatic scoring models need to be improved. Summary of the invention
[0004] In view of this, the present application provides a method for training a test question scoring model, a test question scoring method and a device, which can improve the effect and efficiency of training an automatic scoring model.
[0005] In a first aspect, a test question scoring method is provided, comprising: obtaining student answer sheets corresponding to test questions in a question bank, the student answer sheets including answer results corresponding to the test questions in the question bank; determining scores of the student answer sheets based on the answer results using a second test question scoring model, wherein the second test question scoring model is obtained by training a second neural network model embedded in the first test question scoring model using scoring data of sample test questions in the question bank while keeping parameters of the first test question scoring model unchanged, and the first test question scoring model is obtained by pre-training a first neural network model using scoring data of sample test questions outside the question bank.
[0006] In some embodiments, the method of the first aspect also includes: obtaining the student answer sheet and the corresponding test ID corresponding to the test questions in the question bank, wherein the score of the student answer sheet is determined by using a second test question scoring model based on the answer results, including: determining the score of the student answer sheet by using a second test question scoring model based on the answer results and the test ID corresponding to the test questions in the question bank.
[0007] In some embodiments, the first neural network model is pre-trained using the test question scoring data to obtain the first test question scoring model, including: according to the sample test questions outside the question bank and the test ID corresponding to the sample test questions outside the question bank, obtaining the predicted scoring results corresponding to the sample test questions outside the question bank and the test classification prediction results corresponding to the test ID through the first test question scoring model; masking and / or replacing the preset vocabulary in the sample test questions outside the question bank to obtain the processed sample test questions outside the question bank, and according to the processed sample test questions outside the question bank, obtaining the prediction results of the preset vocabulary through the first test question scoring model; determining the loss function value of the first test question scoring model according to the predicted scoring results corresponding to the sample test questions outside the question bank, the test classification prediction results corresponding to the test ID and the prediction results of the preset vocabulary; based on the loss function value, updating the parameters of the first test question scoring model.
[0008] In some embodiments, the loss function value of the first test question scoring model is determined based on the predicted scoring results corresponding to sample test questions outside the question bank, the test classification prediction results corresponding to the test ID, and the prediction results of preset vocabulary, including: determining the first loss function value of the first test question scoring model based on the predicted scoring results and the manual scoring results of the sample test questions outside the question bank; determining the second loss function value of the first test question scoring model based on the test classification prediction results and the manual test classification results; determining the third loss function value of the first test question scoring model based on the prediction results of preset vocabulary and the preset vocabulary; determining the loss function value of the first test question scoring model based on the first loss function value, the second loss function value and the third loss function value.
[0009] In some embodiments, the first loss function value is calculated by a regression loss function based on a mean square error, and the second loss function value and the third loss function value are calculated by a cross entropy loss function.
[0010] In some embodiments, the loss function value of the first test question scoring model is a weighted average of the first loss function value, the second loss function value, and the third loss function value.
[0011] In some embodiments, sample data of the first test question scoring model comes from different academic stages, different grades, different schools, different regions and / or different examinations.
[0012] In some embodiments, the first test question scoring model includes at least one encoding layer, the encoding layer has a self-attention mechanism, and the second test question scoring model includes at least one encoding layer and at least one adapter model embedded in each encoding layer, which is used to extract features of test questions in the question bank according to the test ID corresponding to the test questions in the question bank, wherein at least one adapter model is obtained by adjusting the parameters of the second neural network model embedded in the first test question scoring model using the scoring data of sample test questions in the question bank while keeping the parameters of the first test question scoring model unchanged.
[0013] In some embodiments, the second test question scoring model also includes a shared parameter layer, wherein the method further includes: dynamically generating parameters of at least one adapter model through the shared parameter layer according to the test identifier corresponding to the test questions in the question bank.
[0014] In some embodiments, the second test question scoring model includes at least one encoding layer, at least one adapter model embedded in each encoding layer, and a shared parameter layer, wherein the method also includes: dynamically generating parameters of at least one adapter model through the shared parameter layer according to the test ID corresponding to the sample test questions in the question bank.
[0015] In some embodiments, the second neural network model embedded in the first test question scoring model is trained using the scoring data of sample test questions in the question bank to obtain a second test question scoring model, including: obtaining predicted scoring results of the sample test questions in the question bank through each encoding layer and at least one adapter based on the sample test questions in the question bank; and updating the parameters of the shared parameter layer based on the difference between the predicted scoring results of the sample test questions in the question bank and the manual scoring results of the sample test questions in the question bank.
[0016] In some embodiments, at least one encoding layer includes an encoding layer, and at least one adapter model includes an adapter model, wherein the parameters of the at least one adapter model are dynamically generated through the shared parameter layer according to the test ID corresponding to the sample test questions in the question bank, including: converting the test ID corresponding to the sample test questions in the question bank into an embedding layer vector through the embedding layer of the shared parameter layer; and inputting the embedding layer vector into the first linear layer, the activation function layer, and the second linear layer of the shared parameter layer in sequence to obtain the parameters of the adapter model.
[0017] In some embodiments, at least one encoding layer includes multiple encoding layers, and at least one adapter model includes multiple adapter models, wherein the parameters of at least one adapter model are dynamically generated through a shared parameter layer according to the test ID corresponding to the sample test questions in the question bank, including: selecting a coding layer from the multiple coding layers according to the correspondence between the test ID corresponding to the sample test questions in the question bank and the coding layer position IDs corresponding to the multiple coding layers, and obtaining the coding layer position ID of the coding layer; selecting an adapter model from the multiple adapter models in the coding layer according to the correspondence between the test ID corresponding to the sample test questions in the question bank and the adapter position IDs corresponding to the multiple adapter models, and obtaining the adapter position ID of the adapter model; converting the test ID, the coding layer position ID and the adapter position ID into a test embedding vector, a coding layer position embedding layer vector and an adapter position embedding layer vector respectively through the embedding layer of the shared parameter layer; after splicing the test embedding layer quantity, the coding layer position embedding layer vector and the adapter position embedding layer vector, they are sequentially input into the first linear layer, the activation function layer and the second linear layer of the shared parameter layer to obtain the parameters of the adapter model.
[0018] In some embodiments, the parameters of at least one adapter model include weights and / or biases.
[0019] In some embodiments, at least one adapter includes a first linear layer, an activation function layer, and a second linear layer.
[0020] In some embodiments, the test question is a composition question.
[0021] In a second aspect, a method for training a test question scoring model is provided, comprising: pre-training a first neural network model using test question scoring data to obtain a first test question scoring model, the test question scoring data including scoring data of sample test questions outside a question bank; while keeping the parameters of the first test question scoring model unchanged, training a second neural network model embedded in the first test question scoring model using the scoring data of sample test questions in the question bank to obtain a second test question scoring model, wherein the second neural network model is embedded after the pre-training of the first test question scoring model is completed.
[0022] In a third aspect, a test question scoring device is provided, including: an acquisition module, used to acquire student answer sheets corresponding to test questions in a question bank, the student answer sheets including answer results corresponding to the test questions in the question bank; a determination module, used to determine the scores of the student answer sheets based on the answer results using a second test question scoring model, wherein the second test question scoring model is obtained by training a second neural network model embedded in the first test question scoring model using the scoring data of sample test questions in the question bank while keeping the parameters of the first test question scoring model unchanged, and the first test question scoring model is obtained by pre-training a first neural network model using the scoring data of sample test questions outside the question bank.
[0023] In a fourth aspect, a device for training a test question scoring model is provided, comprising: a pre-training module, used to pre-train a first neural network model using test question scoring data to obtain a first test question scoring model, wherein the test question scoring data includes scoring data of sample test questions outside a question bank; a training module, used to train a second neural network model embedded in the first test question scoring model using the scoring data of sample test questions in the question bank while keeping the parameters of the first test question scoring model unchanged to obtain a second test question scoring model, wherein the second neural network model is embedded after the pre-training of the first test question scoring model is completed.
[0024] In a fifth aspect, an electronic device is provided, comprising: a memory and a processor, wherein the memory stores executable code, and the processor is configured to execute the executable code to implement the method described in the first aspect or the second aspect.
[0025] In a sixth aspect, a storage medium is provided, on which executable code is stored. When the executable code is executed by a processor, the method described in the first aspect or the second aspect is implemented.
[0026] According to the technical solution of the present application and the embodiments of the present application, a test question scoring model obtained by pre-training with test question scoring data outside the test bank and fine-tuning with the scoring data of test questions in the question bank is used to score the answer results of the test questions in the question bank, which can not only ensure the effectiveness of the scoring model in scoring specific test questions.
[0027] In addition, by training the universal scoring model in the pre-training stage and updating a small number of parameters of the neural network model embedded in the universal scoring model while keeping the large-scale parameters of the universal scoring model unchanged in the fine-tuning stage, the efficiency of training the scoring model can be improved, and the effectiveness of the scoring model in scoring specific test questions can be guaranteed. Since it is not necessary to add all historical test questions and retrain each time a new test question is added, the computational cost is reduced. In addition, since it is not necessary to train a scoring model for each test question separately, it is conducive to the scoring model learning the shared information between the test questions in the question bank, and the training cost, maintenance cost and deployment cost are reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0029] Figure 1 An example diagram of the framework of the training test question scoring model provided in an embodiment of the present application.
[0030] Figure 2 The figure is a flowchart of a method for training a test question scoring model provided in one embodiment of the present application.
[0031] Figure 3 It is a schematic flow chart of a test question scoring method according to an embodiment of the present application.
[0032] Figure 4 It is a schematic diagram of the pre-training process of the universal scoring model according to an embodiment of the present application.
[0033] Figure 5 A schematic diagram of mask preprocessing provided in an embodiment of the present application.
[0034] Figure 6 A schematic diagram of the fine-tuning process of the essay scoring model according to an embodiment of the present application.
[0035] Figure 7 Schematic diagram of the network structure of a shared layer network according to an embodiment of the present application.
[0036] Figure 8 It is a schematic structural diagram of a device for training a test question scoring model provided in one embodiment of the present application.
[0037] Fig. 9 It is a schematic structural diagram of a test question scoring device provided in one embodiment of the present application.
[0038] Fig.10 It is a structural schematic diagram of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION
[0039] The technical solution of the embodiment of the present application is suitable for training a test scoring model and using the test scoring model to score test answers. By adopting the technical solution of the embodiment of the present application, the test scoring model can be efficiently trained and the test answers can be effectively scored.
[0040] This application can be applied to scenarios such as natural language processing, intelligent test grading or intelligent homework grading, especially the application of intelligent test grading methods in automatic grading of English composition questions.
[0041] The following is a brief introduction to the intelligent test grading scenario using essay scoring as an example.
[0042] Essay grading is a very important part of teachers' teaching work, but it is also a time-consuming and laborious part. If machines can replace or assist teachers in grading test questions or homework, it will greatly reduce the burden on teachers. In addition, the current evaluation of a student's staged learning is still mainly in the form of paper-and-pencil tests, so a large amount of manual grading is required, but manual grading is subjective on the one hand and has high labor costs on the other. Therefore, automatic grading technology can partially alleviate the teacher's grading pressure through human-machine coupling, which not only saves labor costs, but also solves the problem of subjective grading to a certain extent.
[0043] Automatic essay scoring can be a supervised learning process, in which a scoring model is trained based on a small amount of manual scoring through a machine learning algorithm. The key to this technical solution is to design a reasonable machine learning algorithm and model to learn manual scoring rules, thereby improving the quality of automatic essay scoring.
[0044] There are two main types of automatic essay scoring methods: one is an automatic essay scoring method based on shallow language features, and the other is an end-to-end automatic essay scoring method based on deep learning.
[0045] The shallow language features include: number of words, number of sentences, average sentence length, word frequency, word frequency-inverse document, and latent semantic vector. After obtaining the above shallow language features, a regression model is used to fit the mapping relationship between features and scores, and finally an automatic composition scoring model based on shallow language features is obtained.
[0046] The neural network-based deep learning method uses convolutional neural networks, recurrent neural networks, transformers and other model frameworks to encode students' answers, then takes the average of the hidden layer of each word to obtain the composition representation, and finally uses a regression algorithm to train the automatic scoring model.
[0047] The technical solution based on shallow language features requires manual design of features, which have strong limitations and are not very universal, resulting in the customization of different features for each exam, which is a very time-consuming and labor-intensive project. The solution based on deep learning requires randomly selecting a portion of student essays from the exam for teachers to score, and then using these scoring data as a training set to train an automatic essay scoring model, and finally using the automatic essay scoring model to predict the scores of all students' essays.
[0048] Most automatic essay scoring methods, whether feature-based or representation learning-based, are performing in-domain training, that is, only using the data of the questions as the calibration set to train the automatic scoring model. In the question bank scenario, as many automatic scoring models as there are questions need to be trained, which consumes a lot of computing resources, storage space and maintenance costs.
[0049] In order to overcome the problem of low efficiency of traditional automatic scoring schemes, the embodiments of the present application first use a large amount of scoring data outside the question bank to pre-train the general composition scoring model, and then jointly train the questions in the question bank based on the general composition scoring model, thereby improving the efficiency of training and the effect of scoring.
[0050] Since the embodiments of the present application involve applications in neural networks, for ease of understanding, the following is a brief introduction to related terms and related concepts such as neural networks that may be involved in the embodiments of the present application.
[0051] Deep Neural Networks
[0052] Deep Neural Network (DNN), also known as multi-layer neural network, can be understood as a neural network with many hidden layers. The neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer. DNN can be expressed by the following linear relationship: in, is the input vector, is the output vector, b is the offset vector, W is the weight matrix (also called coefficient), and α(.) is the activation function. The definitions of these parameters in DNN are as follows: Take the coefficient W as an example: Assume that in a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as The superscript 3 represents the layer number of the coefficient W, while the subscript corresponds to the output third layer index 2 and the input second layer index 4. That is, the coefficients from the kth neuron in the L-1th layer to the jth neuron in the Lth layer are defined as It should be noted that the input layer does not have a W parameter. In a deep neural network, more hidden layers allow the network to better describe complex situations in the real world. Training a deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrices of all layers of the trained deep neural network.
[0053] Loss Function
[0054] In the process of training a deep neural network, because we hope that the output of the deep neural network is as close as possible to the value we really want to predict, we can compare the predicted value of the current network with the target value we really want, and then update the weight vector of each layer of the neural network according to the difference between the two (of course, there is usually an initialization process before the first update, that is, pre-configuring parameters for each layer in the deep neural network). For example, if the predicted value of the network is high, adjust the weight vector to make it predict a lower value, and continue to adjust until the deep neural network can predict the target value we really want or a value very close to the target value we really want. Therefore, the difference between the predicted value and the target value can be compared using a loss function or an objective function, which are important equations for measuring the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference, so the training of the deep neural network becomes a process of minimizing this loss as much as possible.
[0055] Transformer Model
[0056] The Transformer model is a model that uses the attention mechanism to improve the model training speed. It mainly consists of two parts: encoder and decoder, which can be used for machine translation. The encoder includes a self-attention mechanism and a feed-forward neural network. The decoder is similar to the encoder, except that it has an additional layer of attention mechanism in addition to the self-attention mechanism and feed-forward neural network.
[0057] Combine the following Figure 1 , the framework of the training test question scoring model provided in the embodiment of the present application is illustrated in detail.
[0058] Figure 1 An example diagram of the framework of the training test question scoring model provided in an embodiment of the present application.
[0059] like Figure 1 As shown, the framework of training the scoring model is divided into two parts: a pre-training part 110, which uses a large amount of scoring data outside the question bank to pre-train the general scoring model; a fine-tuning part 120, which uses the scoring data in the question bank to fine-tune the adapter model embedded in the general scoring model. Among them, the adapter model can be understood as a model designed to adapt to the questions in the question bank.
[0060] In the pre-training part 110 , sample test questions 112 may be extracted from the manual scoring data set 111 , and the sample test questions 112 may be used to train the initial neural network model to obtain a general scoring model 113 .
[0061] In the fine-tuning part 120, sample questions 122 can be extracted from the same source (same question bank) scoring data set 121, and the adapter model embedded in the general scoring model can be trained using the sample questions 122 to obtain a scoring model with an adapter model 123. The scoring model with an adapter model 123 is trained based on the general scoring model 113. In other words, the scoring model with an adapter model 123 can be divided into two parts, one part is the general scoring model 113, and the other part is the adapter model embedded after the general scoring model is trained. When training the adapter model, the parameters of the general scoring model obtained in pre-training can remain unchanged.
[0062] It can be seen that the process of training the test question scoring model in the embodiment of the present application is a two-stage process. First, pre-training is performed based on a large amount of scoring data from a wide range of sources, and then a small amount of scoring data from the same source as the current exam is selected for fine-tuning, thereby improving the efficiency of training the scoring model and ensuring the effectiveness of the scoring model for specific questions.
[0063] Combination of the above Figure 1 , the framework of the training test question scoring model provided in the embodiment of the present application is illustrated in detail.
[0064] Combine the following Figures 2 to 3 The method for training the test question scoring model mentioned in the embodiments of the present application is introduced in detail.
[0065] Figure 2 The figure is a flow chart of a method for training a test question scoring model provided by an embodiment of the present application. For example, the method can be executed by a server or other types of electronic devices with data processing functions (for example, an automatic scoring system). Figure 2 As shown, the method includes the following steps.
[0066] In step S210, the first neural network model is pre-trained using the test question scoring data to obtain a first test question scoring model, wherein the test question scoring data includes scoring data of sample test questions outside the question bank.
[0067] Specifically, the purpose of the embodiment of the present application is to provide a model capable of scoring the answer sheets of the test questions in the question bank, wherein the first neural network model can be an encoding layer with a self-attention mechanism. The first test question scoring model is a general scoring model that is pre-trained using a large amount of scoring data of sample test questions outside the question bank.
[0068] The test questions may be test questions involving text content related to language learning, for example, reading comprehension test questions or composition test questions, especially English composition test questions or Chinese composition test questions. The embodiments of the present application do not limit the content of the test questions.
[0069] The scoring data in the question bank refers to the scoring data of a category of questions with similar themes, scoring standards and / or scoring ranges (e.g., essay questions in CET-4, writing questions in GRE, etc.). The scoring data outside the question bank refers to the scoring data of questions with a wider range than the scoring data inside the question bank. For example, for the scoring data of essay questions in CET-4 of a certain question bank, the scoring data outside the question bank may include: for example, the scoring data of essay questions in CET-6, writing questions in GRE, essay questions in final exams of various universities, etc.
[0070] In some embodiments, the test question scoring data (or sample data) of the first test question scoring model may come from different academic stages, different grades, different schools, different regions and / or different examinations. Composition scoring corpora usually cover a small range of narrow topics, and the topics, scoring standards and scoring ranges of different questions are often different. A good test question scoring model needs to have the ability to appreciate or criticize the answers to the test questions. Therefore, the effectiveness of the test question scoring model can be improved through supervised pre-training. If the test question scoring model is trained using scoring data from many different topics and different standards, the trained test question scoring model will be more experienced in evaluating the quality of test questions on new topics, which is similar to the process of human learning and scoring. For example, after a scholar has studied a large number of articles, he needs less guidance when scoring articles than a novice.
[0071] Therefore, the embodiments of the present application can improve the scoring effect of the general scoring model by pre-training the general scoring model, and reduce the number of calibration sets.
[0072] In step S220, while keeping the parameters of the first test question scoring model unchanged, the scoring data of the sample test questions in the question bank are used to train the second neural network model embedded in the first test question scoring model to obtain the second test question scoring model, wherein the second neural network model is embedded after the pre-training of the first test question scoring model is completed. The second test question scoring model includes the first test question scoring model and the trained second neural network model embedded in the first test question scoring model. The trained second neural network model is also called an adapter model, which is used to adapt to the scoring task of the test questions in the question bank.
[0073] Different test questions have different characteristics. Therefore, in order to train a scoring model that is suitable for each test question, fine-tuning can be performed on the basis of the general scoring model. That is, the scoring data of test questions that are the same or similar to the test question can be used to train the general scoring model as the basic model to obtain a refined scoring model.
[0074] Specifically, the second neural network model can be embedded in the hidden layer of the first test question scoring model after the first test question scoring model is trained, for example, embedded in the encoding layer (such as a transformer model). The encoding layer may include a plurality of encoding layers, each encoding layer including a self-attention layer and a feedforward neural network layer, and the second neural network model may be arranged in the encoding layer, for example, it may be arranged after each feedforward neural network layer. The second neural network model may be designed to include a first linear layer, an activation function layer, and a second linear layer. The first linear layer and the second linear layer are respectively used to reduce the dimension of the features of the hidden layer and restore the dimension to the dimension of the features of the hidden layer. The parameters of the second neural network model may be designed to be significantly less than the parameters of the first neural network model. It should be understood that the neural network model of the embodiment of the present application is not limited to this, as long as it is a language model that can be used to process text content.
[0075] In order to adapt to each exam, one way to train a scoring model is to train a scoring model for each test question separately, but this will result in high training costs, maintenance costs, and deployment costs, and it cannot share information across tasks, which is not conducive to the scoring model learning shared information between different test questions. Another method is to use a large amount of data from different test questions to train a scoring model, but this will reduce the effect due to the mutual influence between test questions with large differences in topics, and each time a new test question is added, the calibration set of the new test question and the historical test questions need to be trained together, resulting in very high computational costs.
[0076] According to the embodiments of the present application, by training the universal scoring model in the pre-training stage, and keeping the large-scale parameters of the universal scoring model unchanged in the fine-tuning stage, a small number of parameters of the neural network model embedded in the universal scoring model are updated, so that the efficiency of training the scoring model can be improved, and the effectiveness of the scoring model in scoring specific test questions can be guaranteed. Since it is not necessary to add all historical test questions and retrain each time a new test question is added, the computing cost is reduced. In addition, since it is not necessary to train a scoring model for each test question separately, it is conducive to the sharing of information between test questions in the scoring model learning question bank, and the training cost, maintenance cost and deployment cost are reduced.
[0077] In order to improve the scoring effect of the general scoring model, the embodiments of the present application can also supervise the training of the general scoring model based on the multi-task learning algorithm using the objectives of multiple tasks. Specifically, the training of the general scoring model can be supervised based on the objectives of the test classification task, the prediction scoring task, and the language modeling task.
[0078] Specifically, in step 110, the predicted scoring results corresponding to the sample questions outside the question bank and the test ID corresponding to the sample questions outside the question bank can be obtained through the first test question scoring model; the preset vocabulary in the sample questions outside the question bank is masked and / or replaced to obtain the processed sample questions outside the question bank, and the predicted results of the preset vocabulary are obtained through the first test question scoring model based on the processed sample questions outside the question bank; the loss function value of the first test question scoring model is determined based on the predicted scoring results corresponding to the sample questions outside the question bank, the test classification predicted results corresponding to the test ID, and the predicted results of the preset vocabulary; based on the loss function value, the parameters of the first test question scoring model are updated. In the case where a certain test can be uniquely identified, the test ID can also be understood as the question ID, the test paper ID, or the test room ID.
[0079] Specifically, during data preprocessing, the input text may be first segmented, and then the randomly selected words may be masked and / or randomly replaced. For example, a word randomly selected in an input sentence may be masked with [mask] and / or replaced with another word.
[0080] In the process of training the scoring model, the words at the [mask] position and the replacement position can be predicted, so as to achieve the goal of allowing the scoring model to learn the contextual semantics. In addition, the use of the mask loss function can deepen the scoring model's ability to model the semantics of second language (L2) learners.
[0081] In the process of training the scoring model, the embodiment of the present application uses a large amount of student scoring data to pre-train the general scoring model, and adopts a regression loss function to train the general scoring ability of the general scoring model.
[0082] In addition, the sample data used for training come from the scoring data of different test questions by teachers in different stages of education, grades, regions, schools, and examinations. In order to offset the impact of these deviations, the embodiment of the present application introduces an examination classification goal when training the test question scoring model, that is, using the examination classification loss function to remove the impact of deviations between data.
[0083] In some embodiments, the above-mentioned determination of the loss function value of the first test question scoring model based on the predicted scoring results corresponding to the sample test questions outside the question bank, the test classification prediction results corresponding to the test ID, and the prediction results of the preset vocabulary includes: determining the first loss function value of the first test question scoring model based on the predicted scoring results and the manual scoring results of the sample test questions outside the question bank; determining the second loss function value of the first test question scoring model based on the test classification prediction results and the manual test classification results; determining the third loss function value of the first test question scoring model based on the prediction results of the preset vocabulary and the preset vocabulary; determining the loss function value of the first test question scoring model based on the first loss function value, the second loss function value and the third loss function value.
[0084] Specifically, the first loss function value is calculated by a regression loss function based on a mean square error, and the second loss function value and the third loss function value are calculated by a cross entropy loss function.
[0085] For example, the loss function value of the first test question scoring model is the weighted average of the first loss function value, the second loss function value, and the third loss function value.
[0086] After obtaining the above three loss functions, the embodiment of the present application can perform a weighted average of the three loss functions to obtain a final loss function to supervise the training of the general scoring model. The weight occupied by each loss function can depend on the importance of the three tasks. Normally, the proportion of the first loss function is higher than that of the other two loss functions, thereby ensuring the scoring ability of the scoring model. Further, if the model is a scoring model suitable for L2 learners, the weight occupied by the masking loss function can be increased. For example, the weight of the masking loss function can be greater than the weight occupied by the test classification loss function, thereby significantly improving the effect of the model for scoring the language ability of L2 learners. For another example, the more extensive the scoring data source of the scoring model is, the higher the weight occupied by the test classification loss function, thereby significantly eliminating the impact of the differences in the data of different exams.
[0087] In some embodiments, the first test question scoring model includes at least one encoding layer, and the encoding layer has a self-attention mechanism. The second test question scoring model includes at least one encoding layer and at least one adapter model embedded in each encoding layer, which is used to extract features of the test questions in the question bank according to the test ID corresponding to the test questions in the question bank, wherein at least one adapter model is obtained by adjusting the parameters of the second neural network model embedded in the first test question scoring model using the scoring data of the sample test questions in the question bank while keeping the parameters of the first test question scoring model unchanged.
[0088] Specifically, the first test question scoring model is a coding layer, including multiple coding layers, each coding layer includes a self-attention layer and a feedforward neural network layer, and an adapter model (also called an adapter layer or adaptation layer module) can be set downstream of each feedforward neural network layer.
[0089] In some embodiments, the adapter model may include a first linear layer, an activation function layer, and a second linear layer. Specifically, in each adapter, the first linear layer, the activation function layer, and the second linear layer are sequentially connected after each feedforward neural network layer. The first linear layer and the second linear layer are used to reduce the dimension of the hidden layer features and restore the dimension to the dimension of the hidden layer features, respectively. The processing process of the adapter model can be seen in Figure 6 The embodiments of the present invention will not be described in detail here.
[0090] Specifically, when fine-tuning using the scoring data of sample questions in the question bank, the sample data can be input into the second question scoring model, and only the parameters of the adapter model can be adjusted according to the loss function, while the parameters of the first question scoring model remain unchanged. In some embodiments, the parameters of the adapter model include weights and / or biases.
[0091] In some embodiments, the second test question scoring model also includes a shared parameter layer, wherein the method further includes: dynamically generating parameters of at least one adapter model through the shared parameter layer according to the test identifier corresponding to the test questions in the question bank.
[0092] The adapter model is used to extract features from test questions in the question bank based on the test identifiers corresponding to the test questions in the question bank. For example, when scoring, the shared parameter layer can generate parameters of the adapter model based on the test identifier (ID) so that the adapter can use these parameters for feature extraction. Of course, the embodiments of the present application are not limited to this. For example, the adapter model can also call the pre-stored parameters of the adapter model generated during training according to the test ID.
[0093] In some embodiments, the second test question scoring model also includes a shared parameter layer, wherein the method further includes: dynamically generating parameters of at least one adapter model through the shared parameter layer according to the test ID corresponding to the sample test questions in the question bank.
[0094] In some embodiments, the second neural network model embedded in the first test question scoring model is trained using the scoring data of the sample test questions in the test bank to obtain the second test question scoring model, including: obtaining the predicted scoring results of the sample test questions in the test bank through at least one encoding layer and at least one adapter according to the sample test questions in the test bank; updating the parameters of the shared parameter layer according to the difference between the predicted scoring results of the sample test questions in the test bank and the manual scoring results of the sample test questions in the test bank. The process of generating the above parameters by the shared layer can be seen in Figure 7The embodiments are not described in detail here.
[0095] In some embodiments, the at least one encoding layer includes an encoding layer, and the at least one adapter model includes an adapter model, wherein the parameters of the at least one adapter model are dynamically generated through the shared parameter layer according to the test ID corresponding to the sample test questions in the question bank, including: converting the test ID corresponding to the sample test questions in the question bank into an embedding layer vector through the embedding layer of the shared parameter layer; and inputting the embedding layer vector into the first linear layer, the activation function layer, and the second linear layer of the shared parameter layer in sequence to obtain the parameters of the adapter model.
[0096] Alternatively, as another embodiment, the at least one encoding layer includes multiple encoding layers, and the at least one adapter model includes multiple adapter models, wherein the parameters of the at least one adapter model are dynamically generated through the shared parameter layer according to the test ID corresponding to the sample test questions in the question bank, including: selecting a coding layer from the multiple coding layers according to the correspondence between the test ID corresponding to the sample test questions in the question bank and the coding layer position IDs corresponding to the multiple encoding layers, and obtaining the coding layer position ID of the coding layer; selecting an adapter model from the multiple adapter models in the coding layer according to the correspondence between the test ID corresponding to the sample test questions in the question bank and the adapter position IDs corresponding to the multiple adapter models, and obtaining the adapter position ID of the adapter model; converting the test ID, the coding layer position ID and the adapter position ID into the test embedding vector, the coding layer position embedding layer vector and the adapter position embedding layer vector respectively through the embedding layer of the shared parameter layer; after splicing the test embedding layer quantity, the coding layer position embedding layer vector and the adapter position embedding layer vector, they are sequentially input into the first linear layer, the activation function layer and the second linear layer of the shared parameter layer to obtain the parameters of the adapter model.
[0097] According to the embodiments of the present application, the scoring model can be understood as a lightweight training model. In the stage of fine-tuning the scoring model using the scoring data in the question bank, a multi-paper adapter training method is adopted to jointly train questions with similar themes and scoring standards, which complement each other and reduce the impact of joint training of questions with large differences in themes. Compared with the method of training a scoring model for each question separately, the embodiments of the present application greatly reduce maintenance costs and difficulty in going online.
[0098] In addition, since the parameters generated by the shared parameter layer can distinguish different exams and different encoding layers, the purpose of joint training of multiple exams can be achieved while reducing the mutual influence. The model input is converted into corresponding embedding vectors by the embedding layer, and then concatenated and input to the shared parameter layer. After the linear and activation functions, the weights and biases required to calculate the parameters of the adapter model are finally generated.
[0099] It should be understood that when the shared parameter layer generates the parameters of the adapter model corresponding to the sample questions in the question bank, it can also directly borrow the parameters of the adapter model corresponding to the sample questions in the historical question bank. Since the sample questions in the historical question bank are strongly correlated with the sample questions in the current question bank, borrowing the parameters of the adapter model corresponding to the sample questions in the historical question bank can speed up the model convergence and thus improve the efficiency of model training.
[0100] Figure 3 is a schematic flow chart of a test question scoring method according to an embodiment of the present application. For example, the method can be executed by a server or other types of electronic devices with data processing functions (for example, an automatic scoring system). Figure 3 As shown, the method includes the following steps.
[0101] 310, obtaining the student answer sheet corresponding to the test question in the question bank, the student answer sheet including the answer result corresponding to the test question in the question bank and the test ID corresponding to the test question in the question bank.
[0102] 320, based on the answer result and the test ID, the test scoring model is used to determine the score of the student's answer sheet, wherein the test scoring model is based on Figure 1 The training method of the embodiment is obtained.
[0103] Specifically, the test question scoring model includes a first test question scoring model obtained by pre-training the first neural network model using a large amount of scoring data outside the question bank, and a second neural network model embedded in the first test question scoring model and trained using the scoring data in the question bank. The trained second neural network model is also called an adapter model, which is used to adapt to the scoring task of the test questions in the question bank.
[0104] According to an embodiment of the present application, a test question scoring model obtained by pre-training with test question scoring data outside the test bank and fine-tuning with the scoring data of test questions in the question bank is used to score the answer results of the test questions in the question bank, which can not only ensure the effectiveness of the scoring model in scoring specific test questions.
[0105] The above describes the training method of the test question scoring model and the method of scoring test questions using the test question scoring model in the embodiment of the present application. The following takes the composition scoring scenario as an example to describe the training process of the composition scoring model in detail.
[0106] The embodiment of the present application adopts a two-stage training strategy. In the pre-training stage, the three tasks of pre-training, language level and topic classification are combined, and a large amount of essay scoring data outside the question bank is used to train the neural network to obtain a general scoring model. In the fine-tuning stage, while keeping the parameters of the general scoring model unchanged, the essay scoring data in the question bank is used to train the adapter model embedded in the general scoring model to obtain a refined essay scoring model.
[0107] Combine the following Figure 4 and Figure 5 The pre-training process of the composition scoring model of the embodiment of the present application is introduced.
[0108] Figure 4 It is a schematic diagram of the pre-training process of the universal scoring model according to an embodiment of the present application.
[0109] Specifically, the general scoring model may include modules such as data preprocessing, text encoding, and multi-task loss calculation, which are respectively used to perform the following pre-training processes.
[0110] 410, pre-processing a large amount of composition scoring data outside the question bank.
[0111] Specifically, the composition text in the student answer sheet can be first segmented, and then words can be randomly selected for masking or random replacement.
[0112] like Figure 5 As shown, for the input sentence "The bookshelf against the wall which is infront of the bed. The closet is near by the end of my bed.", words can be randomly selected for masking, for example, using [mask] to mask the words bookshelf and front. Furthermore, the randomly selected words can be replaced, for example, replacing the word round with closet.
[0113] 410, using the BERT model to encode the preprocessed text.
[0114] BERT (Bidirectional Encoder Representations from Transformer) is a pre-trained model that uses the transformer's self-attention mechanism to consider the words before and after a word when processing it, and to get the meaning of the word in the context. Therefore, it has a good effect in extracting features from words in context. The purpose of pre-training is to train the underlying, common partial models in the downstream tasks in advance, and then use the sample data of the downstream tasks to train their respective models, which can greatly speed up the convergence speed.
[0115] 430, using regression loss function, classification loss function and masking loss function to evaluate the training results.
[0116] The above three loss functions are used to implement general scoring tasks, test classification tasks and semantic modeling tasks respectively, so that the model can not only have general scoring capabilities but also eliminate the impact of data bias and deepen the model's ability to build semantic models for L2 learners.
[0117] For the regression loss function, the mean square error (MSE) loss function as described in Formula 1 may be used. For the classification loss function and the masking loss function, the cross entropy loss function as described in Formula 2 may be used.
[0118]
[0119] Among them, y i represents the marked score, Represents the score predicted by the machine, and m represents the number of samples.
[0120]
[0121] Among them, y represents the marked score, Represents the score predicted by the machine.
[0122] It should be understood that the above loss function is only an example and the embodiments of the present application are not limited thereto.
[0123] 440, weighted average the above three loss functions to obtain the loss function of the general scoring model.
[0124] For example, when the three tasks have the same importance, that is, the three loss functions have the same importance, the loss function of the universal scoring model can be simplified to the average of the above three loss functions, as shown in the formula.
[0125]
[0126] Among them, loss mse is the regression loss function, loss papercls is the loss function, loss mlm is the masking loss function.
[0127] 450 , determining whether the training process has converged based on the comparison result between the loss function value and the preset threshold value. If converged, executing step 460 ; otherwise executing 470 .
[0128] For example, when the loss function value is greater than a preset threshold, the parameters of the general scoring model are iteratively updated until the loss function value is less than or equal to the preset threshold, and then the score is output.
[0129] 460, adjusting the model parameters according to the comparison results.
[0130] For example, the degree of adjusting the model parameters can be determined according to the size of the comparison result so as to speed up the convergence.
[0131] 470, output as essay scoring model.
[0132] After the general composition scoring model is obtained through pre-training, an adapter model (also called an adapter module or an adapter layer) can be embedded in the general composition scoring model, and the adapter model can be fine-tuned to obtain the final composition scoring model.
[0133] Combine the following Figure 6 and Figure 7 The fine-tuning process of the composition scoring model of the embodiment of the present application is introduced.
[0134] Figure 6 A schematic diagram of the fine-tuning process of the essay scoring model according to an embodiment of the present application.
[0135] like Figure 6 As shown, the network structure of the essay scoring model includes a transformer layer 610. The difference between the encoding layer 610 and the conventional encoding layer is that an adapter model 620 is embedded after the feed-forward neural network layer. The adapter model 620 may include two fully connected layers (linear layers) and one nonlinear layer. The fully connected layer may be a feed-forward neural network layer. The parameters of the traditional adapter model are generally set at the time of initialization. Unlike the traditional adapter model, the parameters of the adapter model of the embodiment of the present application are dynamically generated by the shared parameter layer according to the test id (paper id), that is, as shown in the following formula 4: It is dynamically generated.
[0136]
[0137] The processing process of each encoding layer is as follows: the hidden layer representation of the encoding layer is sequentially passed through the multi-head self-attention layer 611, the feedforward neural network layer 612, the adapter model 620, the LayerNorm layer 614, the feedforward neural network layer 615, another adapter model 616 and the LayNorm layer 617. After the above processing, the hidden layer representation can be output from the BERT model and finally regressed into the student's score through the linear layer.
[0138] The processing process of the adapter model 620 is as follows: the hidden layer representation from the coding layer is input to the feedforward neural network 621 for dimensionality reduction, and then processed by the nonlinear layer 622 (gelu activation function), and finally the hidden layer representation is restored to the dimension of the coding layer by the feedforward neural network 623. Among them, the parameters of the feedforward neural network 623 and the feedforward neural network 621 can be calculated by 630 according to formula 4, where 640 is the weight and bias output by the shared layer network. The processing process of the adapter model 616 is similar to that of the adapter model 620, which is not repeated here.
[0139] Figure 7 Schematic diagram of the structure of a shared layer network according to an embodiment of the present application.
[0140] like Figure 7 As shown in Figure 2, the shared layer network is used to generate the parameters of the adapter model, and its bottom layer has 3 embedding dictionaries: layer id embedding∈R 12*hid 、paper id embedding∈R paper_nums*hid 、adapter posembedding∈R 2*hid .
[0141] The dimension of the position id is 2*dim, which is used to distinguish feedforward neural networks, such as feedforward neural network 623 and feedforward neural network 621; the dimension of the layer id is 12*dim. There are 12 coding layers in total. Different coding layers can be distinguished by the layer id; the paper id is the one-hot code corresponding to the id of this exam.
[0142] The processing process of the shared layer network is as follows: first, the layer ID, position ID and test ID can be obtained according to the input of the scoring model, and the layer ID, position ID and test ID are respectively input into the layer ID embedding layer, the position ID embedding layer and the test ID embedding layer, and the layer ID embedding vector, the position ID embedding vector and the test ID embedding vector are output respectively. These three embedding vectors are concatenated and sequentially input into the second linear layer 740, the activation function layer 750 and the second linear layer 760, and finally the shared layer network is used to generate the weights and biases required for the parameters of the adapter model.
[0143] The above parameters can be used to distinguish different tests and different coding layers, so as to achieve the purpose of joint training of multiple tests while reducing the mutual influence.
[0144] Combination of the above Figures 1 to 7 , describes the method embodiment of the present application in detail, and the following is combined with Figure 8 and 10 , describes the device embodiment of the present application in detail. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so the parts not described in detail can refer to the previous method embodiment.
[0145] Figure 8 It is a schematic structural diagram of a device for training a test question scoring model provided in one embodiment of the present application. Figure 8 The device 800 may be a server or other computing device. The device 800 may include a pre-training module 810 and a training module 820. These modules are described in detail below.
[0146] The pre-training module 810 is used to pre-train the first neural network model using the test question scoring data to obtain the first test question scoring model, and the test question scoring data includes the scoring data of the sample test questions outside the question bank. The training module 820 is used to train the second neural network model embedded in the first test question scoring model using the scoring data of the sample test questions in the question bank while keeping the parameters of the first test question scoring model unchanged to obtain the second test question scoring model, wherein the second neural network model is embedded after the pre-training of the first test question scoring model is completed.
[0147] According to the embodiments of the present application, by training the universal scoring model in the pre-training stage, and keeping the large-scale parameters of the universal scoring model unchanged in the fine-tuning stage, a small number of parameters of the neural network model embedded in the universal scoring model are updated, so that the efficiency of training the scoring model can be improved, and the effectiveness of the scoring model in scoring specific test questions can be guaranteed. Since it is not necessary to add all historical test questions and retrain each time a new test question is added, the computing cost is reduced. In addition, since it is not necessary to train a scoring model for each test question separately, it is conducive to the sharing of information between test questions in the scoring model learning question bank, and the training cost, maintenance cost and deployment cost are reduced.
[0148] According to an embodiment of the present application, the pre-training module is used to obtain, through a first question scoring model, predicted scoring results corresponding to the sample questions outside the question bank and the test ID corresponding to the sample questions outside the question bank; masking and / or replacement processing is performed on the preset vocabulary in the sample questions outside the question bank to obtain processed sample questions outside the question bank, and based on the processed sample questions outside the question bank, the predicted results of the preset vocabulary are obtained through the first question scoring model; the loss function value of the first question scoring model is determined according to the predicted scoring results corresponding to the sample questions outside the question bank, the test classification predicted results corresponding to the test ID and the predicted results of the preset vocabulary; based on the loss function value, the parameters of the first question scoring model are updated.
[0149] According to an embodiment of the present application, the pre-training module is used to determine a first loss function value of a first test question scoring model based on the predicted scoring results and the manual scoring results of sample test questions outside the question bank; determine a second loss function value of the first test question scoring model based on the test classification prediction results and the manual test classification results; determine a third loss function value of the first test question scoring model based on the prediction results of preset vocabulary and the preset vocabulary; determine the loss function value of the first test question scoring model based on the first loss function value, the second loss function value and the third loss function value.
[0150] According to an embodiment of the present application, the first loss function value is calculated by a regression loss function based on a mean square error, and the second loss function value and the third loss function value are calculated by a cross entropy loss function.
[0151] According to an embodiment of the present application, the loss function value of the first test question scoring model is a weighted average of the first loss function value, the second loss function value and the third loss function value.
[0152] According to an embodiment of the present application, sample data of the first test question scoring model comes from different academic stages, different grades, different schools, different regions and / or different examinations.
[0153] According to an embodiment of the present application, the first test question scoring model includes at least one encoding layer, and the second test question scoring model includes at least one encoding layer and at least one adapter model embedded in each encoding layer, wherein at least one adapter model is obtained by adjusting the parameters of the second neural network model embedded in the first test question scoring model by using the scoring data of sample test questions in the question bank while keeping the parameters of the first test question scoring model unchanged.
[0154] According to an embodiment of the present application, the second test question scoring model also includes a shared parameter layer, wherein the training module is also used to dynamically generate parameters of at least one adapter model through the shared parameter layer according to the identification ID corresponding to the sample test questions in the question bank.
[0155] According to an embodiment of the present application, the training module is used to obtain predicted scoring results of sample test questions in the question bank based on the sample test questions in the question bank through at least one encoding layer and at least one adapter; and update the parameters of the shared parameter layer based on the difference between the predicted scoring results of the sample test questions in the question bank and the manual scoring results of the sample test questions in the question bank.
[0156] According to an embodiment of the present application, at least one encoding layer includes an encoding layer, and at least one adapter model includes an adapter model, wherein the training module is used to convert the test identification ID corresponding to the sample test questions in the question bank into an embedding layer vector through the embedding layer of the shared parameter layer; the embedding layer vector is sequentially input into the first linear layer, the activation function layer, and the second linear layer of the shared parameter layer to obtain the parameters of the adapter model.
[0157] According to an embodiment of the present application, at least one coding layer includes multiple coding layers, and at least one adapter model includes multiple adapter models, wherein the pre-training module is used to select a coding layer from multiple coding layers according to the correspondence between the test ID corresponding to the sample test questions in the question bank and the coding layer position IDs corresponding to the multiple coding layers, and obtain the coding layer position ID of the coding layer; select an adapter model from the multiple adapter models in the coding layer according to the correspondence between the test ID corresponding to the sample test questions in the question bank and the adapter position IDs corresponding to the multiple adapter models, and obtain the adapter position ID of the adapter model; through the embedding layer of the shared parameter layer, the test ID, the coding layer position ID and the adapter position ID are respectively converted into the test embedding vector, the coding layer position embedding layer vector and the adapter position embedding layer vector; after splicing the test embedding layer quantity, the coding layer position embedding layer vector and the adapter position embedding layer vector, they are sequentially input into the first linear layer, the activation function layer and the second linear layer of the shared parameter layer to obtain the parameters of the adapter model.
[0158] According to an embodiment of the present application, the parameters of at least one adapter model include weights and / or biases.
[0159] According to an embodiment of the present application, at least one adapter includes a first linear layer, an activation function layer, and a second linear layer.
[0160] According to an embodiment of the present application, the test question is a composition test question.
[0161] Fig. 9 It is a schematic structural diagram of a test question scoring device provided in one embodiment of the present application. Fig. 9 The device 900 may be a user terminal or other computing device. The device 900 may include an acquisition module 910 and a determination module 920. These modules are described in detail below.
[0162] The acquisition module 910 is used to obtain the student answer sheet corresponding to the test question in the question bank, and the student answer sheet includes the answer result corresponding to the test question in the question bank and the test ID corresponding to the test question in the question bank. The determination module 920 is used to determine the score of the student answer sheet based on the answer result and the test ID using the test question scoring model, wherein the test question scoring model is obtained according to the method described in the first aspect.
[0163] According to an embodiment of the present application, a test question scoring model obtained by pre-training with test question scoring data outside the test bank and fine-tuning with the scoring data of test questions in the question bank is used to score the answer results of the test questions in the question bank, which can not only ensure the effectiveness of the scoring model in scoring specific test questions.
[0164] Fig.10 It is a structural schematic diagram of an electronic device provided in yet another embodiment of the present application. Fig.10 The device 1000 shown may be a device capable of executing a method for scoring test questions or a method for training a test question scoring model. The device 1000 may be, for example, a computing device with computing functions. For example, the device 1000 may be a user terminal or a server. The device 1000 may include a memory 1010 and a processor 1020. The memory 1010 may be used to store executable code. The processor 1020 may be used to execute the executable code stored in the memory 1010 to implement the steps in the various methods described above. In some embodiments, the device 1000 may also include a network interface 1030, and data exchange between the processor 1020 and an external device may be implemented through the network interface 1030.
[0165] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0166] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments of the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0167] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0168] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0169] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0170] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A test scoring method, It is characterized in that include: Obtaining student answer sheets corresponding to the test questions in the question bank, wherein the student answer sheets include answer results corresponding to the test questions in the question bank; According to the answer result, the score of the student's answer sheet is determined using a second test question scoring model, wherein the second test question scoring model is obtained by training a second neural network model embedded in the first test question scoring model using scoring data of sample test questions in a test bank while keeping parameters of the first test question scoring model unchanged, and the first test question scoring model is obtained by pre-training a first neural network model using scoring data of sample test questions outside the test bank, wherein the second test question scoring model includes at least one encoding layer, at least one adapter model embedded in each encoding layer, and a shared parameter layer, and the test question scoring method further includes: Dynamically generating parameters of the at least one adapter model through the shared parameter layer according to the test identifiers corresponding to the sample test questions in the question bank; When the at least one encoding layer includes a plurality of encoding layers, and the at least one adapter model includes a plurality of adapter models, dynamically generating the parameters of the at least one adapter model through the shared parameter layer according to the test identifier corresponding to the sample test questions in the question bank includes: According to the correspondence between the test identifier corresponding to the sample test questions in the question bank and the coding layer position identifiers corresponding to the multiple coding layers, one coding layer is selected from the multiple coding layers to obtain the coding layer position identifier of the coding layer; according to the correspondence between the test identifier corresponding to the sample test questions in the question bank and the adapter position identifiers corresponding to the multiple adapter models, one adapter model is selected from the multiple adapter models in the coding layer to obtain the adapter position identifier of the adapter model; through the embedding layer of the shared parameter layer, the test identifier, the coding layer position identifier and the adapter position identifier are respectively converted into a test embedding layer vector, a coding layer position embedding layer vector and an adapter position embedding layer vector; after splicing the test embedding layer vector, the coding layer position embedding layer vector and the adapter position embedding layer vector, they are sequentially input into the first linear layer, the activation function layer and the second linear layer of the shared parameter layer to obtain the parameters of the adapter model.
2. The test question scoring method according to claim 1, It is characterized in that Also includes: Obtain the student answer sheet and the corresponding test identifier corresponding to the test question in the question bank, Wherein, determining the score of the student's answer sheet using a second test question scoring model according to the answer result includes: The score of the student's answer sheet is determined using the second test question scoring model according to the answer result and the test identifier corresponding to the test question in the question bank.
3. The test question scoring method according to claim 1, It is characterized in that The first test question scoring model is obtained through the following pre-training process: According to the sample test questions outside the question bank and the test identification corresponding to the sample test questions outside the question bank, obtaining the predicted score result corresponding to the sample test questions outside the question bank and the test classification prediction result corresponding to the test identification through the first test question scoring model; Performing masking and / or replacement processing on the preset vocabulary in the sample test questions outside the question bank to obtain processed sample test questions outside the question bank, and obtaining prediction results of the preset vocabulary through the first test question scoring model based on the processed sample test questions outside the question bank; Determine the loss function value of the first test question scoring model according to the predicted scoring results corresponding to the sample test questions outside the question bank, the test classification prediction results corresponding to the test identifier, and the prediction results of the preset vocabulary; Based on the loss function value, update the parameters of the first test question scoring model.
4. The test question scoring method according to claim 3, It is characterized in that The determining the loss function value of the first test question scoring model according to the predicted scoring result corresponding to the sample test question outside the question bank, the test classification prediction result corresponding to the test identifier, and the prediction result of the preset vocabulary includes: Determining a first loss function value of the first test question scoring model according to the predicted scoring result and the manual scoring result of the sample test questions outside the test bank; Determining a second loss function value of the first test question scoring model according to the test classification prediction result and the manual test classification result; Determining a third loss function value of the first test question scoring model according to the prediction result of the preset vocabulary and the preset vocabulary; Based on the first loss function value, the second loss function value and the third loss function value, determine the loss function value of the first test question scoring model.
5. The test question scoring method according to claim 4, It is characterized in that The loss function value of the first test question scoring model is a weighted average of the first loss function value, the second loss function value and the third loss function value.
6. The test question scoring method according to claim 1, It is characterized in that The first test question scoring model includes at least one encoding layer, and the encoding layer has a self-attention mechanism. The second test question scoring model includes the at least one encoding layer and at least one adapter model embedded in each encoding layer, and the adapter model is used to extract features of the test questions in the question bank according to the test identifiers corresponding to the test questions in the question bank. The at least one adapter model is obtained by adjusting the parameters of the second neural network model embedded in the first test question scoring model using the scoring data of the sample test questions in the question bank while keeping the parameters of the first test question scoring model unchanged.
7. The test question scoring method according to claim 6, It is characterized in that The second test question scoring model also includes a shared parameter layer. Wherein, the method further comprises: According to the test identifiers corresponding to the test questions in the question bank, the parameters of the at least one adapter model are dynamically generated through the shared parameter layer.
8. The test question scoring method according to claim 1, It is characterized in that The step of training the second neural network model embedded in the first test question scoring model using the scoring data of the sample test questions in the test bank to obtain the second test question scoring model includes: According to the sample test questions in the question bank, obtaining predicted scoring results of the sample test questions in the question bank through the at least one encoding layer and the at least one adapter; The parameters of the shared parameter layer are updated according to the difference between the predicted scoring results of the sample test questions in the question bank and the manual scoring results of the sample test questions in the question bank.
9. The test question scoring method according to claim 8, It is characterized in that The at least one encoding layer comprises an encoding layer, the at least one adapter model comprises an adapter model, The dynamically generating the parameters of the at least one adapter model through the shared parameter layer according to the test identifier corresponding to the sample test questions in the question bank includes: Converting the test identifiers corresponding to the sample test questions in the test bank into embedding layer vectors through the embedding layer of the shared parameter layer; The embedding layer vector is sequentially input into the first linear layer, the activation function layer and the second linear layer of the shared parameter layer to obtain the parameters of the adapter model.
10. A method for training a test scoring model, It is characterized in that include: Pre-training the first neural network model using the test question scoring data to obtain a first test question scoring model, wherein the test question scoring data includes scoring data of sample test questions outside the question bank; While keeping the parameters of the first test question scoring model unchanged, the second neural network model embedded in the first test question scoring model is trained using the scoring data of the sample test questions in the question bank to obtain a second test question scoring model, wherein the second neural network model is embedded after the pre-training of the first test question scoring model is completed, and the second test question scoring model includes at least one encoding layer, at least one adapter model embedded in each encoding layer, and a shared parameter layer, wherein the shared parameter layer dynamically generates the parameters of the at least one adapter model according to the test identifier corresponding to the sample test questions in the question bank; when the at least one encoding layer includes multiple encoding layers and the at least one adapter model includes multiple adapter models, the shared parameter layer dynamically generates the parameters of the at least one adapter model according to the test identifier corresponding to the sample test questions in the question bank, including: According to the correspondence between the test identifier and the coding layer position identifiers corresponding to the multiple coding layers, one coding layer is selected from the multiple coding layers to obtain the coding layer position identifier of the coding layer; according to the correspondence between the test identifier corresponding to the sample test questions in the question bank and the adapter position identifiers corresponding to the multiple adapter models, an adapter model is selected from the multiple adapter models in the coding layer to obtain the adapter position identifier of the adapter model; through the embedding layer of the shared parameter layer, the test identifier, the coding layer position identifier and the adapter position identifier are respectively converted into a test embedding layer vector, a coding layer position embedding layer vector and an adapter position embedding layer vector; after splicing the test embedding layer vector, the coding layer position embedding layer vector and the adapter position embedding layer vector, they are sequentially input into the first linear layer, the activation function layer and the second linear layer of the shared parameter layer to obtain the parameters of the adapter model.
11. A test scoring device, It is characterized in that include: An acquisition module is used to acquire student answer sheets corresponding to the test questions in the question bank, wherein the student answer sheets include answer results corresponding to the test questions in the question bank; A determination module is used to determine the score of the student answer sheet using a second test question scoring model based on the answer result, wherein the second test question scoring model is obtained by training a second neural network model embedded in the first test question scoring model using the scoring data of sample test questions in a question bank while keeping the parameters of the first test question scoring model unchanged, and the first test question scoring model is obtained by pre-training a first neural network model using the scoring data of sample test questions outside the question bank, wherein the second test question scoring model includes at least one encoding layer, at least one adapter model embedded in each encoding layer, and a shared parameter layer, wherein the determination module is also used to dynamically generate parameters of the at least one adapter model through the shared parameter layer according to the test identifier corresponding to the sample test questions in the question bank; when the at least one encoding layer includes multiple encoding layers and the at least one adapter model includes multiple adapter models, the determination module is used According to the correspondence between the test identifier corresponding to the sample test questions in the question bank and the coding layer position identifiers corresponding to the multiple coding layers, one coding layer is selected from the multiple coding layers to obtain the coding layer position identifier of the coding layer; according to the correspondence between the test identifier corresponding to the sample test questions in the question bank and the adapter position identifiers corresponding to the multiple adapter models, one adapter model is selected from the multiple adapter models in the coding layer to obtain the adapter position identifier of the adapter model; through the embedding layer of the shared parameter layer, the test identifier, the coding layer position identifier and the adapter position identifier are respectively converted into a test embedding layer vector, a coding layer position embedding layer vector and an adapter position embedding layer vector; after splicing the test embedding layer vector, the coding layer position embedding layer vector and the adapter position embedding layer vector, they are sequentially input into the first linear layer, the activation function layer and the second linear layer of the shared parameter layer to obtain the parameters of the adapter model.
12. A device for training a test scoring model, It is characterized in that include: A pre-training module, used to pre-train the first neural network model using the test question scoring data to obtain a first test question scoring model, wherein the test question scoring data includes scoring data of sample test questions outside the question bank; A training module is used to train the second neural network model embedded in the first test question scoring model using the scoring data of the sample test questions in the question bank while keeping the parameters of the first test question scoring model unchanged, so as to obtain a second test question scoring model, wherein the second neural network model is embedded after the pre-training of the first test question scoring model is completed, and the second test question scoring model includes at least one encoding layer, at least one adapter model embedded in each encoding layer, and a shared parameter layer, wherein the training module is also used to dynamically generate the parameters of the at least one adapter model through the shared parameter layer according to the test identifier corresponding to the sample test questions in the question bank; when the at least one encoding layer includes multiple encoding layers and the at least one adapter model includes multiple adapter models, the training module is used to dynamically generate the parameters of the at least one adapter model according to the test identifier corresponding to the sample test questions in the question bank and the multiple adapter models. According to the correspondence between the coding layer position identifiers corresponding to the coding layers, one coding layer is selected from the multiple coding layers to obtain the coding layer position identifier of the coding layer; according to the correspondence between the test identifiers corresponding to the sample test questions in the question bank and the adapter position identifiers corresponding to the multiple adapter models, one adapter model is selected from the multiple adapter models in the coding layer to obtain the adapter position identifier of the adapter model; through the embedding layer of the shared parameter layer, the test identifier, the coding layer position identifier and the adapter position identifier are respectively converted into a test embedding layer vector, a coding layer position embedding layer vector and an adapter position embedding layer vector; after splicing the test embedding layer vector, the coding layer position embedding layer vector and the adapter position embedding layer vector, they are sequentially input into the first linear layer, the activation function layer and the second linear layer of the shared parameter layer to obtain the parameters of the adapter model.
13. An electronic device, It is characterized in that include: A memory and a processor, wherein the memory stores an executable code, and the processor is configured to execute the executable code to implement the method according to any one of claims 1 to 10.
14. A storage medium, It is characterized in that The storage medium stores executable codes, and when the executable codes are executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Composition reviewing method and system based on neural network
CN112527968A