Title correction method, model training method, computer device and storage medium
By aligning and integrating the feature vectors of student answers and standard answers, and utilizing subject knowledge graphs and self-attention mechanism models, the problem of low accuracy in question grading in existing technologies is solved. This achieves more efficient integration of subject knowledge and evaluation of solution steps, thereby improving grading accuracy.
Patent Information
- Application Number
- CN202111674151.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing text classification technologies have poor accuracy in question grading tasks, are difficult to adapt to the asymmetry in semantic information between student answers and standard answers, cannot effectively combine subject knowledge for grading, and lack fine-grained evaluation of student answer steps.
By aligning and integrating the feature vectors of student answers and standard answers, and utilizing subject knowledge graphs and self-attention mechanism models, the feature vectors of questions are integrated with the information of solution steps to generate fine-grained grading results.
It improves the accuracy of question grading, better integrates subject knowledge and solution steps, provides fine-grained evaluation of student answers, and enhances grading efficiency and accuracy.
Smart Images

Figure CN114328931B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and particularly relates to a question correction method, a model training method, a computer device and a storage medium. BACKGROUND
[0002] Natural language processing is a branch of artificial intelligence and linguistics, mainly studying various theories and methods of how computers understand and process human natural language. At present, natural language processing technology has been widely applied to various aspects of daily life, such as text classification, speech recognition, machine translation, etc. Among them, the text classification technology is the process of assigning the input text to a predefined label, in which the label categories to be assigned are different in different tasks; in the question correction task, the model needs to judge whether the student's answer is correct or directly predict the correction score of the student's answer according to the question and the standard answer, and the difference between the two is not big on the model side.
[0003] The existing technology that can be applied to the question correction task mainly includes the text classification technology. The text classification task is the process of assigning the input text to a predefined label. The goal of this technology in the current task scenario is to judge the matching degree between the input student answer and the standard answer based on the context of the current question and knowledge points, and finally obtain a probability value of 0 to 1, which can then be divided into two categories according to the probability threshold: correct or incorrect; or directly express the normalized correction score of the student's answer in the question as a probability value of 0 to 1. However, the existing text classification technology cannot well adapt to the question correction task, and the accuracy is poor. SUMMARY
[0004] The embodiments of the present application provide a question correction method, a model training method, a computer device and a storage medium, which can improve the accuracy of question correction.
[0005] In a first aspect, the present application provides a question correction method, which comprises:
[0006] obtaining a question text, a standard answer text and a student answer text;
[0007] encoding the question text, the standard answer text and the student answer text respectively to obtain a question feature vector, a standard answer feature vector and a student answer feature vector;
[0008] aligning and fusing the question feature vector and the standard answer feature vector to obtain a first fusion vector;
[0009] aligning and fusing the question feature vector and the student answer feature vector to obtain a second fusion vector;
[0010] aligning and fusing the first fusion vector and the second fusion vector to obtain a third fusion vector;
[0011] generating a correction result of the student answer text according to the third fusion vector.
[0012] In a second aspect, the present application provides a training method of a question correction model, comprising:
[0013] obtaining a question text, a standard answer text and a student answer text, and a labeled correction result corresponding to the student answer text;
[0014] encoding the question text, the standard answer text and the student answer text respectively based on an encoding model of the question correction model to obtain a question feature vector, a standard answer feature vector and a student answer feature vector;
[0015] aligning and fusing the question feature vector and the standard answer feature vector and the student answer feature vector based on a self-attention mechanism model of the question correction model to obtain a third fusion vector;
[0016] generating a correction result of the student answer text according to the third fusion vector based on a correction model of the question correction model;
[0017] adjusting model parameters of the question correction model according to the generated correction result corresponding to the student answer text and the labeled correction result.
[0018] In a third aspect, the present application provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and realize the steps of the above question correction method when executing the computer program.
[0019] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and if the computer program is executed by a processor, the steps of the above question correction method are realized.
[0020] The application discloses a question correction method, a model training method, a computer device and a storage medium, wherein the correction method comprises the following steps: obtaining a question text, a standard answer text and a student answer text; encoding the question text, the standard answer text and the student answer text respectively to obtain a question feature vector, a standard answer feature vector and a student answer feature vector; performing alignment fusion processing on the question feature vector and the standard answer feature vector to obtain a first fusion vector; performing alignment fusion processing on the question feature vector and the student answer feature vector to obtain a second fusion vector; performing alignment fusion on the first fusion vector and the second fusion vector to obtain a third fusion vector; and generating a correction result of the student answer text according to the third fusion vector; and performing alignment fusion on the information of the student answer text and the information of the standard answer text, so that the alignment fusion result can better indicate which student answer steps need to be compared with which steps in the standard answer, thereby improving the accuracy of question correction. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0022] Figure 1 The flowchart of the question correction method of an embodiment of the application;
[0023] Figure 2 The schematic diagram of the application scene of the question correction method in an implementation mode;
[0024] Figure 3 The schematic diagram of the question correction in an implementation mode;
[0025] Figure 4 The flowchart of the training method of the question correction model of another embodiment of the application;
[0026] Figure 5 The structural schematic diagram of a computer device provided by an embodiment of the application. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the application will be described clearly and completely in the following with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are some embodiments of the application, but not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the application.
[0028] The flowchart shown in the drawing is only an example and does not necessarily include all contents and operations / steps, nor does it necessarily need to be executed in the order described. For example, some operations / steps can also be decomposed, combined, or partially merged, so the actual execution order can be changed according to actual conditions.
[0029] Embodiments of the present application provide a question grading method, a model training method, a computer device, and a storage medium. The question grading method is used to determine a grading result of a student answer text according to a question text, a standard answer text, and the student answer text, and the grading result includes, for example, a score of the student answer text. The embodiments of the present application mainly take the question text, the standard answer text, and the student answer text as examples of texts of a calculation question (such as a physics calculation question), but are not limited to calculation questions.
[0030] The question grading task has at least one of the following characteristics relative to a general natural language processing task: 1) a large number of formulas and numerical values are contained in the text; 2) the grading task needs more semantic reasoning processes in addition to the similarity of the text string level; 3) a large amount of subject background knowledge needs to be combined when performing the grading task; and 4) in the question grading task scenario, the information amount of the two texts (the standard answer and the student answer) to be compared is not equal, because the student answer text is very divergent, for example, some students fill in a lot of processes or formulas when they cannot answer, in the hope of obtaining some process points, and some students directly fill in less or nothing.
[0031] The existing technology that can be applied to the physics question grading task mainly includes a text classification technology. The text classification technology mainly includes the following three methods: 1) a rule-based method; 2) a traditional classification algorithm based on statistics; and 3) a deep learning technology based on distributed representation. Among them, the traditional text classification model based on statistics includes a Naive Bayes (NB) model, a K-Nearest Neighbor (KNN) model, a Random Forest (RF) model, and a Support Vector Machine (SVM) model. Although these statistical models have significant advantages in accuracy and stability compared with early rule models, they still need to manually design features, which consumes a lot of manpower and time. With the development of deep learning technology and large-scale pre-training model technology, such as a BERT (Bidirectional Encoder Representation from Transformers) model and a GPT (Generative Pre-Training) model, the current text classification method mainly fine-tunes the pre-trained language model. In addition, some methods use the knowledge of a knowledge graph to help the model learn the background knowledge of the text, and help the model understand and classify the text.
[0032] The inventors of the present application found that, based on the characteristics of the subject correction task relative to general natural language processing tasks, if existing text classification techniques are used, at least one of the following problems will occur: first, there is an imbalance in the amount of semantic information between student answers and standard answers; if existing text classification techniques are used, directly modeling the semantic similarity between student answers and standard answers will make it difficult for the model to align the semantic information of the two; this problem is due to the divergent nature of student answers. Some students write very detailed steps, processes, and explanations when answering, while others write more concisely. Some students list a large number of physical theorems, formulas, etc. when answering, while some students write very little or nothing when encountering a question they do not know. Second, a general knowledge graph cannot be applied to the correction task. In the physics question correction task, both the question and the answer contain a large amount of subject knowledge, such as proper nouns, units, formulas, etc. A general knowledge graph can help the model better understand the semantics of the text, but it is not suitable for existing text classification techniques. Third, existing text classification techniques are difficult to learn the ability to correct the steps in the student's answer based on only the annotation of the overall question correction score. In the physics question correction task, not only is the final answer score needed, but the answer steps in the student's answer also need to be referenced. This score is called the step score. Teachers will combine the steps and the final answer to give the final overall question score. Although if the teacher's correction score for each step in the student's answer is available, existing classification techniques can also be used to correct each step in the student's answer, but obtaining such labeled data is extremely time-consuming and labor-intensive.
[0033] Based on this, the inventors of the present application improve the subject correction method. The subject correction method aligns and fuses the information of the student answer text with the information of the standard answer text, so that the accuracy of the subject correction method is higher.
[0034] Please refer to Figure 1 , Figure 1 is a flowchart of a subject correction method provided by an embodiment of the present application.
[0035] The subject correction method provided by the embodiments of the present application can be applied in a terminal or a server. The terminal can be a learning machine, a mobile phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, etc. The server can be an independent server or a server cluster. However, for ease of understanding, the following embodiments will be described in detail with respect to the method applied in the server.
[0036] In some embodiments, as Figure 2As shown, the server obtains the question text, the standard answer text and the student answer text from the terminal, generates the correction result of the student answer text according to the question correction method, and sends the correction result to the terminal.
[0037] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The following examples and features in the examples can be combined with each other without conflict.
[0038] As shown in the question correction method includes the following steps S110 to S160. Figure 1
[0039] Step S110, obtaining the question text, the standard answer text and the student answer text.
[0040] In some optional embodiments, the question text, the standard answer text and the student answer text are texts stored locally by a device for implementing the question correction method, texts obtained by the device from a network, texts obtained by the device from an input device connected thereto, texts obtained by the device from other electronic devices, texts converted from images by the device, etc.
[0041] For example, the question text, the standard answer text and the student answer text can be directly inputted texts, or can be question images obtained by scanning or photographing, etc., and recognized by using OCR technology, which is not limited in the embodiments of the present application.
[0042] Step S120, encoding the question text, the standard answer text and the student answer text respectively to obtain the question feature vector, the standard answer feature vector and the student answer feature vector.
[0043] In some embodiments, the question text, the standard answer text and the student answer text can be encoded respectively based on an encoding model of the question correction model to obtain the question feature vector, the standard answer feature vector and the student answer feature vector. For example, given a student answer and corresponding question and standard answer texts, the encoding model includes an encoder such as a Transformer (self-attention network) encoder to encode these texts into corresponding feature vectors.
[0044] In some embodiments, the question text is encoded in step S120 to obtain the question feature vector, including the following steps S121 to S122.
[0045] Step S121, encoding each word in the question text to obtain a word encoding vector.
[0046] Exemplarily, the encoder encodes each word in the question text to obtain a word encoding vector, which can be represented using P = [p1, p2,..., pL], where L represents the number of words contained in the question text, pi represents the vector representation of the i-th word in the word encoding vector, pi ∈ Rd, and d represents the dimension of the vector representation. L ], where L represents the number of words contained in the question text, pi represents the vector representation of the i-th word in the word encoding vector, pi ∈ Rd, and d represents the dimension of the vector representation. i ], where L represents the number of words contained in the question text, pi represents the vector representation of the i-th word in the word encoding vector, pi ∈ Rd, and d represents the dimension of the vector representation. i d
[0047] In step S122, based on the preset subject knowledge graph, the question feature vector corresponding to the question text is determined according to the word encoding vector.
[0048] Exemplarily, the question feature vector includes knowledge point feature vectors corresponding to several knowledge points in the question text. The subject knowledge graph includes a plurality of triples (h, r, t), where h is a head entity, t is a tail entity, and r is a relationship between the head entity and the tail entity. Exemplarily, the head entity and the tail entity are selected from one or both of the question keywords and the knowledge points. By determining the question feature vector corresponding to the question text based on the subject knowledge graph, the knowledge point information corresponding to the question in the subject knowledge graph can be integrated into the question correction, thereby improving the accuracy of the correction.
[0049] Exemplarily, the subject knowledge graph is a tree structure, which can indicate the hierarchical structure of the knowledge system itself, such as: mechanics >> work and energy >> kinetic energy and kinetic energy theorem; mechanics >> work and energy >> law of conservation of mechanical energy. For node encoding of the subject knowledge graph, an unsupervised algorithm can be used: 1) mask some nodes; 2) predict nodes of different levels and / or same level as the mask nodes for training; for different knowledge points, the encoding information of the formulas and texts related to the knowledge points can also be added.
[0050] In some embodiments, the question feature vector is obtained by extracting, from the subject knowledge graph, knowledge point feature vectors corresponding to knowledge points related to the question according to the word encoding vector. The question feature vector can be represented as G = [g1, g2,..., gk], where k represents the number of knowledge points related to the question. k
[0051] Exemplarily, a question with labeled knowledge points can be obtained, and a classifier can be trained according to the question with labeled knowledge points. The classifier can be used to classify the word encoding vector of the question text to obtain the question feature vector corresponding to the question text.
[0052] For example, the graph encoding module of the encoding model can be used to determine the question feature vector corresponding to the question text based on the word encoding vector; it can be understood that the encoding model encodes the knowledge points involved in the question into feature vectors in a graph encoding manner based on a preset subject knowledge graph.
[0053] The model takes a student's answer, along with the corresponding question and standard answer text, as input. It uses graph coding and hierarchical coding to encode the knowledge points involved in the question and the input text information into feature vectors.
[0054] In some implementations, the standard answer feature vector includes the first step vector of each step in the standard answer text; the student answer feature vector includes the second step vector of each step in the student answer text.
[0055] For example, for the standard answer, each solution step is encoded to obtain a first step vector for each solution step, and the feature vector of the standard answer is determined based on the first step vectors of all solution steps. For the student's answer, each solution step is encoded to obtain a second step vector for each solution step, and the feature vector of the student's answer is determined based on the second step vectors of all solution steps.
[0056] For example, the standard answer and the student's answer steps can be determined based on preset step identification rules; for example, the answer steps can be determined based on line breaks and / or semicolons, but it is not limited to this.
[0057] For example, the standard answer and the student's solution steps are separated by special symbols, such as [CLS], and input into an encoder for encoding. Each solution step of the standard answer and the student's answer is encoded separately, resulting in a step vector representing the feature representation of each step. For instance, the feature vector of the standard answer is represented as S = [s1, s2, ..., s...]. n ], where n represents the number of steps in the standard answer, s i The step vector represents the i-th step of the standard answer; the student's answer feature vector is represented as U = [u1, u2, ..., u...]. m ], where m represents the number of steps in the student's solution, u i This represents the step vector for the student's answer to the i-th step.
[0058] For example, using the same encoder to encode the answer steps of the standard answer and the answer steps of the student answer respectively can improve the consistency of the same vector representation in the standard answer feature vector and the student answer feature vector, and improve the correction accuracy. Optionally, the encoder used to encode each word in the question text is also the same as the encoder used to encode the standard answer and the student answer.
[0059] In actual scenarios, the number of answer steps of the standard answer and the number of answer steps of the student answer are different, and the text expression in the student answer is more divergent than the standard answer. How to align the steps of the student answer with the steps in the standard answer and learn the different equivalent semantic expressions is the core difficulty of the entire question correction task. The embodiment of the present application can at least align the steps of the student answer with the steps in the standard answer through steps S130 to S150.
[0060] Step S130, aligning and fusing the question feature vector and the standard answer feature vector to obtain a first fusion vector.
[0061] For example, the knowledge point feature vector corresponding to the question text is aligned and fused with the answer steps in the standard answer, the knowledge point information is integrated into different answer steps, and the first step vector of the fusion knowledge point information of the standard answer step is obtained.
[0062] Step S140, aligning and fusing the question feature vector and the student answer feature vector to obtain a second fusion vector.
[0063] For example, the knowledge point feature vector corresponding to the question text is aligned and fused with the answer steps in the student answer, the knowledge point information is integrated into different answer steps, and the second step vector of the fusion knowledge point information of the student answer step is obtained.
[0064] By fusing the knowledge point information involved in the question with the step information in the standard answer and the student answer, the model can combine related knowledge point information when correcting, improving the accuracy of correction.
[0065] Since in actual task scenarios, the calculation question will involve comprehensive questions of multiple knowledge points to be examined, and will be scattered in different sub-questions. In the standard answer text and the student answer text, different steps involve different knowledge points. Aligning and fusing the knowledge points involved in the question with the answer steps in the standard answer and the student answer can better integrate the information of the subject knowledge points; not only can the subject knowledge be more finely integrated to correct the steps of the student answer, but also the steps in the student answer can be preliminarily screened based on the knowledge points designed by the question, filtering some redundant or unimportant information, and improving the correction efficiency.
[0066] In some embodiments, the aligning and fusing the question feature vector and the standard answer feature vector comprises: inputting the question feature vector as a query item and the standard answer feature vector as a key-value pair into an attention mechanism model to obtain a first fused vector.
[0067] For example, the attention mechanism model can also be referred to as a knowledge point alignment module, which is used for aligning and fusing the question feature vector and / or the student answer feature vector. The question feature vector G or the knowledge point feature vector in the question feature vector G is taken as a query item (Query), and the standard answer feature vector S is taken as a key-value pair (Key-Value pair) input into the attention mechanism model. The specific feature fusion process can be represented as:
[0068]
[0069] wherein f S represents the first fused vector, matrix W Q , W K , W V are model parameters, W Q is used to convert the question feature vector G to a query space to obtain an expression Q, W K is used to convert the standard answer feature vector S to a key space to obtain an expression K, and W V is used to convert the standard answer feature vector S to a value space to obtain an expression V; after obtaining the expressions Q, K, and V of the input information in different spaces, the matching scores of the knowledge points involved in the question on each step of the standard answer can be calculated by, for example, a dot product operation; the matching scores are normalized by using a softmax to obtain the attention distribution of the knowledge points involved in the question on each step of the standard answer, which is used to indicate the attention degree of the attention mechanism model on each step of the standard answer at the current step, or can be referred to as an attention weight; the step vectors in the standard answer feature vector S are weighted and summed according to the attention distribution on each step to obtain the feature vector of the standard answer after the knowledge point alignment and fusion, i.e., the first fused vector f S .
[0070] For example, the aligning and fusing the question feature vector and the student answer feature vector to obtain a second fused vector comprises: inputting the question feature vector as a query item and the student answer feature vector as a key-value pair into an attention mechanism model to obtain a second fused vector.
[0071] Optionally, the principle and steps of the alignment fusion processing of the question feature vector and the student answer feature vector are the same as the principle and steps of the alignment fusion processing of the question feature vector and the standard answer feature vector, and will not be repeated here. For example, the subject knowledge point information and the student answer information are taken as the query item and the key value pair respectively, and the knowledge point alignment and fusion are performed to obtain the feature vector of the student answer, i.e., the second fusion vector f U .
[0072] For example, taking the information of the subject knowledge point as the query item, not only the subject background knowledge can be supplemented for the standard answer and the student answer, but also some non-key answer steps can be filtered and screened out, so that the model can focus on the key answer steps when correcting. It should be pointed out that, since the calculation question belongs to a comprehensive question, multiple knowledge points are involved in the examination, and different steps apply different knowledge points in the whole solving process, so when the knowledge points are fused, the information of the knowledge points can be used more finely by being refined to different answer steps.
[0073] In step S150, the first fusion vector and the second fusion vector are aligned and fused to obtain a third fusion vector.
[0074] The feature vectors of the steps in the fused knowledge point standard answer and the student answer are aligned and fused to obtain a third fusion vector T, which can be used as the final correction feature vector.
[0075] As described above, in the actual correction task scenario, the student's answer text is extremely divergent, and the information amount is different from that of the standard answer; therefore, in the question correction task, not only the matching degree of the text semantics needs to be judged, but also it is necessary to determine which texts in the student answer and the standard answer need to be matched, that is, the information alignment process is needed, and this is also the biggest difference between the question correction task and the general text classification or regression task; by aligning the steps in the student answer with the steps in the standard answer, the model is guided to determine which student answer steps need to be compared with which steps in the standard answer, so as to improve the accuracy of the correction.
[0076] In some embodiments, the alignment and fusion of the first fusion vector and the second fusion vector to obtain a third fusion vector includes: taking the first fusion vector as a query item and the second fusion vector as a key value pair to input a self-attention mechanism model to obtain a third fusion vector.
[0077] Each answer step in the standard answer or the student answer is encoded into a feature vector, i.e., a step vector, to obtain a standard answer feature vector S=[s1,s2,...,s n] and the student answer feature vector U = [u1, u2,..., u m ], and after fusing the knowledge point information, a first fusion vector f S and a second fusion vector f U are obtained respectively. For example, the embodiment of the present application designs a self-attention mechanism model for fusing information of the first fusion vector f S and the second fusion vector f U , takes the first fusion vector f S as a query, and takes the second fusion vector f U as a key-value pair, and performs alignment fusion based on the self-attention mechanism model. The specific steps of alignment and feature fusion can be represented as follows:
[0078]
[0079] wherein W Q is used to convert the first fusion vector f S to a query space to obtain an expression Q, W K is used to convert the second fusion vector f U to a key space to obtain an expression K, and W V is used to convert the second fusion vector f U to a value space to obtain an expression V. After obtaining the expressions Q, K and V of the input information in different spaces, the matching score of the standard answer step on the student answer steps can be calculated by, for example, a dot product operation. The matching score is normalized by using softmax to obtain the attention distribution of the standard answer step on the student answer steps. The attention distribution is used to indicate the degree of attention of the self-attention mechanism model on the student answer steps at the current step, or can be called an attention weight. According to the attention distribution on each step, the step vectors in the second fusion vector f U that fuse the knowledge point information are weighted and summed to obtain the third fusion vector T.
[0080] The standard answer step feature that fuses the subject knowledge points, i.e., the first fusion vector f s , can extract and align the key answer steps from the student answer that contains redundant information or lacks information, and can grade the student answer steps in combination with specific knowledge point information. In this way, the model can more finely evaluate the differences between the student answer and the standard answer.
[0081] In some embodiments, the self-attention mechanism models used to obtain the first fusion vector, the second fusion vector, and the third fusion vector can be the same or different, or two of them are the same and the other one is different. For example, the self-attention mechanism models used to obtain the first fusion vector and the second fusion vector are the same, and different from the self-attention mechanism model used to obtain the third fusion vector. When the self-attention mechanism models are the same, the model size and the amount of calculation can be reduced, and when the self-attention mechanism models are different, the accuracy can be improved.
[0082] In step S160, the correction result of the student answer text is generated according to the third fusion vector.
[0083] In some embodiments, the correction result of the student answer text is generated according to the third fusion vector based on the correction model of the question correction model.
[0084] For example, the third fusion vector T is input into the correction model as the final correction feature vector, and the correction model can be a regression module for generating a correction score. For example, the third fusion vector T passes through a fully connected network and a Sigmoid activation function to obtain a probability value between 0 and 1, which can be used as a normalized correction score representing the student answer. For example, the probability value is multiplied by the full score of the question, such as 10 points, to obtain the correction score of the student answer text.
[0085] For example, the main task of the question correction model in the embodiments of the present application is to output the correction score of the student answer by the model, and the correction score is normalized to [0, 1], that is, the model needs to perform regression prediction on the score of the student answer. In the above steps, the feature vector fused from the student answer and the standard answer, i.e., the third fusion vector T, can be obtained. In the main task, the third fusion vector T is input into a fully connected network and then activated by a Sigmoid function to obtain the score value predicted by the model, which can be represented as follows:
[0086] score = Sigmoid(FNN(T))
[0087] In some embodiments, in addition to scoring the student answer, some intermediate results in the model can be extracted to better serve downstream tasks.
[0088] Exemplarily, when the self-attention mechanism model performs alignment fusion processing on the question feature vector and the standard answer feature vector, the self-attention mechanism model determines first attention weights corresponding to the knowledge points in the question text and the steps in the standard answer text, and performs weighted summation on the standard answer feature vector according to the first attention weights to obtain the first fusion vector. When the self-attention mechanism model performs alignment fusion processing on the question feature vector and the student answer feature vector, the self-attention mechanism model determines second attention weights corresponding to the knowledge points in the question text and the steps in the student answer text, and performs weighted summation on the student answer feature vector according to the second attention weights to obtain the second fusion vector. The self-attention mechanism model performs alignment fusion processing on the first fusion vector and the second fusion vector, determines third attention weights corresponding to the steps in the standard answer text and the steps in the student answer text, and performs weighted summation on the second fusion vector according to the third attention weights to obtain the third fusion vector.
[0089] When performing alignment fusion processing on the question feature vector and the standard answer feature vector, the first attention weights of the model can be used to determine the alignment information between the knowledge points and the steps in the standard answer; when performing alignment fusion processing on the question feature vector and the student answer feature vector, the second attention weights of the model can be used to determine the alignment information between the knowledge points and the steps in the student answer; when performing alignment fusion processing on the first fusion vector and the second fusion vector, the third attention weights of the model can be used to determine the alignment relationship between each step in the standard answer and the steps in the student answer.
[0090] Exemplarily, the method further comprises at least one of the following: determining the knowledge points corresponding to the steps in the standard answer text according to the first attention weights; determining the knowledge points corresponding to the steps in the student answer text according to the second attention weights; and determining the corresponding relationship between the steps in the standard answer text and / or the steps in the student answer text according to the third attention weights.
[0091] Optionally, according to at least one of the first attention weights, the second attention weights, and the third attention weights, the following downstream tasks can be performed: 1) the knowledge points that may correspond to the steps in the student answer can be displayed; 2) the standard answer steps corresponding to each answer step when the model corrects the student answer can be displayed in detail. Exemplarily, the association between the answer steps and the knowledge points, and the association between the answer steps and the standard answer steps can be used to assist in locating which student answer steps are more critical.
[0092] The subject correction method provided in the embodiments of the present application comprises: obtaining a subject text, a standard answer text and a student answer text; encoding the subject text, the standard answer text and the student answer text respectively to obtain a subject feature vector, a standard answer feature vector and a student answer feature vector; performing alignment fusion processing on the subject feature vector and the standard answer feature vector to obtain a first fusion vector; performing alignment fusion processing on the subject feature vector and the student answer feature vector to obtain a second fusion vector; performing alignment fusion on the first fusion vector and the second fusion vector to obtain a third fusion vector; generating a correction result of the student answer text according to the third fusion vector; and performing alignment fusion on the subject feature vector and the standard answer feature vector and the student answer feature vector, and performing alignment fusion on the information of the student answer text obtained by alignment and the information of the standard answer text, so that the result of alignment fusion can better indicate which student answer steps need to be compared with which steps in the standard answer, thereby improving the accuracy of subject correction.
[0093] In some embodiments, the subject correction method can be referred to as a fine-grained subject correction method based on a subject knowledge graph.
[0094] In some embodiments, as shown in Figure 3 , the first step is to input the subject text, the standard answer text and the student answer text into a word encoder respectively to obtain the feature vector of the subject and the feature vector of each step of the answer process in the standard answer and the student answer; the second step is to perform alignment fusion on the knowledge point feature vector corresponding to the subject and the answer steps in the standard answer to integrate the knowledge point information into different answer steps to obtain the step feature vector of the standard answer after fusion of the knowledge points; the third step is to perform alignment fusion on the step feature vector of the student answer and the step of the standard answer after fusion of the knowledge points to obtain the final correction feature vector; and the fourth step is to input the final correction feature vector into a regression module based on the correction score (main task) to obtain the correction score corresponding to the student answer text.
[0095] Please refer to Figure 4 , the embodiments of the present application also provide a training method of a subject correction model. As shown in Figure 4 , the subject correction model comprises an encoding model, a self-attention mechanism model and a correction model.
[0096] As shown in Figure 4 , the training method of the subject correction model comprises steps S210 to S250.
[0097] Step S210, obtaining a subject text, a standard answer text and a student answer text, and a labeled correction result corresponding to the student answer text;
[0098] Step S220, based on the encoding model of the question grading model, encoding the question text, the standard answer text and the student answer text respectively to obtain a question feature vector, a standard answer feature vector and a student answer feature vector;
[0099] Step S230, based on the self-attention mechanism model of the question grading model, performing alignment fusion processing on the question feature vector and the standard answer feature vector and the student answer feature vector to obtain a third fusion vector.
[0100] In some embodiments, step S230 includes: based on the self-attention mechanism model of the question grading model, performing alignment fusion processing on the question feature vector and the standard answer feature vector to obtain a first fusion vector; based on the self-attention mechanism model of the question grading model, performing alignment fusion processing on the question feature vector and the student answer feature vector to obtain a second fusion vector; based on the self-attention mechanism model of the question grading model, performing alignment fusion on the first fusion vector and the second fusion vector to obtain a third fusion vector.
[0101] Step S240, based on the grading model of the question grading model, generating a grading result of the student answer text according to the third fusion vector;
[0102] Step S250, adjusting the model parameters of the question grading model according to the generated grading result corresponding to the student answer text and the labeled grading result.
[0103] For example, based on a preset loss function, determining a model loss value according to the generated grading result corresponding to the student answer text and the labeled grading result, and adjusting the model parameters of the question grading model according to the model loss value, so that the question grading model can accurately grade the question.
[0104] In actual task scenarios, since there is no correct or incorrect annotation data between each step of the student answer and the standard answer, only the score of the entire question, if the above method steps are directly trained, for student answers with similar scores but inconsistent answer steps, the model is difficult to accurately learn the alignment and grading relationship between the answer steps and the standard answer steps.
[0105] For example, there are two student answers with similar scores, one of which is wrong in the first sub-question and the other is wrong in the second sub-question. Since the model only compares the student answer and the standard answer and whether their scores are consistent, the model cannot distinguish between the above two student answers.
[0106] In some embodiments, the training method further comprises: determining first correction result differences between different student answer texts according to the labeled correction results corresponding to the different student answer texts; generating second correction result differences between the different student answer texts according to the third fusion vectors corresponding to the different student answer texts; and adjusting model parameters of the question correction model according to the first correction result differences and the second correction result differences.
[0107] Please refer to Figure 3 The question correction model is a multi-task model, including a correction score regression task, i.e., outputting a correction score of the student answer by the model, and a correction score difference regression task. The correction score difference regression task is used to generate second correction result differences between different student answer texts according to third fusion vectors corresponding to the different student answer texts.
[0108] The correction score difference regression task can be used as an auxiliary task to help the model compare different student answer texts. For example, in the training sample, a certain question contains M student answers, and a data set of score differences between each two of the M student answers is constructed (A i ,A j , sub_score), where A i represents the i-th student answer text, A j represents the j-th student answer text, and sub_score represents the first correction result difference between the two student answer texts.
[0109] When the model performs the correction score regression task, the final third fusion vectors T1, T2,..., T M corresponding to the M student answers can be obtained; and the process of generating the second correction result differences between the different student answer texts according to the third fusion vectors corresponding to the different student answer texts can be represented as:
[0110] T′=[T i ,T j ]
[0111] sub_score=Sigmoid(FNN(T'))
[0112] The vector T' obtained by splicing the third fusion vector T i of the i-th student answer text and the third fusion vector T j of the j-th student answer text is input into a fully connected network, and then a regression prediction value of the difference between the two correction scores, i.e., the second correction result difference, is output through a Sigmoid activation function.
[0113] Optionally, when constructing the data set and splicing the feature vectors, the vectors with lower score values are spliced after the vectors with higher score values, so that the second batch of correction result difference values are between 0 and 1.
[0114] When correcting, the teacher scores each answer step in the student's answer, and finally gives the correction score of the whole question by combining all the steps. Since only the correction score label of the whole question is in the data, in order to enable the model to consider each answer step and learn the semantic differences between different students when correcting, an auxiliary task is used in the model in the embodiment of the application to help the model better correct the student's answer according to the key answer steps by learning the score difference between different student answers. By learning the differences between student answer samples with similar scores but inconsistent steps and mistakes, the model can perform fine-grained (step) correction.
[0115] After obtaining the final correction feature vector of different student answers to the same question, i.e., the third fusion vector, the feature vectors of two pairs (T i ,T j ) are input into the fully connected network of the correction difference regression task to predict the correction score difference between the two different student answers. According to the predicted correction score difference and the labeled correction score difference, the model is trained to better align and correct the standard answer and the student answer.
[0116] Exemplarily, the final correction feature vector is input into the regression module based on the correction score (main task) and the regression model based on the correction difference (auxiliary task), and then the encoding model, the self-attention mechanism model, and the correction model in the question correction model are jointly trained based on the two.
[0117] The method of the application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0118] Exemplarily, the above method can be implemented in the form of a computer program, which can run on a computer device as shown in Figure 5 .
[0119] Please refer to Figure 5 , Figure 5is a structural schematic diagram of a computer device provided by an embodiment of the present application. The computer device can be a server or a terminal.
[0120] Referring to Figure 5 The computer device comprises a processor, a memory and a network interface connected through a system bus, wherein the memory can comprise a non-volatile storage medium and an internal memory.
[0121] The non-volatile storage medium can store an operating system and a computer program. The computer program comprises program instructions which, when executed, can cause the processor to perform the steps of any one of the question correction methods.
[0122] The processor is configured to provide computing and control capabilities to support the operation of the entire computer device.
[0123] The internal memory provides an environment for the execution of the computer program in the non-volatile storage medium, which, when executed by the processor, can cause the processor to perform the steps of any one of the question correction methods.
[0124] The network interface is configured to perform network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that the structure of the computer device is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can comprise more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0125] It should be understood that the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0126] In one embodiment, the processor is configured to run a computer program stored in the memory to implement the following steps:
[0127] obtain a question text, a standard answer text and a student answer text;
[0128] encoding the question text, the standard answer text and the student answer text respectively to obtain a question feature vector, a standard answer feature vector and a student answer feature vector;
[0129] aligning and fusing the question feature vector and the standard answer feature vector to obtain a first fusion vector;
[0130] aligning and fusing the question feature vector and the student answer feature vector to obtain a second fusion vector;
[0131] aligning and fusing the first fusion vector and the second fusion vector to obtain a third fusion vector;
[0132] generating a correction result of the student answer text according to the third fusion vector.
[0133] In an embodiment, the processor is configured to run a computer program stored in the memory to implement the following steps:
[0134] obtaining a question text, a standard answer text and a student answer text, and a labeled correction result corresponding to the student answer text;
[0135] encoding the question text, the standard answer text and the student answer text respectively based on an encoding model of the question correction model to obtain a question feature vector, a standard answer feature vector and a student answer feature vector;
[0136] aligning and fusing the question feature vector and the standard answer feature vector, and the student answer feature vector based on a self-attention mechanism model of the question correction model to obtain a third fusion vector;
[0137] generating a correction result of the student answer text according to the third fusion vector based on a correction model of the question correction model;
[0138] adjusting model parameters of the question correction model according to the generated correction result corresponding to the student answer text and the labeled correction result.
[0139] As can be clearly understood by a person skilled in the art from the above description of the embodiments, the present application can be implemented by means of software and a necessary general hardware platform. Based on such an understanding, the technical solutions of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in the various embodiments or some parts of the embodiments, such as:
[0140] A computer readable storage medium stores a computer program, the computer program comprising program instructions, and the processor executes the program instructions to implement the steps of any of the subject grading methods provided in the embodiments of the present application.
[0141] The computer readable storage medium can be an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. The computer readable storage medium can also be an external storage device of the computer device, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc.
[0142] The above merely provides a specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be encompassed in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A test grading method, characterized by, The method comprises: obtaining a question text, a standard answer text and a student answer text, the question text comprising a question text of a physical calculation question; encoding the question text, the standard answer text and the student answer text respectively to obtain a question feature vector, a standard answer feature vector and a student answer feature vector, the standard answer feature vector comprising a first step vector of each step in the standard answer text, and the student answer feature vector comprising a second step vector of each step in the student answer text; wherein encoding the question text to obtain the question feature vector comprises: encoding each word in the question text to obtain a word encoding vector; determining, based on a preset subject knowledge graph, the question feature vector corresponding to the question text according to the word encoding vector, so as to fuse knowledge point information in the subject knowledge graph corresponding to the question text, the subject knowledge graph indicating a hierarchical structure that the knowledge system itself has; aligning and fusing the question feature vector and the standard answer feature vector to fuse the knowledge point information of the question feature vector into different steps of the standard answer text, so as to align and fuse the knowledge points involved in the question text with the steps in the standard answer text, and obtain a first fusion vector; aligning and fusing the question feature vector and the student answer feature vector to fuse the knowledge point information of the question feature vector into different steps of the student answer text, so as to align and fuse the knowledge points involved in the question text with the steps in the student answer text, and obtain a second fusion vector; aligning and fusing the first fusion vector and the second fusion vector to align and fuse the first step vector of each step in the standard answer text after fusing the knowledge points and the second step vector of each step in the student answer text, and obtain a third fusion vector; generating a correction result of the student answer text according to the third fusion vector.
2. The subject correction method according to claim 1, wherein The aligning and fusing of the question feature vector and the standard answer feature vector comprises: inputting the question feature vector as a query term and the standard answer feature vector as a key-value pair into a self-attention mechanism model to obtain the first fusion vector; The aligning and fusing of the question feature vector and the student answer feature vector to obtain the second fusion vector comprises: inputting the question feature vector as a query term and the student answer feature vector as a key-value pair into a self-attention mechanism model to obtain the second fusion vector.
3. The question grading method according to any one of claims 1 to 2, wherein, The aligning and fusing of the first fusion vector and the second fusion vector to obtain the third fusion vector comprises: inputting the first fusion vector as a query term and the second fusion vector as a key-value pair into a self-attention mechanism model to obtain the third fusion vector.
4. The test correction method of claim 3, wherein The self-attention mechanism model determines first attention weights corresponding to the knowledge points in the question text and the steps in the standard answer text when performing alignment fusion processing on the question feature vector and the standard answer feature vector, and performs weighted summation on the standard answer feature vector according to the first attention weights to obtain the first fusion vector. The self-attention mechanism model determines second attention weights corresponding to the knowledge points in the question text and the steps in the student answer text when performing alignment fusion processing on the question feature vector and the student answer feature vector, and performs weighted summation on the student answer feature vector according to the second attention weights to obtain the second fusion vector. The self-attention mechanism model performs alignment fusion processing on the first fusion vector and the second fusion vector, determines third attention weights corresponding to the steps in the standard answer text and the steps in the student answer text, and performs weighted summation on the second fusion vector according to the third attention weights to obtain the third fusion vector. The method further comprises at least one of the following: According to the first attention weights, determine the knowledge points corresponding to the steps in the standard answer text; According to the second attention weights, determine the knowledge points corresponding to the steps in the student answer text; According to the third attention weights, determine the corresponding relationship of the steps in the standard answer text and / or the steps in the student answer text.
5. A training method for a question grading model, characterized in that, It includes: Obtain question text, standard answer text and student answer text, and the labeled correction result corresponding to the student answer text, the question text includes the question text of a physics calculation question; Based on the encoding model of the question correction model, encode the question text, the standard answer text and the student answer text respectively to obtain the question feature vector, the standard answer feature vector and the student answer feature vector, the standard answer feature vector includes the first step vector of each step in the standard answer text, and the student answer feature vector includes the second step vector of each step in the student answer text; wherein, encoding the question text to obtain the question feature vector includes: encoding each word in the question text to obtain a word encoding vector; based on a preset subject knowledge graph, determining the question feature vector corresponding to the question text according to the word encoding vector to fuse the knowledge point information corresponding to the question text in the subject knowledge graph, the subject knowledge graph indicates the hierarchical structure of the knowledge system itself; The self-attention mechanism model based on the question correction model is used for alignment and fusion processing of the question feature vector, the standard answer feature vector and the student answer feature vector, and the knowledge point information of the question feature vector is integrated into different steps of the standard answer text, so as to align and fuse the knowledge points involved in the question text with the steps in the standard answer text, integrate the knowledge point information of the question feature vector into different steps of the student answer text, align and fuse the knowledge points involved in the question text with the steps in the student answer text, and align and fuse the first step vectors of each step in the standard answer text after integrating the knowledge points and the second step vectors of each step in the student answer text, to obtain a third fusion vector; The correction model based on the question correction model is used to generate a correction result of the student answer text according to the third fusion vector; According to the generated correction result corresponding to the student answer text and the labeled correction result, the model parameters of the question correction model are adjusted; The training method further comprises: According to the labeled correction results corresponding to different student answer texts, a first correction result difference between the different student answer texts is determined; According to the third fusion vectors corresponding to different student answer texts, a second correction result difference between the different student answer texts is generated; According to the first correction result difference and the second correction result difference, the model parameters of the question correction model are adjusted.
6. A computer device, comprising: The computer device comprises a memory and a processor; The memory is used to store a computer program; The processor is used to execute the computer program and realize the following steps when executing the computer program: The steps of the question correction method according to any one of claims 1-4; and / or The steps of the training method of the question correction model according to claim 5.
7. A computer-readable storage medium storing a computer program, wherein the computer program comprises the following steps of: receiving a request for a resource from a client; determining whether the client is authorized to access the resource; and if the client is authorized to access the resource, providing the resource to the client. If the computer program is executed by the processor, the following steps are realized: The steps of the question correction method according to any one of claims 1-4; and / or The steps of the training method of the question correction model according to claim 5.
Citation Information
Patent Citations
Knowledge point detection method, device and equipment and readable storage medium
CN110852071A
Test question score determination method and device based on artificial intelligence, equipment and medium
CN112989826A
Correction model training method and device, correction method and device, electronic equipment and medium
CN113722466A