Paper score scoring method, device, equipment and product
By introducing an image processing module, score classifier and review classifier into the surface scoring model, the aesthetics and neatness of the surface can be evaluated from multiple dimensions, solving the problem of surface scoring deviation in the prior art, and achieving more accurate and consistent scoring results.
Patent Information
- Application Number
- CN202411883298.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-05-02
AI Technical Summary
The existing scheme for grading papers based on machine learning models cannot take into account the overall appearance of the papers, which leads to a deviation between manual scoring and machine model scoring.
A paper score scoring method is proposed. By obtaining the answer area image of the test paper to be scored, and inputting it into the pre-trained paper score scoring model, the paper score scoring results are generated. The model includes an image processing module, a score classifier and a comment classifier, which can rate the paper from dimensions such as writing aesthetics, neatness of the paper, writing neatness, typography aesthetics, and total word count.
This method can effectively solve the scoring differences caused by manual scoring and machine scoring, and provide more accurate and consistent scoring results for papers.
Smart Images

Figure CN119919355A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning technology, and specifically to a paper scoring method and a training method, device, equipment and product of its model. Background Art
[0002] With the rapid development of deep learning technology, the ability of computers to "understand" complex information has been significantly enhanced, and its accuracy and application scope have been continuously expanded. In many fields, artificial intelligence has gradually begun to replace manual work in performing some discrimination and generation tasks.
[0003] For example, in the test paper grading task in the field of education, the machine learning model can extract the content of the student's answer through text recognition technology, and judge whether the student's answer is correct or not by matching it with the standard answer or the model's own natural language understanding ability, and give a reasonable score. This greatly reduces the burden on teachers and parents and provides convenience for students' learning.
[0004] However, the existing paper scoring solutions based on machine learning models can only score the correctness of the answer content and the rationality of the semantics, and cannot take into account the subjective impact of the overall appearance of the paper on the teacher's scoring. Therefore, there will be a deviation between the scores obtained by manual scoring and scoring based on machine models. Summary of the invention
[0005] In view of this, an embodiment of the present invention is committed to providing a paper score grading method, which can obtain the paper score corresponding to the test paper to be graded according to the answer area image of the test paper to be graded, thereby solving the problem of scoring differences between manual scoring and machine scoring due to the paper score.
[0006] According to a first aspect of an embodiment of the present application, a method for scoring a paper is provided, the method comprising:
[0007] Get the answer area image of the test paper to be graded;
[0008] The answer area image is input into a pre-trained paper score grading model to obtain a paper score grading result corresponding to the paper image to be graded; the paper score grading result includes the paper score and the paper comments; the paper score grading model is a mathematical model used to grade the paper score of the paper to be graded based on the answer area image.
[0009] In a possible design of the first aspect, the paper scores and paper comments include scores and comments corresponding to multiple paper scoring dimensions respectively;
[0010] Among them, multiple paper scoring dimensions include at least one of the neatness of writing, the beauty of writing, the neatness of the paper, the beauty of the layout and the total number of words.
[0011] In a possible design of the first aspect, the paper scoring model includes:
[0012] An image processing module, and a score classifier and a comment classifier corresponding to each of the multiple test paper scoring dimensions;
[0013] The image processing module is used to extract the answer area feature vector from the answer area image, and calculate the target global attention pooling feature vector based on the answer area feature vector and the query vector corresponding to the target classifier; the target classifier is any one of the score classifiers and comment classifiers corresponding to the multiple test paper scoring dimensions;
[0014] A score classifier is used to output a score classification result based on the target global attention pooling feature vector;
[0015] The comment classifier is used to output the comment classification result according to the target global attention pooling feature vector.
[0016] In a possible design of the first aspect, the image processing module includes:
[0017] Visual encoder, and global attention pooling unit,
[0018] The visual encoder is used to extract the answer area image features from the answer area image through a fully convolutional network, and convert the answer area image features into an answer area feature vector;
[0019] The global attention pooling unit is used to calculate the attention weight between the answer area feature vector and the query vector corresponding to the target classifier; and obtain the target global attention pooling feature vector according to the attention weight.
[0020] In a possible design of the first aspect, the score classifier is specifically used to:
[0021] A k-dimensional score feature vector is obtained according to the target global attention pooling feature vector, and an activation function is used to calculate the k-dimensional score feature vector to obtain a score probability distribution. The score corresponding to the maximum probability in the score probability distribution is determined as the score classification result, and the score classification result is output; where k is a positive integer.
[0022] In a possible design of the first aspect, the comment classifier is specifically applied to:
[0023] A k-dimensional comment feature vector is obtained according to the target global attention pooling feature vector, and a comment classification result is output according to the k-dimensional comment feature vector; wherein k is a positive integer. In a possible design of the first aspect, the training process of the paper scoring model includes:
[0024] Obtain a training sample set, the training sample set includes a plurality of training samples, each training sample includes a training sample image and a test score and a test comment corresponding to the training sample image;
[0025] For each training sample, obtain a training sample feature vector corresponding to the training sample image;
[0026] According to the training sample feature vector and the query vector corresponding to the target classifier, the target global attention pooling feature vector is calculated; wherein the target classifier is any one of the writing neatness score classifier, the writing beauty score classifier, the paper neatness score classifier, the typesetting beauty score classifier and the total word count score classifier;
[0027] Input the target global attention pooling feature vector into the score classifier and the comment classifier respectively, obtain the score classification result output by the score classifier, and obtain the comment classification result output by the comment classifier;
[0028] The test paper scoring model is trained based on the score classification results, comment classification results, the test paper scores and test paper comments corresponding to the training sample images, and the pre-constructed cross entropy loss function.
[0029] In a possible design of the first aspect, after training the test paper scoring model, the method further includes:
[0030] For any two target global attention pooling feature vectors, the contrastive loss value of any two target global attention pooling feature vectors is calculated by the contrastive loss function to optimize the score classifier and the comment classifier.
[0031] According to a second aspect of an embodiment of the present application, a paper scoring device is provided, the device comprising:
[0032] An acquisition module is used to acquire an image of the answer area of the test paper to be graded;
[0033] The scoring module is used to input the answer area image into a pre-trained paper scoring model to obtain a paper scoring result corresponding to the paper image to be scored; the paper scoring result includes the paper score and the paper comments; the paper scoring model is a mathematical model used to score the paper score of the paper to be scored based on the answer area image.
[0034] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including a memory and a processor;
[0035] The memory is connected to the processor and is used for storing programs;
[0036] The processor is used to implement the paper scoring method as described in any one of the first aspects of the embodiments of the present application by running the program in the memory.
[0037] According to the fourth aspect of the embodiments of the present application, a computer program product is provided, comprising computer program instructions. When the computer program instructions are executed by a processor, the processor executes a paper scoring method as described in any one of the first aspects of the embodiments of the present application.
[0038] According to the fifth aspect of the embodiments of the present application, a chip is provided, including a processor and a data interface, and the processor reads and runs the program stored in the memory through the data interface to execute the paper grading method as any one of the first aspect of the embodiments of the present application.
[0039] According to the sixth aspect of the embodiments 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, a paper scoring method as described in any one of the first aspects of the embodiments of the present application is implemented.
[0040] According to the technical solution of the embodiment of the present application, by obtaining the answer area image of the test paper to be graded; inputting the answer area image into the pre-trained test paper scoring model, the test paper scoring result corresponding to the test paper image to be graded is obtained; the test paper scoring result includes the test paper score and the test paper comment; the test paper scoring model is a mathematical model for scoring the test paper score of the test paper to be graded according to the answer area image. According to the present application, the test paper score corresponding to the test paper to be graded can be obtained according to the answer area image of the test paper to be graded, which solves the problem of scoring differences caused by the test paper score between manual scoring and machine scoring in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] 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.
[0042] Figure 1 A schematic diagram of the process of using machine models to score English essays;
[0043] Figure 2 A schematic diagram of a process flow of a paper scoring method provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of the structure of the paper scoring model in the paper scoring method provided in the embodiment of the present application;
[0045] Figure 4 A schematic diagram of the process of global attention pooling in the paper scoring model provided in the embodiment of the present application;
[0046] Figure 5 A schematic diagram of the network structure of the paper scoring model provided in the embodiment of the present application;
[0047] Figure 6 A flowchart of the training process of the test paper scoring model provided in the embodiment of the present application;
[0048] Figure 7 A schematic diagram of the structure of a test paper scoring device provided in an embodiment of the present application;
[0049] Figure 8 A schematic diagram of the structure of another paper scoring device provided in an embodiment of the present application;
[0050] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] 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.
[0052] The technical terms involved in the embodiments of the present application are explained below:
[0053] Visual Encoder: It is an important component in the field of computer vision and deep learning. It is mainly used to extract meaningful feature representations from image or video data. Simply put, a visual encoder is a model or algorithm that can convert input visual information (such as pictures, video frames, etc.) into a compact and semantically meaningful vector representation, which is usually called a "feature vector" or "embedding."
[0054] Multi-label classification: refers to a classification task in which each sample can belong to multiple categories. Multi-label classification allows an input data to be assigned multiple labels at the same time. For example, in an image annotation task, an image can be labeled with five labels: writing beauty, paper neatness, writing neatness, layout beauty, and total number of words.
[0055] Contrastive Learning: is an unsupervised or self-supervised learning method that aims to learn representations by comparing the similarities between samples. It builds positive sample pairs (similar samples) and negative sample pairs (dissimilar samples), and then optimizes the model to shorten the distance between positive sample pairs and increase the distance between negative sample pairs. This method helps capture the essential characteristics of the data, thereby generating more powerful representations.
[0056] Global Attention Pooling: is a method for aggregating information in feature maps, which combines the attention mechanism and pooling operation, dynamically selecting which features should be retained or emphasized by calculating the importance weight of each position. This allows the model to focus on the most relevant information and improve sensitivity to key areas.
[0057] Classifier: It is the part of the machine learning model responsible for predicting the category to which the input data belongs based on the input data. In deep learning, classifiers are usually the last layer or layers of a neural network. They accept the features extracted by the previous layers as input and output the category probability distribution.
[0058] Exemplary application scenario description
[0059] With the rapid development of deep learning technology, the ability of computers to "understand" complex information has been significantly enhanced, and its accuracy and application scope have been continuously expanded. In many fields, artificial intelligence has gradually begun to replace manual work in performing some discrimination and generation tasks. For example, in the field of educational assessment, the application of machine models is changing the traditional scoring method.
[0060] Specifically, in the task of grading papers, machine learning models can extract the content of students' answers through text recognition technology, and judge whether the students' answers are correct by matching them with standard answers or the model's own natural language understanding ability, and give reasonable scores. This greatly reduces the burden on teachers and parents and provides convenience for students' learning.
[0061] like Figure 1 As shown in the figure, in the application scenario of using a machine model to score an English composition, first obtain a scanned image of the English composition, use the text recognition model to recognize the content in the scanned image of the English composition, and obtain the plain text content "Mon, Happy Birthday! I love you forever! Evan said happily...". After that, the plain text content is input into the language model, and the language model scores the English composition based on the contextual semantics, grammar usage, word spelling and other factors of the plain text content, and outputs the final score.
[0062] However, the existing machine learning-based scoring solutions can only score the correctness of the answers and the rationality of the semantics, ignoring visual factors such as the beauty, neatness, and tidiness of the papers. In the actual manual scoring process, for large-scale subjective questions such as essays, the overall appearance of the paper will subjectively affect the teacher's scoring. In addition, most exams will include "poor handwriting that affects recognition and perception" in the scoring rules. It can be seen that Figure 1 The scoring process based on the machine learning model shown in the figure cannot take into account the subjective impact of the overall appearance of the paper on the teacher's scoring, which will cause a deviation between the scores obtained by manual scoring and scoring based on the machine model.
[0063] In order to solve this problem, the present application proposes a method for scoring the paper score based on multi-label classification and contrastive learning, by scoring the paper score from five dimensions: the beauty of the writing, the neatness of the paper, the neatness of the writing, the beauty of the typesetting, and the total number of words. Among them, the score of each dimension is divided into three grades, and a comment classifier and a score classifier are constructed for each dimension. The score classifier is used to assist the neural network in capturing the fine-grained clues of the scores of each dimension, thereby improving the accuracy of the score classification. At the same time, the contrastive learning method is used in this application to improve the scoring effect of the neural network. Finally, the total score of the paper score is obtained by adding the scores of the five dimensions, and the total score range of the paper score is 0 to 10 points. In addition, in this application, the grading result corresponding to the final paper score can also be obtained by setting the grading interval. For example, it is divided into three grades: good, medium, and poor, where 0 to 3 points are poor, 4 to 7 points are medium, and 8 to 10 points are good.
[0064] In this way, this application classifies the five dimensions of writing beauty, paper neatness, writing neatness, typesetting beauty, and total number of words to obtain the scores corresponding to each dimension, and then integrates the scores of all dimensions to obtain the final classification result of the paper score. Therefore, by incorporating the classification result into the entire machine scoring system, corresponding operations such as deduction and addition of points can be performed to solve the problem of scoring differences between manual scoring and machine scoring due to paper scores.
[0065] Exemplary Methods
[0066] The following is a detailed description of the test paper scoring method provided in the embodiment of the present application in conjunction with the accompanying drawings.
[0067] Figure 2 This is a flow chart of the paper scoring method provided in the embodiment of the present application. Figure 2 In an exemplary embodiment, the provided paper scoring method may include the following steps:
[0068] 2100. Obtain an image of the answer area of the test paper to be graded.
[0069] 2200. Input the answer area image into a pre-trained paper score grading model to obtain a paper score grading result corresponding to the paper image to be graded; the paper score grading result includes the paper score and paper comments; the paper score grading model is a mathematical model used to grade the paper score of the paper to be graded based on the answer area image.
[0070] The test paper to be graded is a test paper submitted by students after answering the questions. The test paper to be graded is converted into an image to be graded through a scanner, camera and other equipment, and then the answer area image is identified from the image to be graded. For example, the answer area of each question can be automatically identified from the image to be graded by detecting features such as the question number, answer box, table lines, etc. on the test paper to be graded. Then, the answer area is cropped out from the entire image to be graded to generate a separate answer area image.
[0071] After obtaining the answer area image, the pre-trained paper score scoring model is used to analyze the answer area image to output the corresponding paper score result. The paper score scoring model is a mathematical model that has been trained with a large amount of labeled data and can score the paper score of the test paper to be scored based on the answer area image.
[0072] Specifically, the paper score and paper comments include scores and comments corresponding to multiple paper scoring dimensions, wherein the multiple paper scoring dimensions include at least one of writing neatness, writing beauty, paper neatness, typesetting beauty, and total number of words. In other words, the paper scoring model will analyze the answer area image from the five dimensions of writing beauty, paper neatness, writing neatness, typesetting beauty, and total number of words to obtain the paper scoring result.
[0073] In one possible implementation, Figure 3 As shown, the paper scoring model 300 may include an image processing module 310, and score classifiers 320 and comment classifiers 330 corresponding to multiple paper scoring dimensions. The image processing module 310 is used to extract the answer area feature vector from the answer area image, and calculate the target global attention pooling feature vector based on the answer area feature vector and the query vector corresponding to the target classifier; the target classifier is any one of the score classifiers 320 and comment classifiers 330 corresponding to multiple paper scoring dimensions.
[0074] Specifically, the image processing module 310 may include a visual encoder 3101 and a global attention pooling unit 3102. The visual encoder 3101 is used to extract the answer area image features from the answer area image through a full convolutional network, and convert the answer area image features into an answer area feature vector. The global attention pooling unit 3102 is used to calculate the attention weight between the answer area feature vector and the query vector corresponding to the target classifier; and obtain the target global attention pooling feature vector according to the attention weight.
[0075] In this embodiment, a full convolutional network (Convolutional Neural Network, referred to as CNN) is used as the visual encoder 3101. The full convolutional network can be, for example, a visual geometry group (Visual Geometry Group, referred to as VGG), a residual network (Residual Network, referred to as ResNet), a densely connected convolutional network (Densely Connected Convolutional Networks, referred to as DenseNet), a convolutional two-former (Conv2former), etc.
[0076] For example, for the answer area image I∈R H*W*3 , extract the answer area image feature F∈R from the answer area image through the fully convolutional network h*w*c . Where I represents the answer area image, R represents the real number matrix, H represents the height of the answer area image, W represents the width of the answer area image, and 3 represents the number of channels of the answer area image. F represents the answer area image feature, h represents the height of the answer area image feature, w represents the width of the answer area image feature, and c represents the number of channels of the answer area image feature.
[0077] Since the input of the target classifier is usually a feature vector, the answer region image feature F∈R h*w*c It cannot be directly input into the target classifier. Therefore, after obtaining the image feature F∈R h*w*c After that, we need to transform the answer area image feature F∈R h*w*c Converted to answer area feature vector F t ∈R (h*w)*c .
[0078] In this embodiment, the target classifier includes a score classifier 320 and a comment classifier 330. The score classifier 320 is used to output a score classification result according to the target global attention pooling feature vector. The comment classifier 330 is used to output a comment classification result according to the target global attention pooling feature vector.
[0079] When the target classifier is a score classifier 320, the target classifier is any one of the writing neatness score classifier 3201, the writing beauty score classifier 3202, the paper neatness score classifier 3203, the typesetting beauty score classifier 3204, and the total word count score classifier 3205. Accordingly, the obtained target global attention pooling feature vector is also the global attention pooling feature vector corresponding to the writing neatness score classifier 3201, the writing beauty score classifier 3202, the paper neatness score classifier 3203, the typesetting beauty score classifier 3204, and the total word count score classifier 3205.
[0080] That is to say, when the target classifier is the writing neatness score classifier 3201, the calculated target global attention pooling feature vector is the writing neatness score global attention pooling feature vector corresponding to the writing neatness score classifier 3201. When the target classifier is the writing beauty score classifier 3202, the calculated target global attention pooling feature vector is the writing beauty score global attention pooling feature vector corresponding to the writing beauty score classifier 3202. When the target classifier is the paper neatness score classifier 3203, the calculated target global attention pooling feature vector is the paper neatness score global attention pooling feature vector corresponding to the paper neatness score classifier 3203. When the target classifier is the typesetting beauty score classifier 3204, the calculated target global attention pooling feature vector is the typesetting beauty score global attention pooling feature vector corresponding to the typesetting beauty score classifier 3204. When the target classifier is the total word count score classifier 3205 , the calculated target global attention pooling feature vector is the total word count score global attention pooling feature vector corresponding to the total word count score classifier 3205 .
[0081] When the score classifier 320 outputs the score classification result based on the target global attention pooling feature vector, it can specifically obtain a k-dimensional score feature vector based on the target global attention pooling feature vector, use an activation function to calculate the k-dimensional score feature vector to obtain a score probability distribution, determine the score corresponding to the maximum probability in the score probability distribution as the score classification result, and output the score classification result; wherein k is a positive integer.
[0082] Taking the target classifier as the handwriting neatness score classifier 3201 as an example, the feature vector F t ∈R (h*w)*c The process of converting to the global attention pooling feature vector v is explained below. Figure 4 This is a schematic diagram of the process of global attention pooling in the paper scoring model provided in the embodiment of the present application. Figure 4As shown, first, the query vector q∈R corresponding to the writing neatness score classifier 3201 is set c , calculate the query vector q∈R c and the answer area feature vector F t The response value e at each position in j , the calculation formula is:
[0083] Among them, W 1 and W 2 is a network learnable parameter, The feature vector F of the answer area at the jth position t , T represents transpose.
[0084] Next, according to the query vector q∈R c and the answer area feature vector F t The response value e at each position in j , the attention weight between the answer area feature vector and the query vector corresponding to the writing neatness score classifier 3201 is calculated, and the calculation formula is: Among them, a j Indicates F t The attention weight of the j-th position in .
[0085] Afterwards, according to the calculated attention weights, t The weighted sum of the feature vectors of the answer area at all positions in the , can be used to obtain the global attention pooling feature vector v of the writing neatness score. The calculation formula for the weighted sum is:
[0086] It can be understood that for different target classifiers, different query vectors q need to be used to obtain independent target global attention pooling feature vectors v corresponding to each target classifier.
[0087] In one implementation, the score classifier 320 is a multi-layer perceptron (Mlp) composed of two fully connected layers. The target global attention pooling feature vector v is input into the score classifier 320, and the formula v is used to calculate the score classifier 320. lf =Mlp(v) to obtain the k-dimensional fractional feature vector v lf , then, the k-dimensional score feature vector v lf Input the activation function softmax to obtain the score probability distribution p = softmax(v lf ). The score corresponding to the maximum probability is obtained by the formula final_result = argmax(p), and the score is determined as the score classification result.
[0088] Exemplarily, assume that the global attention pooling feature vector of the handwriting neatness score is input into the handwriting neatness score classifier 3201 to obtain a three-dimensional score feature vector, and the three-dimensional score feature vector is input into the activation function softmax to obtain the handwriting neatness score probability distribution. For example, the probability of the handwriting neatness score being 0 is 0.6, the probability of the handwriting neatness score being 1 is 0.3, and the probability of the handwriting neatness score being 2 is 0.1; then the output handwriting neatness score classification result is 0 points.
[0089] Exemplarily, assume that the global attention pooling feature vector of the handwriting beauty score is input into the handwriting beauty score classifier 3202 to obtain a three-dimensional score feature vector, and the three-dimensional score feature vector is input into the activation function softmax to obtain the handwriting beauty score probability distribution. For example, the probability of the handwriting beauty score being 0 is 0.2, the probability of the handwriting beauty score being 1 is 0.5, and the probability of the handwriting beauty score being 2 is 0.3; then the output writing beauty score classification result is 1 point.
[0090] Exemplarily, assume that the global attention pooling feature vector of the paper neatness score is input into the paper neatness score classifier 3203 to obtain a three-dimensional score feature vector, and the 3-dimensional score feature vector is input into the activation function softmax to obtain the paper neatness score probability distribution. For example, the probability of the paper neatness score being 0 is 0.3, the probability of the paper neatness score being 1 is 0.4, and the probability of the paper neatness score being 2 is 0.3; then the output paper neatness score classification result is 1 point.
[0091] Exemplarily, assume that the global attention pooling feature vector of the typesetting beauty score is input into the typesetting beauty score classifier 3204 to obtain a three-dimensional score feature vector, and the three-dimensional score feature vector is input into the activation function softmax to obtain the typesetting beauty score probability distribution. For example, the probability of the typesetting beauty score being 0 is 0.1, the probability of the typesetting beauty score being 1 is 0.4, and the probability of the typesetting beauty score being 2 is 0.5; then the output typesetting beauty score classification result is 2 points.
[0092] Exemplarily, assume that the global attention pooling feature vector of the total word count score is input into the total word count score classifier 3205 to obtain a 2-dimensional score feature vector, and the 2-dimensional score feature vector is input into the activation function softmax to obtain the total word count score probability distribution. For example, the probability of the total word count score being 0 is 0.4, and the probability of the total word count score being 1 is 0.6; then the output total word count score classification result is 1 point.
[0093] In this embodiment, for each dimension of the paper score, corresponding comments will be set for each dimension to explain the student's performance and problems in this dimension. For example, in the dimension of layout aesthetics, the corresponding comments may include: misalignment of the two ends, non-horizontal direction of the single-line answer, adhesion of upper and lower lines, writing beyond the answer line, good layout without obvious problems, etc. In the dimension of paper neatness, the corresponding comments may include: alterations, insertions, swaps, etc.
[0094] Specifically, when the comment classifier 330 outputs the comment classification result according to the target global attention pooling feature vector, it can obtain a k-dimensional comment feature vector according to the target global attention pooling feature vector, and output the comment classification result according to the k-dimensional comment feature vector; wherein k is a positive integer.
[0095] The comment classifier 330 is also a multi-layer perceptron (Mlp) composed of two fully connected layers. The target global attention pooling feature vector v is input into the comment classifier 330, and the formula Get k-dimensional comment feature vector Afterwards, the k-dimensional comment feature vectors are combined to obtain the comment classification result.
[0096] Exemplarily, assuming that the global attention pooling feature vector of the writing neatness score is input into the writing neatness comment classifier 3301, the writing neatness comment classification result obtained is, for example, very neat writing and clear handwriting. The global attention pooling feature vector of the writing beauty score is input into the writing beauty comment classifier 3302, and the writing beauty comment classification result obtained is, for example, beautiful font and smooth strokes. The global attention pooling feature vector of the paper neatness score is input into the paper neatness comment classifier 3303, and the paper neatness comment classification result obtained is, for example, the existence of alterations. The global attention pooling feature vector of the typesetting beauty score is input into the typesetting beauty comment classifier 3304, and the typesetting beauty comment classification result obtained is, for example, good typesetting without obvious problems. The global attention pooling feature vector of the total word count score is input into the total word count comment classifier 3305, and the total word count comment classification result obtained is, for example, moderate number of words.
[0097] Exemplarily, taking the scoring of English composition papers as an example, the process of applying the paper scoring model is explained.
[0098] Specifically, the English test paper is converted into an image to be graded through a scanner, camera and other equipment, and then the answer area is identified from the image to be graded according to the table line features, and the answer area is cropped out from the entire image to be graded to generate a separate answer area image.
[0099] The answer area image is input into the paper scoring model. The visual encoder in the paper scoring model extracts the answer area image features from the answer area image and converts the answer area image features into the answer area feature vector, that is, Figure 5 CNN features shown in .
[0100] Afterwards, the global attention pooling layer in the paper scoring model calculates the attention weights between the answer area feature vector and the query vector corresponding to the writing neatness score classifier, calculates the attention weights between the answer area feature vector and the query vector corresponding to the writing beauty score classifier, calculates the attention weights between the answer area feature vector and the query vector corresponding to the paper neatness score classifier, calculates the attention weights between the answer area feature vector and the query vector corresponding to the typesetting beauty score classifier, and, calculates the attention weights between the answer area feature vector and the query vector corresponding to the total word count score classifier.
[0101] Next, the global attention pooling feature vector of the writing neatness score is obtained according to the attention weight between the answer area feature vector and the query vector corresponding to the writing neatness score classifier. The global attention pooling feature vector of the writing beauty score is obtained according to the attention weight between the answer area feature vector and the query vector corresponding to the writing beauty score classifier. The global attention pooling feature vector of the paper neatness score is obtained according to the attention weight between the answer area feature vector and the query vector corresponding to the paper neatness score classifier, the global attention pooling feature vector of the paper layout beauty score is obtained according to the attention weight between the answer area feature vector and the query vector corresponding to the typesetting beauty score classifier, and the global attention pooling feature vector of the total word count score is obtained according to the attention weight between the answer area feature vector and the query vector corresponding to the total word count score classifier.
[0102] The score classifier in the paper scoring model outputs the writing neatness score according to the global attention pooling feature vector of the writing neatness score, outputs the paper neatness score according to the global attention pooling feature vector of the paper neatness score, outputs the writing beauty score according to the global attention pooling feature vector of the writing beauty, outputs the typesetting beauty score according to the global attention pooling feature vector of the typesetting beauty, and outputs the total word number score according to the global attention pooling feature vector of the total number of words.
[0103] The comment classifier in the paper scoring model outputs a comment on writing neatness based on the global attention pooling feature vector of the writing neatness score, outputs a comment on paper neatness based on the global attention pooling feature vector of the paper neatness score, outputs a comment on writing beauty based on the global attention pooling feature vector of writing beauty, outputs a comment on typesetting beauty based on the global attention pooling feature vector of typesetting beauty, and outputs a comment on the total number of words based on the global attention pooling feature vector of the total number of words.
[0104] Finally, the score classifier of the paper scoring model adds the writing neatness score, paper neatness score, writing beauty score, typesetting beauty score and total word count score to obtain the paper score. In this embodiment, the paper score range is set to 0 to 10 points. In actual applications, the paper score range can be set according to needs. This embodiment does not specifically limit the paper score range.
[0105] Similarly, the comment classifier of the paper scoring model concatenates the comments on handwriting neatness, paper neatness, handwriting beauty, layout beauty and total word count in sequence to obtain the paper comments.
[0106] The paper scoring model outputs the paper score and paper comments as the paper scoring results of the English composition.
[0107] According to the technical solution of this embodiment, by obtaining the answer area image of the test paper to be graded; inputting the answer area image into the pre-trained paper score grading model, the paper score grading result corresponding to the test paper image to be graded is obtained; the paper score grading result includes the paper score and the paper comment; the paper score grading model is a mathematical model for grading the paper score of the test paper to be graded from five dimensions: writing beauty, paper neatness, writing neatness, typesetting beauty and total number of words according to the answer area image. According to this application, the paper score corresponding to the test paper to be graded can be obtained according to the answer area image of the test paper to be graded, so that by incorporating the paper score grading result into the entire machine scoring system, corresponding operations such as deduction and addition of points can be performed, so as to solve the problem of scoring differences caused by paper score between manual scoring and machine scoring.
[0108] The above is a description of the paper scoring method provided in the embodiment of the present application. The following is a detailed description of the training process of the paper scoring model used in the paper scoring method in the embodiment of the present application in conjunction with the accompanying drawings.
[0109] Figure 6 A flowchart of the training process of the test paper scoring model provided in the embodiment of the present application. Figure 6 In an exemplary embodiment, the training process of the provided test paper scoring model may include the following steps:
[0110] 6100. Obtain a training sample set, where the training sample set includes multiple training samples, and each training sample includes a training sample image and a volume score corresponding to the training sample image.
[0111] 6200. For each training sample, obtain a training sample feature vector corresponding to the training sample image.
[0112] 6300. Calculate a target global attention pooling feature vector based on the training sample feature vector and the query vector corresponding to the target classifier; wherein the target classifier is any one of a writing neatness score classifier, a writing beauty score classifier, a paper neatness score classifier, a typesetting beauty score classifier, and a total word count score classifier.
[0113] 6400. Input the target global attention pooling feature vector into the score classifier and the comment classifier respectively, obtain the score classification result output by the score classifier, and obtain the comment classification result output by the comment classifier.
[0114] 6500. Train the paper score scoring model based on the score classification results, comment classification results, paper scores corresponding to the training sample images, and the pre-constructed cross entropy loss function.
[0115] The training sample set includes a large number of labeled training samples, each of which includes a training sample image and a test paper score corresponding to the training sample image. The training sample image is the answer area image in the test paper.
[0116] After obtaining the training sample set, for each training sample in the training sample set, the training sample image is first input into a pre-trained visual encoder, so as to extract the training sample image features from the training sample image through the visual encoder.
[0117] For example, for a training sample image I∈R H*W*3 , extract the training sample image features F∈R from the training sample image through the full convolutional network h*w*c . Where I represents the training sample image, R represents the real number matrix, H represents the height of the training sample image, W represents the width of the training sample image, and 3 represents the number of channels of the training sample image. F represents the training sample image feature, h represents the height of the training sample image feature, w represents the width of the training sample image feature, and c represents the number of channels of the training sample image feature.
[0118] Since the input of the classifier is usually a feature vector, the training sample image feature F∈R h*w*c It cannot be directly input into the classifier, so after obtaining the training sample image feature F∈R h*w*cAfter that, the training sample image features F∈R h*w*c Converted to training sample feature vector F t ∈R (h*w)*c .
[0119] In the training sample feature vector F t ∈R (h*w)*c In the process of converting to the global attention pooling feature vector v, the attention weight between the training sample feature vector and the query vector corresponding to the target classifier is first calculated. Then the target global attention pooling feature vector v is obtained based on the attention weight.
[0120] The target classifier is any one of the writing neatness score classifier, writing beauty score classifier, paper neatness score classifier, typesetting beauty score classifier and total word count score classifier. Correspondingly, the obtained target global attention pooling feature vector is also the global attention pooling feature vector corresponding to the writing neatness score classifier, writing beauty score classifier, paper neatness score classifier, typesetting beauty score classifier and total word count score classifier.
[0121] That is to say, when the target classifier is a writing neatness score classifier, the calculated target global attention pooling feature vector is the writing neatness score global attention pooling feature vector corresponding to the writing neatness score classifier. When the target classifier is a writing beauty score classifier, the calculated target global attention pooling feature vector is the writing beauty score global attention pooling feature vector corresponding to the writing beauty score classifier. When the target classifier is a paper neatness score classifier, the calculated target global attention pooling feature vector is the paper neatness score global attention pooling feature vector corresponding to the paper neatness score classifier. When the target classifier is a typesetting beauty score classifier, the calculated target global attention pooling feature vector is the typesetting beauty score global attention pooling feature vector corresponding to the typesetting beauty score classifier. When the target classifier is a total word count score classifier, the calculated target global attention pooling feature vector is the total word count score global attention pooling feature vector corresponding to the total word count score classifier.
[0122] Taking the target classifier as the handwriting neatness score classifier as an example, the training sample feature vector F t ∈R (h*w)*c The process of converting to the global attention pooling feature vector v is explained below. First, set the query vector q∈R corresponding to the writing neatness score classifier c , calculate the query vector q∈R c and the training sample feature vector F t The response value e at each position inj , the calculation formula is:
[0123] Among them, W 1 and W 2 is a network learnable parameter, Represents the feature vector F of the training sample at the jth position t , T represents transpose.
[0124] Next, according to the query vector q∈R c and the training sample feature vector F t The response value e at each position in j , the attention weight between the training sample feature vector and the query vector corresponding to the handwriting neatness score classifier is calculated, and the calculation formula is: Among them, a j Indicates F t The attention weight of the j-th position in .
[0125] Afterwards, according to the calculated attention weights, t The weighted sum of the training sample feature vectors at all positions in the can be used to obtain the global attention pooling feature vector v of the writing neatness score. The calculation formula for the weighted summation is:
[0126] It can be understood that for different target classifiers, different query vectors q need to be used to obtain independent target global attention pooling feature vectors v corresponding to each target classifier.
[0127] Next, a specific classifier is constructed. In this embodiment, the paper scoring task is broken down into five dimensions, namely, writing neatness, paper neatness, writing beauty, typesetting beauty, and total number of words, and the overall score of the paper is determined from these five dimensions. For each dimension, in this embodiment, a corresponding comment is also set to explain the student's performance and problems in this dimension.
[0128] For example, in the dimension of layout aesthetics, the corresponding comments may include: misalignment at both ends, non-horizontal direction of single-line answers, adhesion between upper and lower lines, writing beyond the answer line, good layout without obvious problems, etc. In the dimension of paper neatness, the corresponding comments may include: alterations, insertions, swaps, etc.
[0129] That is to say, in this embodiment, not only a score classifier is constructed to score each dimension, but also a comment classifier is constructed to classify the comments corresponding to the dimension. For example, the dimension of handwriting neatness is scored. For example, the scores of handwriting neatness can be 0, 1, or 2, and comments on handwriting neatness are given, such as neat handwriting.
[0130] Specifically, the process of inputting the target global attention pooling feature vector into the score classifier to obtain the score classification result output by the score classifier includes: inputting the target global attention pooling feature vector into the score classifier to obtain a k-dimensional score feature vector; wherein k is a positive integer. Inputting the k-dimensional score feature vector into the activation function to obtain a score probability distribution. Determining the score corresponding to the maximum probability in the score probability distribution as the score classification result. Outputting the score classification result.
[0131] The score classifier is a multi-layer perceptron (Mlp) consisting of two fully connected layers. The target global attention pooling feature vector v is input into the score classifier, and the formula v is used to calculate the score classifier. lf =Mlp(v) to obtain the k-dimensional fractional feature vector v lf , then, the k-dimensional score feature vector v lf Input the activation function softmax to obtain the score probability distribution p = softmax(v lf ). The score corresponding to the maximum probability is obtained by the formula final_result = argmax(p), and the score is determined as the score classification result.
[0132] For example, suppose the global attention pooling feature vector of the handwriting neatness score is input into the handwriting neatness score classifier to obtain a three-dimensional score feature vector, and the three-dimensional score feature vector is input into the activation function softmax to obtain the handwriting neatness score probability distribution. For example, the probability of the handwriting neatness score being 0 is 0.6, the probability of the handwriting neatness score being 1 is 0.3, and the probability of the handwriting neatness score being 2 is 0.1; then the output handwriting neatness score classification result is 0 points.
[0133] Exemplarily, assume that the global attention pooling feature vector of the handwriting beauty score is input into the handwriting beauty score classifier to obtain a three-dimensional score feature vector, and the 3-dimensional score feature vector is input into the activation function softmax to obtain the handwriting beauty score probability distribution. For example, the probability of the handwriting beauty score being 0 is 0.2, the probability of the handwriting beauty score being 1 is 0.5, and the probability of the handwriting beauty score being 2 is 0.3; then the output writing beauty score classification result is 1 point.
[0134] Exemplarily, suppose that the global attention pooling feature vector of the paper neatness score is input into the paper neatness score classifier to obtain a three-dimensional score feature vector, and the 3-dimensional score feature vector is input into the activation function softmax to obtain the paper neatness score probability distribution. For example, the probability of the paper neatness score being 0 is 0.3, the probability of the paper neatness score being 1 is 0.4, and the probability of the paper neatness score being 2 is 0.3; then the output paper neatness score classification result is 1 point.
[0135] Exemplarily, assume that the global attention pooling feature vector of the typesetting beauty score is input into the typesetting beauty score classifier to obtain a three-dimensional score feature vector, and the three-dimensional score feature vector is input into the activation function softmax to obtain the typesetting beauty score probability distribution. For example, the probability of the typesetting beauty score being 0 is 0.1, the probability of the typesetting beauty score being 1 is 0.4, and the probability of the typesetting beauty score being 2 is 0.5; then the output typesetting beauty score classification result is 2 points.
[0136] Exemplarily, assume that the global attention pooling feature vector of the total word count score is input into the total word count score classifier to obtain a 2-dimensional score feature vector, and the 2-dimensional score feature vector is input into the activation function softmax to obtain the total word count score probability distribution. For example, the probability of the total word count score being 0 is 0.4, and the probability of the total word count score being 1 is 0.6; then the output total word count score classification result is 1 point.
[0137] Specifically, the process of inputting the target global attention pooling feature vector into the comment classifier to obtain the comment classification result output by the comment classifier includes: inputting the target global attention pooling feature vector into the comment classifier to obtain a k-dimensional comment feature vector; wherein k is a positive integer; and outputting the comment classification result according to the k-dimensional comment feature vector.
[0138] Among them, the comment classifier is also a multi-layer perceptron (MLP) composed of two fully connected layers. The target global attention pooling feature vector v is input into the comment classifier, and the formula v lp =Mlp(v) to get the k-dimensional comment feature vector v lp ,Afterwards, the k-dimensional comment feature vectors are combined to obtain the comment classification result.
[0139] Exemplarily, assuming that the global attention pooling feature vector of the writing neatness score is input into the writing neatness comment classifier, the obtained writing neatness comment classification result is, for example, very neat writing and clear handwriting. The global attention pooling feature vector of the writing beauty score is input into the writing beauty comment classifier, and the obtained writing beauty comment classification result is, for example, beautiful font and smooth strokes. The global attention pooling feature vector of the paper neatness score is input into the paper neatness comment classifier, and the obtained paper neatness comment classification result is, for example, the existence of alterations. The global attention pooling feature vector of the typesetting beauty score is input into the typesetting beauty comment classifier, and the obtained typesetting beauty comment classification result is, for example, good typesetting without obvious problems. The global attention pooling feature vector of the total word number score is input into the total word number comment classifier, and the obtained total word number comment classification result is, for example, moderate number of words.
[0140] After obtaining the score classification results output by the score classifier and the comment classification results output by the comment classifier, the score classifier is trained according to the score classification results, the paper scores corresponding to the training sample images and the cross-entropy loss function, and the comment classifier is trained according to the comment classification results, the paper scores corresponding to the training sample images and the cross-entropy loss function, so as to obtain the paper score scoring model.
[0141] Furthermore, in order to enhance the learning of the similarities and differences of the training sample images by the paper scoring model, this embodiment also uses comparative learning to optimize the score classifier and the comment classifier.
[0142] Specifically, after training the paper scoring model, for any two target global attention pooling feature vectors, the contrast loss value of any two target global attention pooling feature vectors is calculated through the contrast loss function to optimize the score classifier and the comment classifier.
[0143] Exemplarily, the calculation formula of the contrast loss function is:
[0144] in,
[0145] v i and v j are the global attention pooling feature vectors of any two targets.
[0146] In the process of contrastive learning, if two training samples belong to the same category, the optimization goal is to make the distance between the two training samples in a certain space small. If the two training samples do not belong to the same category and the distance between the two training samples is less than a hyperparameter m, the optimization goal is to make the distance between the two training samples close to the hyperparameter m. Specifically in this embodiment, training samples with the same score are positive sample pairs, and training samples with different scores are negative sample pairs. i andj Represents the true score of the training sample image in the current dimension.
[0147] After the paper scoring model is trained, it can be applied to the paper scoring of the test papers to be graded.
[0148] According to the technical solution of this embodiment, a training sample set including multiple training samples is obtained, and for each training sample, a training sample feature vector corresponding to the training sample image is obtained, and a target global attention pooling feature vector is calculated according to the training sample feature vector and a query vector corresponding to the target classifier; wherein the target classifier is any one of a writing neatness score classifier, a writing beauty score classifier, a paper neatness score classifier, a typesetting beauty score classifier, and a total word count score classifier, and the target global attention pooling feature vector is respectively input into the score classifier and the comment classifier to obtain a score classification result output by the score classifier and a comment classification result output by the comment classifier, and a paper score scoring model is trained according to the score classification result, the comment classification result, the paper score corresponding to the training sample image, and a pre-constructed cross entropy loss function. In this way, the classifier can be trained from the five dimensions of writing beauty, paper cleanliness, writing neatness, typesetting beauty and total number of words, and a mathematical model can be obtained that can score the paper score of the test paper to be scored from the five dimensions of writing beauty, paper cleanliness, writing neatness, typesetting beauty and total number of words. Therefore, by incorporating the scoring results of the paper score into the entire machine scoring system, corresponding operations such as deduction and addition of points can be performed, so as to solve the problem of scoring differences caused by the paper score between manual scoring and machine scoring.
[0149] Exemplary Devices
[0150] Accordingly, the present application also provides a device, such as Figure 7 As shown, the paper scoring device 700 provided in this embodiment may include: an acquisition module 710 and a scoring module 720.
[0151] The acquisition module 710 is used to acquire the answer area image of the test paper to be graded.
[0152] The scoring module 720 is used to input the answer area image into a pre-trained paper scoring model to obtain a paper scoring result corresponding to the paper image to be scored; the paper scoring result includes the paper score and the paper comments; the paper scoring model is a mathematical model used to score the paper score of the paper to be scored based on the answer area image.
[0153] In one embodiment, the paper score and paper comments include scores and comments corresponding to multiple paper scoring dimensions; wherein the multiple paper scoring dimensions include at least one of handwriting neatness, handwriting beauty, paper neatness, typesetting beauty and total number of words.
[0154] In one embodiment, a paper scoring model includes: an image processing module, and score classifiers and comment classifiers corresponding to multiple paper scoring dimensions; wherein the image processing module is used to extract an answer area feature vector from the answer area image, and calculate a target global attention pooling feature vector based on the answer area feature vector and the query vector corresponding to the target classifier; the target classifier is any one of the score classifiers and comment classifiers corresponding to multiple paper scoring dimensions; the score classifier is used to output a score classification result based on the target global attention pooling feature vector; the comment classifier is used to output a comment classification result based on the target global attention pooling feature vector.
[0155] In one embodiment, the image processing module includes: a visual encoder and a global attention pooling unit, wherein the visual encoder is used to extract answer area image features from the answer area image through a fully convolutional network, and convert the answer area image features into an answer area feature vector; the global attention pooling unit is used to calculate the attention weight between the answer area feature vector and the query vector corresponding to the target classifier; and obtain the target global attention pooling feature vector according to the attention weight.
[0156] In one embodiment, the score classifier is specifically used to obtain a k-dimensional score feature vector based on the target global attention pooling feature vector, use an activation function to calculate the k-dimensional score feature vector to obtain a score probability distribution, determine the score corresponding to the maximum probability in the score probability distribution as the score classification result, and output the score classification result; wherein k is a positive integer.
[0157] In one embodiment, the comment classifier is specifically used to obtain a k-dimensional comment feature vector according to the target global attention pooling feature vector, and output a comment classification result according to the k-dimensional comment feature vector; wherein k is a positive integer.
[0158] like Figure 8 As shown, the paper scoring device 700 provided in this embodiment may also include a training module 730 for training the paper scoring model. Specifically, the training module 730 may include: an acquisition unit 7301, a calculation unit 7302, a classification unit 7303 and a training unit 7304.
[0159] The acquisition unit 7301 is used to acquire a training sample set, which includes multiple training samples, each of which includes a training sample image and a face score corresponding to the training sample image. For each training sample, a training sample feature vector corresponding to the training sample image is acquired.
[0160] The calculation unit 7302 is used to calculate the target global attention pooling feature vector based on the training sample feature vector and the query vector corresponding to the target classifier; wherein the target classifier is any one of a writing neatness score classifier, a writing beauty score classifier, a paper neatness score classifier, a typesetting beauty score classifier and a total word count score classifier.
[0161] The classification unit 7303 is used to input the target global attention pooling feature vector into the score classifier and the comment classifier respectively, obtain the score classification result output by the score classifier, and obtain the comment classification result output by the comment classifier.
[0162] The training unit 7304 is used to train the paper scoring model based on the score classification results, comment classification results, the paper scores and paper comments corresponding to the training sample images, and a pre-constructed cross entropy loss function.
[0163] In one implementation, the training unit 7304 may also be used to calculate the contrast loss value of any two target global attention pooling feature vectors through a contrast loss function to optimize the score classifier and the comment classifier.
[0164] The paper scoring device provided in this embodiment belongs to the same application concept as the paper scoring method provided in the above embodiments of this application, and can execute the paper scoring method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the paper scoring method. For technical details not fully described in this embodiment, please refer to the specific processing content of the paper scoring method provided in the above embodiments of this application, and will not be repeated here.
[0165] It should be understood that the modules 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 unit in the device can be implemented in the form of a hardware circuit, and the functions of some or all units can be realized by designing the hardware circuit. 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 a 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 a hardware circuit, or in part by a processor calling software, and the remaining part is implemented in the form of a hardware circuit.
[0166] 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.
[0167] 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.
[0168] 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.
[0169] Exemplary Electronic Devices
[0170] The present application embodiment provides an electronic device, see Fig. 9 As shown, the electronic device includes a memory 900 and a processor 910 connected to the memory 900 .
[0171] The memory 900 is used to store programs.
[0172] Processor 910 is used to execute any one of the above-mentioned paper scoring methods, by obtaining the answer area image of the paper to be scored; inputting the answer area image into a pre-trained paper scoring model to obtain a paper scoring result corresponding to the paper image to be scored; the paper scoring result includes the paper score and the paper comment; the paper scoring model is a mathematical model for scoring the paper score of the paper to be scored according to the answer area image. The paper score corresponding to the paper to be scored can be obtained according to the answer area image of the paper to be scored, so as to solve the problem of scoring difference caused by the paper score between manual scoring and machine scoring.
[0173] The specific processing process of the processor 910 can refer to the introduction of the above method embodiment, and the specific implementation of the processor 910 can also refer to the introduction of the above embodiment.
[0174] Specifically, the electronic device may further include: a bus, a communication interface 920 , an input device 930 and an output device 940 .
[0175] The processor 910, the memory 900, the communication interface 920, the input device 930 and the output device 940 are connected to each other via a bus.
[0176] A bus may include a pathway that transfers information between components of a computer system.
[0177] The processor 910 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.
[0178] The processor 910 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0179] The memory 900 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 900 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.
[0180] The input device 930 may include a device for receiving data and information input by a user, such as an error microphone, a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0181] Output device 940 may include means for allowing information to be output to a user, such as a speaker, display screen, printer, speakers, and the like.
[0182] The communication interface 920 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.
[0183] The processor 910 executes the program stored in the memory 900 and calls other devices, which can be used to implement the various steps of any paper scoring method provided in the above embodiments of the present application.
[0184] An embodiment of the present application also proposes a chip, which includes a processor and a data interface. The processor reads and runs the program stored in the memory through the data interface to execute the paper scoring method introduced in any of the above embodiments. The specific processing process and its beneficial effects can be found in the introduction to the embodiment of the above-mentioned paper scoring method.
[0185] Exemplary computer program products and storage media
[0186] 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 paper scoring method according to various embodiments of the present application described in any of the above embodiments of this specification.
[0187] 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 a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0188] 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 paper scoring 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:
[0189] 2100. Obtain an image of the answer area of the test paper to be graded.
[0190] 2200. Input the answer area image into a pre-trained paper score grading model to obtain a paper score grading result corresponding to the paper image to be graded; the paper score grading result includes the paper score and paper comments; the paper score grading model is a mathematical model used to grade the paper score of the paper to be graded based on the answer area image.
[0191] 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.
[0192] 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.
[0193] 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.
[0194] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0195] 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.
[0196] 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.
[0197] 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.
[0198] 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.
[0199] 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.
[0200] 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.
[0201] 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 paper scoring method, characterized in that: The method comprises: Get the answer area image of the test paper to be graded; The answer area image is input into a pre-trained paper score grading model to obtain a paper score grading result corresponding to the paper image to be graded; the paper score grading result includes a paper score and a paper comment; the paper score grading model is a mathematical model used to score the paper score of the paper to be graded based on the answer area image.
2. The method according to claim 1, characterized in that: The paper scores and paper comments include scores and comments corresponding to multiple paper scoring dimensions; Among them, the multiple paper scoring dimensions include at least one of the neatness of writing, the beauty of writing, the neatness of the paper, the beauty of the layout and the total number of words.
3. The method according to claim 2, characterized in that The paper scoring model includes: An image processing module, and a score classifier and a comment classifier corresponding to each of the plurality of paper scoring dimensions; The image processing module is used to extract the answer area feature vector from the answer area image, and calculate the target global attention pooling feature vector based on the answer area feature vector and the query vector corresponding to the target classifier; the target classifier is any one of the score classifier and the comment classifier corresponding to each of the multiple test paper scoring dimensions; The score classifier is used to output a score classification result according to the target global attention pooling feature vector; The comment classifier is used to output a comment classification result according to the target global attention pooling feature vector.
4. The method according to claim 3, characterized in that: The image processing module comprises: Visual encoder, and global attention pooling unit, The visual encoder is used to extract answer area image features from the answer area image through a fully convolutional network, and convert the answer area image features into the answer area feature vector; The global attention pooling unit is used to calculate the attention weight between the answer area feature vector and the query vector corresponding to the target classifier; and obtain the target global attention pooling feature vector according to the attention weight.
5. The method according to claim 3, characterized in that: The score classifier is specifically used for: A k-dimensional fractional feature vector is obtained according to the target global attention pooling feature vector, an activation function is used to calculate the k-dimensional fractional feature vector to obtain a fractional probability distribution, the score corresponding to the maximum probability in the fractional probability distribution is determined as the fractional classification result, and the fractional classification result is output; wherein k is a positive integer.
6. The method according to claim 3, characterized in that The review classifier is specifically applied to: A k-dimensional comment feature vector is obtained according to the target global attention pooling feature vector, and the comment classification result is output according to the k-dimensional comment feature vector; wherein k is a positive integer.
7. The method according to any one of claims 1 to 6, characterized in that The training process of the paper scoring model includes: Acquire a training sample set, wherein the training sample set includes a plurality of training samples, each of the training samples includes a training sample image and a test score and a test comment corresponding to the training sample image; For each of the training samples, obtaining a training sample feature vector corresponding to the training sample image; A target global attention pooling feature vector is calculated based on the training sample feature vector and the query vector corresponding to the target classifier; wherein the target classifier is any one of a writing neatness score classifier, a writing beauty score classifier, a paper neatness score classifier, a typesetting beauty score classifier, and a total word count score classifier; Inputting the target global attention pooling feature vector into a score classifier and a comment classifier respectively, obtaining a score classification result output by the score classifier, and obtaining a comment classification result output by the comment classifier; The paper scoring model is trained according to the score classification results, the comment classification results, the paper scores and paper comments corresponding to the training sample images, and the pre-constructed cross entropy loss function.
8. The method according to claim 7, characterized in that After training the paper scoring model, the method further includes: For any two of the target global attention pooling feature vectors, the contrast loss values of any two of the target global attention pooling feature vectors are calculated by using a contrast loss function to optimize the score classifier and the comment classifier.
9. A paper scoring device, characterized in that: The device comprises: An acquisition module, used to acquire an image of the answer area of the test paper to be graded; The scoring module is used to input the answer area image into a pre-trained test paper scoring model to obtain a test paper scoring result corresponding to the test paper image to be scored; the test paper scoring result includes a test paper score and a test paper comment; the test paper scoring model is a mathematical model used to score the test paper of the test paper to be scored based on the answer area image.
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 paper grading method as described in any one of claims 1 to 8 by running the program in the memory.
11. A computer program product, characterized in that It includes computer program instructions, which, when executed by a processor, enable the processor to execute the paper grading method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Evaluation method and system for writing neatness
CN107507161A
Automatic scoring method, system and equipment for writing standard degree and storage medium
CN110555427A
Composition scoring method and device, electronic equipment and storage medium
CN112686020A
Composition reviewing method, device and equipment and storage medium
CN113435179A
Calligraphy / art work intelligent scoring method and system
CN114863125A