Question correction method and device, equipment, storage medium and program product
By building a historical answer library and grading it on the basis of it, the problem of low correction efficiency and accuracy in the existing technology has been solved, and a more efficient and accurate correction process has been achieved.
Patent Information
- Application Number
- CN202411892141.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-05-02
AI Technical Summary
In the large-scale online education scenario, it is difficult to ensure the real-time and efficiency of correction when thousands of students answer the answers. The traditional language model is based on static standard answer matching rules, resulting in low correction accuracy.
By constructing a historical answer library, we can judge whether there are questions to be corrected and students' answers in the historical answer library. If they exist, directly read the sample correction results; if they do not exist, the predicted correction results will be determined based on the questions to be corrected and students' answers.
It reduces unnecessary inference calculations, reduces resource consumption, significantly improves the efficiency and accuracy of correction, and ensures that all students' answers to questions to be corrected can be accurately corrected.
Smart Images

Figure CN119917651A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of text processing technology, and in particular to a question correction method, device, equipment, storage medium and program product. Background Art
[0002] With the rapid development of online education and intelligent education technology, traditional manual grading methods can no longer meet the needs of large-scale personalized learning and assessment. Especially in primary and secondary education and online tutoring, some types of questions (such as fill-in-the-blank questions, etc.) place high demands on language comprehension, knowledge transfer, and flexible application. However, the answers to some types of questions are diverse, often with complex situations such as synonymous expressions, grammatical changes, and different word orders, which makes the grading task extremely challenging.
[0003] At present, deep learning models are generally relied on to independently reason about each student's answer. Especially in large-scale online education scenarios, facing thousands of students answering, relying on a single model reasoning method is difficult to ensure the real-time and efficiency of grading. Moreover, traditional language models are mostly based on static standard answer matching rules, which may give inaccurate grading results for slightly different correct answers, and the grading accuracy is low. Summary of the invention
[0004] The present application provides a question grading method, apparatus, device, storage medium and program product to improve the efficiency and accuracy of grading.
[0005] According to a first aspect of an embodiment of the present application, a method for correcting a question is provided, comprising:
[0006] Determine whether there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library; wherein the historical answer library is constructed based on sample data; the sample data includes sample questions, sample student answers corresponding to the sample questions, and sample correction results corresponding to the sample student answers;
[0007] In the case where there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library, reading sample correction results corresponding to the student answers to be corrected from the historical answer library;
[0008] When there are no unmarked questions and the corresponding student answers in the historical answer database, a predicted grading result corresponding to the student answers is determined based on the unmarked questions and the corresponding student answers.
[0009] According to a second aspect of an embodiment of the present application, a question correction device is provided, comprising:
[0010] A judgment unit, used to judge whether there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library; wherein the historical answer library is constructed based on sample data; the sample data includes sample questions, sample student answers corresponding to the sample questions, and sample correction results corresponding to the sample student answers;
[0011] A reading unit, configured to read a sample correction result corresponding to the student answer to be corrected from the historical answer library when there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library;
[0012] The prediction unit is used to determine the predicted grading result corresponding to the student answer to be corrected based on the question to be corrected and the student answer to be corrected corresponding to the question to be corrected, if there is no question to be corrected and the student answer to be corrected corresponding to the question to be corrected in the historical answer library.
[0013] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including a memory and a processor;
[0014] The memory is connected to the processor and is used to store programs;
[0015] The processor is used to implement the question correction method as described in the first aspect by running the program in the memory.
[0016] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the question correction method as described in the first aspect is implemented.
[0017] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer program instructions, which, when executed by a processor, cause the processor to execute the question grading method as described in the first aspect.
[0018] In this application, it is determined whether there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library. If there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library, the sample correction results corresponding to the student answers to be corrected are read from the historical answer library. For the same student answers to the same question, there is no need to repeat the reasoning, and the sample correction results are directly read from the historical answer library, which reduces unnecessary reasoning calculations and reduces the resource consumption of repeated reasoning, thereby significantly improving the efficiency of correction. Moreover, for the same student answers to the same question, the sample correction results that have been corrected in the historical answer library are directly used. On the basis that the sample correction results that have been corrected in the historical answer library are relatively accurate, the accuracy of correction can also be improved. In the case that there are no questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library, based on the questions to be corrected and the student answers to be corrected corresponding to the questions to be corrected, the predicted correction results corresponding to the student answers to be corrected are determined, ensuring that each student answer to be corrected corresponding to the questions to be corrected can obtain the correction results, avoiding missing some student answers to be corrected during correction. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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.
[0020] Figure 1 A flowchart of a method for correcting a question provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a process of constructing a historical answer library provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of a process of constructing a historical answer library provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of a process of step 103 provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of a pre-training process of a correction model provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of a fine-tuning process of a correction model provided in an embodiment of the present application;
[0026] Figure 7A flowchart of a training process of a correction model provided in an embodiment of the present application;
[0027] Figure 8 A flowchart of step 702 provided in an embodiment of the present application;
[0028] Fig. 9 A flowchart of step 803 provided in an embodiment of the present application;
[0029] Fig.10 A schematic diagram of the structure of a question correction device provided in an embodiment of the present application;
[0030] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] With the rapid development of online education and intelligent education technology, traditional manual grading methods can no longer meet the needs of large-scale personalized learning and assessment. Especially in primary and secondary education and online tutoring, some types of questions (such as fill-in-the-blank questions, etc.) place high demands on language comprehension, knowledge transfer, and flexible application. However, the answers to some types of questions are diverse, often with complex situations such as synonymous expressions, grammatical changes, and different word orders, which makes the grading task extremely challenging.
[0032] In the current natural language processing (NLP) and intelligent grading systems, technical solutions based on pre-trained language models have been widely used in the fields of text understanding, machine translation, automatic summarization, question-answering systems, etc. For automatic grading tasks in the field of education, a variety of deep learning-based models have been proposed, especially in the automatic grading of subjective questions and fill-in-the-blank questions, where pre-trained language models have gradually become the mainstream technology. Pre-trained language models, such as BERT (Bidirectional Encoder Representation from Transformers) and RoBERTa (Robustly optimized BERT approach), have demonstrated strong performance in text understanding and generation tasks.
[0033] BERT uses a bidirectional Transformer (a deep learning model) architecture to simultaneously capture contextual information and generate high-quality text embedding representations. In order to adapt to tasks in different fields, BERT can solve various downstream tasks such as text classification, sentiment analysis, and question-answering systems through fine-tuning.
[0034] However, these models still have certain limitations when dealing with some types of questions in actual educational scenarios (such as fill-in-the-blank questions, etc.). The correct answer to a fill-in-the-blank question often requires a comprehensive consideration of contextual semantics, common sense reasoning, grammatical structure and other factors, which places higher requirements on the pre-trained model. In order to meet these challenges, researchers have proposed a variety of improvement plans, such as combining pre-trained language models with tasks in specific fields, and improving the performance of the model in specific tasks through transfer learning or fine-tuning.
[0035] Some questions in the field of education, such as fill-in-the-blank questions, often have students answering in various forms, synonym replacement, word order changes, typos, sloppy answers, and even OCR (Optical Character Recognition) errors. Simply relying on model reasoning cannot fully cover the diversity of students' answers. Existing automated grading technology has shown certain limitations in dealing with these changing answer forms, especially the low efficiency in processing common answers and the lack of effective use of historical answers.
[0036] Existing methods generally rely on deep learning models to independently reason about each student's answer, while ignoring the repetitiveness of students' answers in actual educational scenarios. In fact, the answers to many questions are highly patterned, and students' answers are often similar or even identical. Existing grading models will re-semantically reason and match each answer, which not only increases unnecessary computational overhead, but may also lead to misjudgment of some common answers.
[0037] Especially in large-scale online education scenarios, with tens of thousands of students answering questions, it is difficult to ensure the real-time and efficiency of grading by relying on a single model reasoning method. In addition, due to the lack of a reuse mechanism for historical answers, the model often needs to frequently call complex reasoning processes, resulting in excessively high computational costs, and this process is redundant for standard answers that have appeared many times.
[0038] Moreover, most traditional language models are based on static standard answer matching rules, which may give inaccurate grading results for slightly different correct answers, and the grading accuracy is low. In addition, common typos and spelling errors in students' answers are often simply judged as errors in the current system, without effective reasoning and correction through semantics and context information, resulting in inaccurate grading results. This means that in educational scenarios where personalized answers and complex language phenomena occur frequently, the accuracy of existing model grading still cannot meet teaching needs.
[0039] In order to improve the efficiency and accuracy of grading, the present application provides a question grading method, device, equipment, storage medium and program product.
[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0041] Exemplary Implementation Environment
[0042] The question correction method according to the embodiment of the present application can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), a mobile device, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The server can be an independent physical server, a server cluster composed of multiple physical servers, or a cloud server capable of cloud computing. The method can be implemented by a processor calling a computer-readable program instruction stored in a memory.
[0043] Exemplary Methods
[0044] The question grading method provided in this application can be applied to online education platforms, intelligent homework systems, and automated examination evaluation systems to improve teaching efficiency and reduce teachers' workload.
[0045] See also Figure 1 In an exemplary embodiment, a method for correcting a question is provided. Figure 1 As shown in the figure, the process of the question correction method mainly includes:
[0046] Step 101 , determine whether there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer database, if so, execute step 102 , otherwise, execute step 103 .
[0047] Among them, the historical answer library is constructed based on sample data; the sample data includes sample questions, sample student answers corresponding to the sample questions, and sample correction results corresponding to the sample student answers.
[0048] In an exemplary embodiment, the sample questions and the questions to be corrected mentioned in this application are questions of the same type. For example, the sample questions and the questions to be corrected can be fill-in-the-blank questions, the sample questions and the questions to be corrected can also be short-answer questions, and the sample questions and the questions to be corrected can also be other types of questions, and this application does not limit this. In the following embodiments, the sample questions and the questions to be corrected are explained as fill-in-the-blank questions.
[0049] In an exemplary embodiment, the sample correction result corresponding to the sample student answer may include whether the sample student answer is correct, and the sample correction result corresponding to the sample student answer may also include the score of the sample student answer, which is not limited in this application.
[0050] In some embodiments, Figure 2 As shown in the figure, the construction process of the historical answer library mainly includes:
[0051] Step 201, after removing duplicates from each first sample answer result pair corresponding to the sample question in the sample data, store the answer result in a historical answer library together with the sample question.
[0052] Among them, each first sample answer result pair is a sample answer result pair that does not conflict with each other.
[0053] Among them, a sample student answer and a sample correction result corresponding to the sample student answer constitute a sample answer result pair.
[0054] In an exemplary embodiment, a sample student answer is a, and a sample correction result corresponding to the sample student answer a is a score of 0, and a and the score of 0 constitute a sample answer result pair A.
[0055] After deduplicating each first sample answer result pair corresponding to the sample questions in the sample data, each deduplicated first sample answer result corresponding to the sample questions is obtained, and each deduplicated first sample answer result corresponding to the sample questions is stored in the historical answer library together with the sample questions, wherein each first sample answer result pair is a sample answer result pair that does not conflict with each other. After deduplication, they are stored in the historical answer library, which can reduce the subsequent processing time of reading the sample correction results corresponding to the student answers to be corrected from the historical answer library, thereby improving the efficiency of correction. Moreover, the sample answer result pairs stored in the historical answer library do not conflict with each other, thereby avoiding obvious illogical errors in the data stored in the historical answer library, thereby improving the accuracy of correction.
[0056] Step 202: Determine the second sample answer result pair with the highest occurrence frequency among the second sample answer result pairs corresponding to the sample questions in the sample data as the target sample answer result pair corresponding to the sample question.
[0057] Among them, each second sample answer result pair is a sample answer result pair that conflicts with each other.
[0058] In an exemplary embodiment, conflicts between sample answer result pairs may include that the sample student answers corresponding to each sample answer result pair are the same, but the sample correction results corresponding to each sample answer result pair are different. For example, the sample student answer of sample answer result pair A corresponding to sample question 1 is a, and the sample correction result is a score of 0. The sample student answer of sample answer result pair B corresponding to sample question 1 is also a, but the sample correction result is a score of 1. Then, there is a conflict between sample answer result pair A and sample answer result pair B corresponding to sample question 1. It may also include that when the type of sample question is a fixed answer type question, each sample answer result pair has a different sample answer pair. The sample student answers corresponding to the answer result pairs are different, but the sample correction results corresponding to the sample question are the same, and the sample correction results are used to indicate that the sample student answers are correct. For example, sample question 1 is a fixed answer type question, the sample student answer of sample answer result pair A corresponding to sample question 1 is a, and the sample correction result is a score of 1 (correct); the sample student answer of sample answer result pair B corresponding to sample question 1 is b, and the sample correction result is a score of 1 (correct), then there is a conflict between the sample answer result pair A and the sample answer result pair B corresponding to sample question 1; there may be other situations, which are not limited to this.
[0059] For example, each second sample answer result pair includes 10 sample answer result pairs A and 1 sample answer result pair B. The sample student answer of sample answer result pair A is 8, and the sample correction result is a score of 0. The sample student answer of sample answer result pair B is 8, and the sample correction result is a score of 1. The frequency of occurrence of sample answer result pair A in each second sample answer result pair is 10, and the frequency of occurrence of sample answer result pair B in each second sample answer result pair is 1. Sample answer result pair A has the highest frequency of occurrence in each second sample answer result pair, and sample answer result pair A is determined as the target sample answer result pair corresponding to the sample question.
[0060] Step 203, storing the target sample answer result pair corresponding to the sample question and the sample question in the historical answer library.
[0061] The second sample answer result pairs are conflicting sample answer result pairs, indicating that some of the second sample answer result pairs are wrong. The second sample answer result pair with the highest frequency is a relatively accurate sample answer result pair. The second sample answer result pair with the highest frequency is determined as the target sample answer result pair, and the target sample answer result pair corresponding to the sample question is stored in the historical answer library together with the sample question. This can improve the accuracy of the data stored in the historical answer library, thereby improving the accuracy of grading.
[0062] For situations where there may be conflicts between sample answer result pairs due to OCR recognition errors, such as consistent sample student answers but inconsistent sample grading results, the second sample answer result pair with the highest frequency is determined as the target sample answer result pair, the second sample answer result pair is corrected, and the target sample answer result pair corresponding to the sample question and the sample question are stored in the historical answer library, thereby improving the accuracy of the data stored in the historical answer library, and thereby improving the accuracy of grading.
[0063] In some embodiments, when there is no conflict between all sample answer result pairs corresponding to sample questions in the sample data, only step 201 needs to be executed, and steps 202 and 203 do not need to be executed; when there is a conflict between all sample answer result pairs corresponding to sample questions in the sample data, only steps 202 and 203 need to be executed, and step 201 does not need to be executed; when there is no conflict between some sample answer result pairs corresponding to sample questions in the sample data, and there is a conflict between some sample answer result pairs, step 201 is executed for the sample answer result pairs that do not conflict with each other, and steps 202 and 203 are executed for the sample answer result pairs that conflict with each other.
[0064] In other embodiments, the construction process of the historical answer library includes: directly removing duplicates from each sample answer result pair corresponding to the sample question in the sample data, and storing the sample answer result pair together with the sample question in the historical answer library. A sample student answer and a sample correction result corresponding to the sample student answer constitute a sample answer result pair.
[0065] In some embodiments, Figure 3 As shown, the construction process of the historical answer library also includes:
[0066] Step 301, based on the first occurrence frequency of the target sample answer result pair corresponding to the sample question in each second sample answer result pair corresponding to the sample question, and the second occurrence frequency of the conflicting sample answer result pair corresponding to the sample question in each second sample answer result pair corresponding to the sample question, determine the confidence of the target sample answer result pair corresponding to the sample question.
[0067] The conflicting sample answer result pair corresponding to the sample question refers to a sample answer result pair that conflicts with the target sample answer result pair corresponding to the sample question.
[0068] In the exemplary embodiment, the first occurrence frequency is represented by n1, the second occurrence frequency is represented by n2, the confidence of the target sample answer result pair is represented by confidence, and the specific calculation formula of the confidence of the target sample answer result pair is as follows:
[0069]
[0070] Step 302, storing the confidence of the target sample answer result pair corresponding to the sample question in the historical answer library.
[0071] For example, the second sample answer result pairs corresponding to sample question 1 include 10 sample answer result pairs A and 1 sample answer result pair B. The sample student answer of sample answer result pair A is 8, and the sample correction result is a score of 0. The sample student answer of sample answer result pair B is 8, and the sample correction result is a score of 1. Sample answer result pair A is the target sample answer result pair, and sample answer result pair B is the conflicting sample answer result pair. n1=10, n2=1, confidence=10 / (10+1)=0.91. The sample question 1 and {8:(0,0.91)} may be stored in the historical answer library, indicating that the answer to sample question 1 is 8, the score is 0, and the confidence is 0.91.
[0072] Step 102, read the sample correction result corresponding to the student answer to be corrected from the historical answer library.
[0073] In some embodiments, the question grading method further includes: when there are ungraded questions and ungraded student answers corresponding to the ungraded questions in the historical answer library, reading the confidence of the ungraded answer result pair corresponding to the ungraded questions from the historical answer library.
[0074] Among them, the student answers to be corrected and the sample correction results corresponding to the student answers to be corrected constitute the answer result pair to be corrected.
[0075] Based on the first occurrence frequency of the target sample answer result pair corresponding to the sample question in each second sample answer result pair corresponding to the sample question, and the second occurrence frequency of the conflicting sample answer result pair corresponding to the sample question in each second sample answer result pair corresponding to the sample question, the confidence of the target sample answer result pair corresponding to the sample question is determined, and the confidence of the target sample answer result pair corresponding to the sample question is stored in the historical answer library. When the sample correction results corresponding to the student answers to be corrected are subsequently read from the historical answer library, the confidence of the answer result pairs to be corrected corresponding to the questions to be corrected can also be read at the same time, so as to know the accuracy of the sample correction results corresponding to the student answers to be corrected.
[0076] Step 103: based on the questions to be graded and the student answers to be graded corresponding to the questions to be graded, determine the predicted grading results corresponding to the student answers to be graded.
[0077] In some embodiments, step 103 includes: obtaining a reference answer corresponding to the question to be graded based on the question to be graded; and determining a predicted grading result corresponding to the student answer to be graded based on the student answer to be graded corresponding to the question to be graded and the reference answer to the question to be graded.
[0078] In other embodiments, Figure 4 As shown, step 103 includes:
[0079] Step 401, input the questions to be graded and the student answers to be graded corresponding to the questions to be graded into the grading model to obtain the classification results corresponding to the student answers to be graded.
[0080] Among them, the grading model is trained based on the sample data and the reference answers corresponding to the sample questions.
[0081] In an exemplary embodiment, the correction model can be a pre-trained language model, for example, the correction model can be BERT; since BERT has certain limitations in Chinese processing, especially in language-specific structures and common typos, and the original BERT is trained in English, which may affect its accuracy in correcting Chinese fill-in-the-blank questions, the correction model can be MacBERT (MLM as correction BERT, a bidirectional encoder representation model of error correction mask, which is a Chinese pre-trained model), where MLM refers to a masked language model. The correction model can be any pre-trained language model, and this application does not limit this.
[0082] In an exemplary embodiment, the reference answer includes at least one of a standard answer and an answer analysis. Some questions may directly give a standard answer, and only when the student answer is consistent with the standard answer will the student get a score, and when the student answer is inconsistent with the standard answer, no score will be given; some questions may give an answer analysis, and as long as the student answer and the key scoring points in the answer analysis express the same meaning, the student answer can get a score. The expression of the student answer and the answer analysis may be different, but it does not affect the score; some questions may have both a standard answer and an answer analysis, and the student answer needs to be compared with the standard answer first. If they are inconsistent, the student answer is compared with the answer analysis.
[0083] In an exemplary embodiment, the sample data includes sample questions, sample student answers corresponding to the sample questions, and sample correction results corresponding to the sample student answers. The sample student answers corresponding to the sample questions are corrected based on the reference answers corresponding to the sample questions to obtain sample correction results corresponding to the sample student answers.
[0084] In an exemplary embodiment, the sample correction result corresponding to the sample student answer may include whether the sample student answer is correct, and the sample correction result corresponding to the sample student answer may also include the score of the sample student answer, which is not limited in this application.
[0085] In an exemplary embodiment, the classification results corresponding to the student answers to be corrected may include the predicted probabilities that the student answers to be corrected belong to each sample correction result corresponding to the sample questions. The classification results corresponding to the student answers to be corrected may also include the predicted correction results corresponding to the student answers to be corrected. This application is not limited to this.
[0086] In an exemplary embodiment, the correction model is trained based on sample data and reference answers corresponding to sample questions. The correction model can be directly trained using the sample data and reference answers corresponding to sample questions. Alternatively, a historical answer library can be constructed based on the sample data, and the correction model can be trained using the historical answer library and reference answers corresponding to sample questions, wherein the historical answer library can be the historical answer library obtained based on steps 201, 202 and 203.
[0087] Step 402: Determine the predicted grading result corresponding to the student's answer to be graded based on the classification result corresponding to the student's answer to be graded.
[0088] In an exemplary embodiment, when the classification result corresponding to the student answer to be corrected can include the predicted probability that the student answer to be corrected belongs to each sample correction result corresponding to the sample question, step 402 may include determining the sample correction result with the largest predicted probability as the predicted correction result corresponding to the student answer to be corrected; when the classification result corresponding to the student answer to be corrected can include the predicted correction result corresponding to the student answer to be corrected, the classification result corresponding to the student answer to be corrected is directly determined as the predicted correction result corresponding to the student answer to be corrected.
[0089] In an exemplary embodiment, the question grading method may further include: determining the confidence level of the predicted grading result corresponding to the student answer to be graded.
[0090] For example, the predicted probability of each sample correction result corresponding to the sample question that the student's answer to be corrected belongs to can be determined as the confidence level corresponding to each sample correction result. The specific calculation formula for the confidence level of the i-th sample correction result is as follows:
[0091]
[0092] Among them, softmax(z i) refers to the predicted probability that the answer of the student to be corrected belongs to the correction result of the i-th sample; z refers to the unnormalized predicted value output by the last layer (usually the fully connected layer) of the correction model, also known as logits (logical value); z i is the i-th element in logits; K is the total number of sample correction results corresponding to the sample questions; the denominator is the sum of all logits after applying the exponential function, which is used for normalization purposes. The role of the softmax function is to convert logits into a probability distribution so that the sum of all predicted probabilities is equal to 1. In this way, the predicted probability that the answer to be corrected belongs to each sample correction result corresponding to the sample question can be determined as the confidence corresponding to each sample correction result. The predicted correction result corresponding to the answer to be corrected obtained by the correction model can also obtain the corresponding confidence, and the accuracy of the predicted correction result corresponding to the answer to be corrected is known.
[0093] The questions to be graded and the student answers to be graded corresponding to the questions to be graded are input into the grading model to obtain the classification results corresponding to the student answers to be graded. Based on the classification results corresponding to the student answers to be graded, the predicted grading results corresponding to the student answers to be graded are determined. The predicted grading results corresponding to the student answers to be graded can be predicted by the grading model, thereby ensuring the accuracy of the prediction of new answers.
[0094] This method, which combines historical answers with language model reasoning, ensures the system's processing efficiency when faced with high-frequency common answers, while ensuring the accuracy of predicting new answers. By combining the historical answer library and model reasoning, while maintaining efficient grading, the system improves its tolerance and flexibility for different types of answers, which is more in line with the needs of grading fill-in-the-blank questions in educational scenarios, and can effectively solve the shortcomings of existing methods in grading efficiency, accuracy, and diversified answer processing. It not only reduces the resource consumption of repeated reasoning, but also effectively deals with the diversity of students' answers, typos, and other problems.
[0095] In some embodiments, the training process of the correction model includes: pre-training the correction model to obtain a pre-trained correction model; and fine-tuning the pre-trained correction model to obtain a fine-tuned correction model.
[0096] In an exemplary embodiment, the correction model is pre-trained to obtain the pre-trained correction model, which can be pre-trained based on large-scale unlabeled data to obtain the pre-trained correction model. Figure 5 , which is a schematic diagram of the pre-training process of a correction model. Figure 5In the example, [CLS] is used to indicate the beginning of the input sequence and serves as a summary of the entire sequence. During the training of the model, the model learns to use the representation of the CLS position to perform various classification tasks. In the encoded representation, the vector of the CLS position is usually used as a summary representation of the entire sequence, thereby supporting the execution of the classification task. Figure 5 In the model, a portion of the words or characters in the input sequence are randomly selected for masking (usually replaced with a special symbol [MASK]), and then these masked words or characters are predicted based on the context information. [MASK] here refers to this random masking or replacement operation. The semantic information of the missing part of the text is learned by masking a part of the text during pre-training (i.e., Masked Language Model, MLM). Figure 5 shown.
[0097] In an exemplary embodiment, the pre-trained grading model is fine-tuned to obtain the fine-tuned grading model, which can be fine-tuned based on the sample data and the reference answers corresponding to the sample questions to obtain the fine-tuned grading model. The sample data includes sample questions, sample student answers corresponding to the sample questions, and sample grading results corresponding to the sample student answers. Figure 6 , which is a schematic diagram of the fine-tuning process of a correction model. Figure 6 In this paper, the pre-trained correction model is fine-tuned for a specific sample question. Figure 6 No sample questions are shown. Figure 6 In the example, [CLS] is used to indicate the beginning of the input sequence and serves as a summary of the entire sequence. During the training of the model, the model learns to use the representation of the CLS position to perform various classification tasks. In the encoded representation, the vector of the CLS position is usually used as a summary representation of the entire sequence, thereby supporting the execution of the classification task. Figure 6 In the calculation of the loss of the grading model, the sample grading results corresponding to the sample student answers are used. Figure 6 Not shown in .
[0098] In other embodiments, the training process of the correction model includes: fine-tuning the correction model to obtain a fine-tuned correction model; wherein the correction model directly uses an existing model that has been pre-trained as a base model.
[0099] In an exemplary embodiment, fine-tuning the correction model may be performing SFT (Supervised Fine-Tuning) on the correction model.
[0100] The training process of the correction model in the following embodiments mainly refers to the fine-tuning process of the correction model.
[0101] In some embodiments, Figure 7 As shown in Figure 1, the training process of the correction model includes:
[0102] Step 701, generate adversarial samples corresponding to sample student answers.
[0103] In an exemplary embodiment, adversarial training is added to the fine-tuning process of the grading model. Adversarial training is a method to improve the robustness of the model by introducing adversarial examples. In the question grading task, adversarial training helps improve the grading model's ability to adapt to small perturbations or uncertain inputs in students' answers.
[0104] In an exemplary embodiment, the loss function (such as cross entropy loss) is calculated by the standard forward propagation of the correction model, and the gradient of the word embedding of the sample student answer is obtained during the back propagation process; based on these gradients, FGSM (Fast Gradient Sign Method) is used to add small perturbations to the word embedding space to generate adversarial samples. Among them, FGSM is an algorithm for generating adversarial samples based on gradients, which belongs to the non-targeted attack method in adversarial attacks, that is, the adversarial sample does not require the category specified by the model prediction, as long as it is different from the original sample prediction. The adversarial sample x corresponding to the sample student answer x adv The specific formula generated is as follows:
[0105]
[0106] Among them, x refers to the sample student answer, y refers to the true category corresponding to x, that is, y refers to the label of the sample correction result corresponding to the sample student answer, x adv refers to the adversarial sample corresponding to the sample student answer x, ε is the amplitude of the perturbation (usually a small positive number), L(x,y) is the original sample loss, is the gradient of the original sample loss with respect to the sample student answer x, and the sign function returns the sign of the gradient.
[0107] Step 702: Based on the sample data, the reference answers corresponding to the sample questions, and the adversarial samples corresponding to the sample student answers, the grading model is trained to obtain a trained grading model.
[0108] Generate adversarial samples corresponding to sample student answers, and train the grading model based on sample data, reference answers corresponding to sample questions, and adversarial samples corresponding to sample student answers to obtain a trained grading model. This can improve the grading model's ability to adapt to small disturbances or uncertain inputs in student answers, and improve the accuracy of grading.
[0109] In some embodiments, Figure 8 As shown, step 702 includes:
[0110] Step 801, generating sample pairs based on sample student answers corresponding to sample questions and reference answers corresponding to sample questions.
[0111] Among them, a sample pair includes a sample student answer and a reference answer corresponding to the same sample question.
[0112] The sample pairs include positive sample pairs and negative sample pairs; the sample student answers in the positive sample pairs are semantically similar to the reference answers, while the sample student answers in the negative sample pairs are semantically dissimilar to the reference answers.
[0113] Step 802: Determine the semantic similarity corresponding to each sample pair.
[0114] Among them, the semantic similarity of a sample pair refers to the semantic similarity between the sample student answer and the reference answer in the sample pair.
[0115] In an exemplary embodiment, the semantic similarity between the sample student answer and the reference answer may be the cosine similarity between the sample student answer and the reference answer, or may be the semantic similarity calculated by other similarity calculation methods, and the present application is not limited thereto.
[0116] In an exemplary embodiment, the specific calculation formula for the semantic similarity of the j-th sample pair is as follows:
[0117]
[0118] Among them, S j is the reference answer in the jth sample pair, A j is the sample student answer in the jth sample pair, YesS j The vector of Yes A j The vector of YesS j and A j The cosine similarity between .
[0119] Step 803: Based on the sample data, the reference answers corresponding to the sample questions, the adversarial samples corresponding to the sample student answers, and the semantic similarities corresponding to each pair of samples, the correction model is trained to obtain a trained correction model.
[0120] In order to improve the semantic understanding ability of the grading model for the "one-sentence description" answer in the fill-in-the-blank questions, a sentence-level semantic comparison learning task was introduced in the model training process. By constructing positive and negative sample pairs of sample student answers and reference answers, the grading model can maximize the semantic similarity of semantically similar sentences and minimize the semantic similarity of semantically dissimilar sentences, thereby improving the grading model's ability to understand the semantics of student answers.
[0121] In some embodiments, Fig. 9 As shown, step 803 includes:
[0122] Step 901, determining the original sample loss based on the sample data and the reference answers corresponding to the sample questions.
[0123] In an exemplary embodiment, the sample data includes sample questions, sample student answers corresponding to the sample questions, and sample correction results corresponding to the sample student answers.
[0124] In an exemplary embodiment, step 901 may be to use cross entropy as a loss function to determine the original sample loss. task Indicates that Loss task The specific calculation formula is as follows:
[0125]
[0126] Among them, y i Refers to the i-th element in the one-hot encoding of the true label of the sample student’s answer. If the i-th sample correction result is the true category of the sample student’s answer, the value = 1, otherwise the value = 0; It refers to the predicted probability that the sample student answer predicted by the correction model belongs to the i-th sample correction result; K is the total number of sample correction results corresponding to the sample question. It is the natural logarithm of the predicted probability, ensuring that the loss of the original sample is smaller when the model prediction is closer to the true value.
[0127] Step 902, determining the adversarial sample loss based on the adversarial sample corresponding to the sample student answer, the reference answer corresponding to the sample question, and the sample correction result corresponding to the sample student answer.
[0128] In an exemplary embodiment, the adversarial sample loss is expressed as Loss adversarial Indicates that Loss adversarial The specific calculation formula is as follows:
[0129] Loss adversarial =Loss(f(x adv ),y)
[0130] Among them, x advrefers to the adversarial sample corresponding to the sample student answer x, y refers to the true category corresponding to x, that is, y refers to the label of the sample correction result corresponding to the sample student answer, f(x adv ) refers to the adversarial sample x adv The predicted category is obtained by correcting the model prediction, and Loss is the cross entropy loss function.
[0131] In an exemplary embodiment, the adversarial sample corresponding to the sample student answer can be input into the correction model together with the sample student answer to calculate the original sample loss and the adversarial sample loss respectively.
[0132] Step 903: Determine the semantic contrastive learning loss based on the semantic similarities corresponding to each pair of samples.
[0133] In an exemplary embodiment, the semantic contrastive learning loss is Loss contrastive Indicates that Loss contrastive The specific calculation formula is as follows:
[0134]
[0135] Among them, S j is the reference answer in the jth sample pair, A j is the sample student answer in the jth sample pair, YesS j The vector of Yes A j The vector of YesS j and A j The cosine similarity between them is the semantic similarity of the j-th sample pair, and τ is the temperature parameter that adjusts the smoothness of the distribution.
[0136] Step 904, determining the total loss based on the original sample loss, the adversarial sample loss and the semantic contrastive learning loss.
[0137] In an exemplary embodiment, the semantic contrastive learning loss is Loss total Indicates that Loss total The specific calculation formula is as follows:
[0138] Loss total =Loss task +λ1·Loss adversarial +λ2·Loss contrastive
[0139] Among them, the original sample loss is Loss task Indicates that the adversarial sample loss is expressed as Loss adversarial Indicates that semantic contrast learning loss is expressed as Loss contrastiveIt indicates that λ1 and λ2 are two weight parameters that control the impact of different losses on the total loss.
[0140] Step 905: Based on the total loss, the correction model is trained to obtain a trained correction model.
[0141] Based on the original sample loss, adversarial sample loss and semantic contrastive learning loss, the total loss is determined. Based on the total loss, the grading model is trained to obtain the trained grading model. The original sample loss, adversarial sample loss and semantic contrastive learning loss are comprehensively considered to optimize the semantic extraction ability of the grading model, especially when processing fill-in-the-blank questions with short or complex semantics.
[0142] In some embodiments, an early stopping strategy may also be used during the training process of the correction model to avoid overfitting of the correction model, thereby improving the generalization ability and stability of the correction model.
[0143] In model training, early stopping is a commonly used regularization technique that aims to prevent deep learning models from overfitting during training and improve their generalization ability. The core principle of the early stopping strategy is to monitor the performance indicators (such as loss function or accuracy) on the validation set during model training, and terminate the training process early when the indicator no longer improves significantly or begins to deteriorate. This can prevent the model from overfitting on the training set, resulting in poor performance on unseen data (such as validation set or test set).
[0144] In the exemplary embodiment, the model with the best performance in the validation set is finally selected and saved for subsequent reasoning and prediction tasks. The above-mentioned method for improving the grading model not only enhances the generalization ability of the grading model, but also improves the robustness of the grading model in dealing with subtle differences and noise in student answers, thereby achieving better performance in practical applications.
[0145] In some embodiments, a sample question corresponds to an independent model weight in the correction model.
[0146] A sample question corresponds to an independent model weight in the grading model, ensuring that the grading model can be optimized for a specific question. This approach allows the semantic features of each fill-in-the-blank question to be fully learned, avoiding the problem of insufficient generalization performance caused by using a general model. This refined modeling at the question level can more accurately handle the diverse answers in complex fill-in-the-blank questions.
[0147] In the exemplary embodiment, the hyperparameters and training strategies of the grading model are further adjusted according to the accuracy of reasoning and the performance of the grading model on the validation set. In the end, the grading model based on adversarial semantic enhancement achieved an average accuracy of more than 99% on chemistry and biology fill-in-the-blank questions (multiple questions), among which the accuracy on the fill-in-the-blank questions of one sentence description and chemical equation type was around 95%, and in the fixed answer questions, the grading accuracy of the grading model was more than 99.5%. The final grading model's prediction values above 0.9 confidence level in this scenario were an average accuracy of 99.37% for chemistry fill-in-the-blank questions and 99.27% for biology fill-in-the-blank questions.
[0148] By combining adversarial semantic enhancement technology with a historical answer library, a correction model based on adversarial semantic enhancement that is both efficient and fault-tolerant is designed for the correction of fill-in-the-blank questions in the field of education. By generating adversarial samples, the correction model greatly improves its adaptability to diverse answers during the training and reasoning stages, and enhances its fault tolerance and flexibility in complex answering situations. At the same time, the construction and use of the historical answer library enables efficient comparison of answers, thereby improving accuracy while ensuring the speed of correction. In response to the unique fill-in-the-blank question correction needs in the field of education, this application shows significant advantages in handling different forms of answers and reducing correction errors. It not only provides a robust and diverse answer recognition capability for the correction model, but also ensures the flexibility and applicability of the correction model in handling different types of answers in educational scenarios, thereby effectively meeting the dual needs of efficiency and accuracy of correction.
[0149] In summary, in this application, it is determined whether there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library. If there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library, the sample correction results corresponding to the student answers to be corrected are read from the historical answer library. For the same student answer to the same question, there is no need to repeat the reasoning, and the sample correction results are directly read from the historical answer library, which reduces unnecessary reasoning calculations and reduces the resource consumption of repeated reasoning, thereby significantly improving the efficiency of correction. Moreover, for the same student answer to the same question, the sample correction results that have been corrected in the historical answer library are directly used. On the basis that the sample correction results that have been corrected in the historical answer library are relatively accurate, the accuracy of correction can also be improved. When there are no ungraded questions and the corresponding student answers in the historical answer database, the predicted grading results corresponding to the student answers are determined based on the ungraded questions and the corresponding student answers, to ensure that all the student answers corresponding to the ungraded questions can get the grading results, to avoid missing some student answers during grading.
[0150] Exemplary Devices
[0151] Correspondingly, the embodiment of the present application also provides a question correction device, such as Fig.10 As shown, the question correction device includes:
[0152] The judging unit 1001 is used to judge whether there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library; wherein the historical answer library is constructed based on sample data; the sample data includes sample questions, sample student answers corresponding to the sample questions, and sample correction results corresponding to the sample student answers;
[0153] The reading unit 1002 is used to read the sample correction result corresponding to the student answer to be corrected from the historical answer library when there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library;
[0154] The prediction unit 1003 is used to determine the predicted grading result corresponding to the student answer to be graded based on the question to be graded and the student answer to be graded corresponding to the question to be graded, if there is no question to be graded and the student answer to be graded corresponding to the question to be graded in the historical answer library.
[0155] Optionally, the question correction device further includes:
[0156] A first processing unit is used to remove duplicates from each first sample answer result pair corresponding to the sample question in the sample data, and store the first sample answer result pairs together with the sample question in a historical answer library; wherein each first sample answer result pair is a sample answer result pair that does not conflict with each other;
[0157] A second processing unit is used to determine the second sample answer result pair with the highest appearance frequency among the second sample answer result pairs corresponding to the sample questions in the sample data as the target sample answer result pair corresponding to the sample questions; wherein the second sample answer result pairs are sample answer result pairs that conflict with each other;
[0158] A third processing unit is used to store the target sample answer result pair corresponding to the sample question and the sample question in a historical answer library;
[0159] Among them, a sample student answer and a sample correction result corresponding to the sample student answer constitute a sample answer result pair.
[0160] Optionally, the question correction device further includes:
[0161] A confidence determination unit, configured to determine the confidence of the target sample answer result pair corresponding to the sample question based on a first occurrence frequency of the target sample answer result pair corresponding to the sample question in each second sample answer result pair corresponding to the sample question, and a second occurrence frequency of the conflicting sample answer result pair corresponding to the sample question in each second sample answer result pair corresponding to the sample question;
[0162] A confidence storage unit, used to store the confidence of the target sample answer result pair corresponding to the sample question in the historical answer library;
[0163] A confidence reading unit, configured to read the confidence of the answer pair corresponding to the question to be corrected from the historical answer library when there are the question to be corrected and the student answer to be corrected corresponding to the question to be corrected in the historical answer library;
[0164] The conflicting sample answer result pair corresponding to the sample question refers to a sample answer result pair that conflicts with the target sample answer result pair corresponding to the sample question;
[0165] The answer to be corrected and the sample correction result corresponding to the answer to be corrected constitute the answer result pair to be corrected.
[0166] Optionally, the prediction unit 1003 is specifically configured to:
[0167] Inputting the questions to be corrected and the student answers to be corrected corresponding to the questions to be corrected into the correction model to obtain the classification results corresponding to the student answers to be corrected;
[0168] Determine the predicted grading result corresponding to the answer of the student to be graded based on the classification result corresponding to the answer of the student to be graded;
[0169] The grading model is trained based on the sample data and the reference answers corresponding to the sample questions.
[0170] Optionally, the question correction device further includes:
[0171] A generating unit, configured to generate an adversarial sample corresponding to the sample student's answer;
[0172] The training unit is used to train the correction model based on the sample data, the reference answers corresponding to the sample questions, and the adversarial samples corresponding to the sample student answers to obtain a trained correction model.
[0173] Optionally, the training unit comprises:
[0174] A generating subunit, configured to generate a sample pair based on the sample student answer corresponding to the sample question and the reference answer corresponding to the sample question; wherein a sample pair includes a sample student answer and a reference answer corresponding to the same sample question;
[0175] The processing subunit is used to determine the semantic similarity corresponding to each sample pair; wherein the semantic similarity of the sample pair refers to the semantic similarity between the sample student answer and the reference answer in the sample pair;
[0176] A training subunit, configured to train the grading model based on the sample data, the reference answers corresponding to the sample questions, the adversarial samples corresponding to the sample student answers, and the semantic similarities corresponding to the respective sample pairs, to obtain a trained grading model;
[0177] The sample pairs include positive sample pairs and negative sample pairs; the sample student answers in the positive sample pairs are semantically similar to the reference answers, while the sample student answers in the negative sample pairs are semantically dissimilar to the reference answers.
[0178] Optionally, the training subunit is specifically configured to:
[0179] Determine the original sample loss based on the sample data and the reference answers corresponding to the sample questions;
[0180] Determine the adversarial sample loss based on the adversarial sample corresponding to the sample student answer, the reference answer corresponding to the sample question, and the sample correction result corresponding to the sample student answer;
[0181] Determine the semantic contrastive learning loss based on the semantic similarity of each sample pair;
[0182] Determining a total loss based on the original sample loss, the adversarial sample loss, and the semantic contrastive learning loss;
[0183] Based on the total loss, the correction model is trained to obtain a trained correction model.
[0184] Optionally, a sample question corresponds to an independent model weight in the correction model.
[0185] The question correction device provided in this embodiment belongs to the same application concept as the question correction method provided in the above embodiment of this application, and can execute the question correction method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the question correction method. For technical details not fully described in this embodiment, please refer to the specific processing content of the question correction method provided in the above embodiment of this application, and will not be repeated here.
[0186] The functions implemented by the above-mentioned determination unit 1001, reading unit 1002 and prediction unit 1003 may be implemented by the same or different processors respectively, which is not limited in the embodiment of the present application.
[0187] It should be understood that the units in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by the configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the remaining part is implemented in the form of hardware circuits.
[0188] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0189] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0190] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0191] Exemplary Electronic Devices
[0192] An embodiment of the present application provides an electronic device, see Fig.11 As shown, the device includes:
[0193] Memory 200 and processor 210;
[0194] The memory 200 is connected to the processor 210 and is used to store programs;
[0195] The processor 210 is used to implement the question correction method disclosed in any of the above embodiments by running the program stored in the memory 200.
[0196] Specifically, the electronic device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .
[0197] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.
[0198] A bus may include a pathway that transfers information between components of a computer system.
[0199] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0200] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0201] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0202] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0203] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0204] The communication interface 220 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0205] The processor 210 executes the program stored in the memory 200 and calls other devices, which can be used to implement each step of any one of the question correction methods provided in the above embodiments of the present application.
[0206] Exemplary computer program products and storage media
[0207] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the question correction method according to various embodiments of the present application described in any of the above embodiments of this specification.
[0208] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0209] In addition, the embodiment of the present application may also be a storage medium on which a computer program is stored. The computer program is executed by a processor to execute the steps of the question correction method according to various embodiments of the present application described in any of the above embodiments of this specification, and specifically the following steps may be implemented:
[0210] Step 101 , determine whether there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer database, if so, execute step 102 , otherwise, execute step 103 .
[0211] Among them, the historical answer library is constructed based on sample data; the sample data includes sample questions, sample student answers corresponding to the sample questions, and sample correction results corresponding to the sample student answers.
[0212] Step 102, read the sample correction result corresponding to the student answer to be corrected from the historical answer library.
[0213] Step 103: based on the questions to be graded and the student answers to be graded corresponding to the questions to be graded, determine the predicted grading results corresponding to the student answers to be graded.
[0214] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0215] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0216] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0217] The modules and sub-modules in the devices and terminals in the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0218] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, 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 an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0219] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0220] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0221] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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.
[0222] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0223] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0224] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for correcting a question, characterized in that: include: Determine whether there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library; wherein the historical answer library is constructed based on sample data; the sample data includes sample questions, sample student answers corresponding to the sample questions, and sample correction results corresponding to the sample student answers; In the case where there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library, reading sample correction results corresponding to the student answers to be corrected from the historical answer library; When there are no unmarked questions and the corresponding student answers in the historical answer database, a predicted grading result corresponding to the student answers is determined based on the unmarked questions and the corresponding student answers.
2. The method for correcting questions according to claim 1, characterized in that: The method further comprises: After removing duplicates from each first sample answer result pair corresponding to the sample question in the sample data, the first sample answer result pairs are stored in a historical answer library together with the sample question; wherein each first sample answer result pair is a sample answer result pair that does not conflict with each other; Determine the second sample answer result pair with the highest occurrence frequency among the second sample answer result pairs corresponding to the sample questions in the sample data as the target sample answer result pair corresponding to the sample questions; wherein the second sample answer result pairs are sample answer result pairs that conflict with each other; The target sample answer result pair corresponding to the sample question and the sample question are stored in the historical answer database; Among them, a sample student answer and a sample correction result corresponding to the sample student answer constitute a sample answer result pair.
3. The question correction method according to claim 2, characterized in that: The method further comprises: Determine the confidence of the target sample answer result pair corresponding to the sample question based on a first occurrence frequency of the target sample answer result pair corresponding to the sample question in each second sample answer result pair corresponding to the sample question, and a second occurrence frequency of the conflicting sample answer result pair corresponding to the sample question in each second sample answer result pair corresponding to the sample question; The confidence of the target sample answer result pair corresponding to the sample question is stored in the historical answer library; When there are unmarked questions and unmarked student answers corresponding to the unmarked questions in the historical answer library, read the confidence of the unmarked answer result pair corresponding to the unmarked questions from the historical answer library; The conflicting sample answer result pair corresponding to the sample question refers to a sample answer result pair that conflicts with the target sample answer result pair corresponding to the sample question; The answer to be corrected and the sample correction result corresponding to the answer to be corrected constitute the answer result pair to be corrected.
4. The question correction method according to claim 1, characterized in that: The step of determining the predicted grading result corresponding to the student answer to be graded based on the question to be graded and the student answer to be graded corresponding to the question to be graded includes: Inputting the questions to be corrected and the student answers to be corrected corresponding to the questions to be corrected into the correction model to obtain the classification results corresponding to the student answers to be corrected; Determine the predicted grading result corresponding to the answer of the student to be graded based on the classification result corresponding to the answer of the student to be graded; The grading model is trained based on the sample data and the reference answers corresponding to the sample questions.
5. The question correction method according to claim 4, characterized in that: The method further comprises: Generate an adversarial sample corresponding to the sample student answer; Based on the sample data, the reference answers corresponding to the sample questions, and the adversarial samples corresponding to the sample student answers, the correction model is trained to obtain a trained correction model.
6. The method for correcting questions according to claim 5, characterized in that: The step of training the grading model based on the sample data, the reference answers corresponding to the sample questions, and the adversarial samples corresponding to the sample student answers to obtain the trained grading model includes: Generate a sample pair based on the sample student answer corresponding to the sample question and the reference answer corresponding to the sample question; wherein a sample pair includes a sample student answer and a reference answer corresponding to the same sample question; Determine the semantic similarity corresponding to each sample pair; wherein the semantic similarity of the sample pair refers to the semantic similarity between the sample student answer and the reference answer in the sample pair; Based on the sample data, the reference answers corresponding to the sample questions, the adversarial samples corresponding to the sample student answers, and the semantic similarities corresponding to the respective sample pairs, the correction model is trained to obtain a trained correction model; The sample pairs include positive sample pairs and negative sample pairs; the sample student answers in the positive sample pairs are semantically similar to the reference answers, while the sample student answers in the negative sample pairs are semantically dissimilar to the reference answers.
7. The question correction method according to claim 6, characterized in that: The step of training the correction model based on the sample data, the reference answers corresponding to the sample questions, the adversarial samples corresponding to the sample student answers, and the semantic similarities corresponding to the respective sample pairs to obtain the trained correction model includes: Determine the original sample loss based on the sample data and the reference answers corresponding to the sample questions; Determine the adversarial sample loss based on the adversarial sample corresponding to the sample student answer, the reference answer corresponding to the sample question, and the sample correction result corresponding to the sample student answer; Determine the semantic contrastive learning loss based on the semantic similarity of each sample pair; Determining a total loss based on the original sample loss, the adversarial sample loss, and the semantic contrastive learning loss; Based on the total loss, the correction model is trained to obtain a trained correction model.
8. The method for correcting questions according to any one of claims 4 to 7, characterized in that: A sample question corresponds to an independent model weight in the correction model.
9. A question correction device, characterized in that: include: A judgment unit, used to judge whether there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library; wherein the historical answer library is constructed based on sample data; the sample data includes sample questions, sample student answers corresponding to the sample questions, and sample correction results corresponding to the sample student answers; A reading unit, configured to read a sample correction result corresponding to the student answer to be corrected from the historical answer library when there are questions to be corrected and student answers to be corrected corresponding to the questions to be corrected in the historical answer library; The prediction unit is used to determine the predicted grading result corresponding to the student answer to be corrected based on the question to be corrected and the student answer to be corrected corresponding to the question to be corrected, if there is no question to be corrected and the student answer to be corrected corresponding to the question to be corrected in the historical answer library.
10. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the question correction method as described in any one of claims 1 to 8 by running the program in the memory.
11. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the method for correcting questions according to any one of claims 1 to 8 is implemented.
12. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, enable the processor to execute the question correction method according to any one of claims 1 to 8.