Method and device for automatically grading connected questions, and storage medium
By identifying and judging the image block information of the matching questions, and using corresponding algorithms or models for automatic grading, the problem of the inability to automatically grade matching questions has been solved, and grading efficiency has been improved.
Patent Information
- Application Number
- CN202111610440.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2041-12-27
AI Technical Summary
Existing technology cannot effectively automate the grading of matching questions, especially those involving a combination of text and lines, resulting in a heavy workload for teachers and an inability to utilize large-scale question banks for automatic grading.
By acquiring the image of the matching questions, identifying the two endpoints of the answer lines, determining the corresponding image blocks, and identifying the question information respectively, the system uses appropriate algorithms or models to determine whether the question information matches, thereby achieving automatic grading of the matching questions.
It enables automatic grading of online test questions without relying on a large question bank, simplifying the grading process and improving grading efficiency.
Smart Images

Figure CN114332898B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of online education technology, specifically to a method, apparatus, and storage medium for automatically grading online test questions. Background Technology
[0002] School education, as the primary means of learning scientific and cultural knowledge, requires homework and test practice to help students master knowledge. Now, whether in primary school, middle school, high school, or even university, students need to do homework and test practice. At the same time, school teachers face the task of grading dozens or even hundreds of students' homework and test papers, resulting in a significant workload and pressure for them.
[0003] Therefore, automatic grading is increasingly appearing in teachers' teaching work. With the help of automatic grading, teachers' workload can be reduced and grading efficiency can be improved. Furthermore, based on the results of automatic grading, the mastery of knowledge points can be automatically analyzed for teachers to refer to and carry out more targeted teaching work.
[0004] Existing automated grading methods generally rely on large-scale question banks, which contain hundreds of millions of questions and explanations. Automated grading is achieved by scanning and identifying questions in the assignments to be graded and then searching and matching them within the large-scale question bank. However, for matching questions, which involve a combination of text and lines, existing large-scale question banks cannot perform automated grading. Furthermore, matching questions are a common question type, appearing almost throughout the entire student curriculum. Therefore, this invention aims to solve the problem of automated grading of matching questions.
[0005] In view of this, the present invention is hereby proposed. Summary of the Invention
[0006] To address the aforementioned technical problems, this invention provides a method, apparatus, and storage medium for automatically grading online test questions. The specific technical solution is as follows:
[0007] This invention proposes an automatic grading method for matching test questions, including:
[0008] Obtain the image of the matching question;
[0009] Identify the answer lines in the question image and determine the first and second image blocks corresponding to the two endpoints of the answer lines;
[0010] Identify the first question information in the first image block and the second question information in the second image block respectively;
[0011] Based on the first and second question information, determine the type of the matching question, and use an algorithm and / or model corresponding to the type of question to determine whether the first question information in the first image block matches the second question information in the second image block;
[0012] If the judgment result is yes, the connection is correct; if the judgment result is no, the connection is incorrect.
[0013] As an optional embodiment of the present invention, the step of determining the type of the connection question based on the first question information and the second question information, and using an algorithm corresponding to the type of the question to determine whether the first question information in the first image block matches the second question information in the second image block includes:
[0014] When the matching question is determined to be a mathematical arithmetic question based on the first question information and the second question information, mathematical operations are performed on the arithmetic formulas in the first question information / second question information to obtain the operation result, and it is determined whether the operation result matches the matching result in the second question information / first question information.
[0015] As an optional embodiment of the present invention, the step of determining the type of the connection question based on the first question information and the second question information, and using a model corresponding to the type of the question to determine whether the first question information in the first image block matches the second question information in the second image block includes:
[0016] Pre-trained models are pre-trained to correspond to different types of matching questions;
[0017] The type of the matching question is determined based on the identified first and second question information.
[0018] According to the type of the matching question, the first question information and the second question information are imported into the training model corresponding to the question type of the matching question, and it is determined whether the first question information in the first image block matches the second question information in the second image block.
[0019] As an optional embodiment of the present invention, the training model includes a Chinese language training model pre-trained for Chinese language matching questions, and / or an English language training model pre-trained for English language matching questions, and / or a picture training model pre-trained for picture matching questions.
[0020] As an optional embodiment of the present invention, the step of identifying the connecting lines in the test question image and determining the first image block and the second image block corresponding to the two endpoints of the connecting lines includes:
[0021] OCR recognition is performed on the test question image, and the test question image is divided into several image blocks based on the OCR recognition results;
[0022] The answer lines in the test question image are identified, and the image blocks closest to the two endpoints of the lines are selected as the first image block and the second image block.
[0023] As an optional embodiment of the present invention, the step of identifying the answer connection line in the test question image and selecting the image blocks closest to the two endpoints of the connection line as the first image block and the second image block respectively includes:
[0024] Identify all the answer lines for a single matching question in the question image;
[0025] Draw multiple initial rectangles using each answer curve as its diagonal;
[0026] When the connecting question is a left-right connecting question, the corrected horizontal side length is obtained by summing up the horizontal side lengths of multiple initial rectangles and calculating the average value.
[0027] The horizontal side length of each initial rectangle is corrected to obtain the corrected horizontal side length. The position of the corrected rectangle is translated so that the center of the answer line coincides with the center of the diagonal of the corrected rectangle.
[0028] The image blocks closest to the two endpoints of the diagonal line connecting the answer are selected as the first image block and the second image block, respectively.
[0029] As an optional embodiment of the present invention, the step of identifying the answer connection line in the test question image and selecting the image blocks closest to the two endpoints of the connection line as the first image block and the second image block respectively includes:
[0030] Identify all the answer lines for a single matching question in the question image;
[0031] Draw multiple initial rectangles using each answer curve as its diagonal;
[0032] When the connection question is a vertical connection question, the vertical side lengths of multiple initial rectangles are summed and the average value is calculated to obtain the corrected vertical side length;
[0033] The vertical side length of each initial rectangle is corrected to obtain a corrected rectangle. The position of the corrected rectangle is translated so that the center of the answer line coincides with the center of the diagonal of the corrected rectangle.
[0034] The image blocks closest to the two endpoints of the diagonal line connecting the answer are selected as the first image block and the second image block, respectively.
[0035] As an optional embodiment of the present invention, in the process of calculating the average of the horizontal side lengths of multiple initial rectangles to obtain the corrected horizontal side length or the average of the vertical side lengths of multiple initial rectangles to obtain the corrected vertical side length, the horizontal side lengths or vertical side lengths are subtracted from each other to obtain the length difference value. The length difference value is compared with a preset difference threshold value to filter out the horizontal side lengths or vertical side lengths with larger length deviations, and discard them when calculating the average value.
[0036] An automatic grading device for matching questions, which runs the automatic grading method for the matching questions, the automatic grading device for the matching questions comprising:
[0037] The image acquisition module acquires images of the matching questions.
[0038] The image recognition module identifies the answer connection line in the test question image, determines the first image block and the second image block corresponding to the two endpoints of the answer connection line, and respectively identifies the first test question information in the first image block and the second test question information in the second image block;
[0039] The system includes a judgment and processing module that determines the type of the connection question based on the first question information and the second question information, and uses an algorithm and / or model corresponding to the type of question to determine whether the first question information in the first image block matches the second question information in the second image block; if the judgment result is yes, the connection is correct, and if the judgment result is no, the connection is incorrect.
[0040] The present invention also provides a storage medium storing a computer-executable program, which, when executed, implements the automatic grading method for the connection-based test questions described in any of the above-mentioned embodiments.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0042] The automatic grading method for matching questions in this invention identifies the question information corresponding to both ends of the matching line, determines the type of the matching question based on the question information, and then uses corresponding algorithms or models to determine whether the question information at both ends of the matching line matches, thereby achieving automatic grading of the matching questions. This invention can automatically grade matching questions of corresponding types through appropriate algorithms or models, without relying on large-scale question banks or requiring prior production and storage of matching questions, thus simplifying the automatic grading process and improving the efficiency of automatic grading of matching questions. Attached Figure Description
[0043] Figure 1 The flowchart of the automatic grading method for online test questions in this invention Figure 1 ;
[0044] Figure 2 The flowchart of the automatic grading method for online test questions in this invention Figure 2 ;
[0045] Figure 3 The flowchart of the automatic grading method for online test questions in this invention Figure 3 ;
[0046] Figure 4 An example diagram of an image processed by OCR according to an embodiment of the present invention. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0048] Therefore, the following detailed description of embodiments of the present invention is not intended to limit the scope of the claimed invention, but merely illustrates some embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0049] It should be noted that, unless otherwise specified, the embodiments and features and technical solutions in the present invention can be combined with each other.
[0050] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0051] In the description of this invention, it should be noted that the terms "upper," "lower," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of this invention is in use, or the orientation or positional relationship commonly understood by those skilled in the art. These terms are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention. In addition, the terms "first," "second," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0052] See Figure 1 As shown, this embodiment provides a method for automatically grading matching questions, including:
[0053] Obtain the image of the matching question;
[0054] Identify the answer lines in the question image and determine the first and second image blocks corresponding to the two endpoints of the answer lines;
[0055] Identify the first question information in the first image block and the second question information in the second image block respectively;
[0056] Based on the first and second question information, determine the type of the matching question, and use an algorithm and / or model corresponding to the type of question to determine whether the first question information in the first image block matches the second question information in the second image block;
[0057] If the judgment result is yes, the connection is correct; if the judgment result is no, the connection is incorrect.
[0058] The automatic grading method for matching questions in this embodiment identifies the question information corresponding to both ends of the connection, determines the type of the matching question based on the question information, and then uses corresponding algorithms or models to determine whether the question information at both ends of the connection matches, thereby achieving automatic grading of the matching questions. This embodiment can achieve automatic grading of matching questions of corresponding types through appropriate algorithms or models, without relying on a large question bank or requiring the prior production and storage of matching questions, thus simplifying the automatic grading method and improving the efficiency of automatic grading of matching questions.
[0059] As an optional implementation method in this embodiment, see Figure 2 As shown, in this embodiment, determining the type of the matching question based on the first question information and the second question information, and using an algorithm corresponding to the question type to determine whether the first question information in the first image block matches the second question information in the second image block includes:
[0060] When the matching question is determined to be a mathematical arithmetic question based on the first question information and the second question information, mathematical operations are performed on the arithmetic formulas in the first question information / second question information to obtain the operation result, and it is determined whether the operation result matches the matching result in the second question information / first question information.
[0061] In this embodiment, the automatic grading method for matching questions identifies that the matching question belongs to mathematical arithmetic. It then performs mathematical calculations based on the information from one end of the matching line to obtain the result, and matches the result with the question at the other end of the matching line to achieve automatic grading. Since mathematical arithmetic questions constitute a significant portion of the primary and secondary school curriculum, this embodiment directly converts the matching question into a mathematical calculation when it identifies it as such, thus achieving automatic grading.
[0062] For example, in this embodiment, one side of the math matching problem is "1+1", "1+2", "1+3", "1+4", and the other side is "5", "4", "3", "2". When automatically grading the matching problem, by extracting the first problem information "1+1, 1+2, 1+3, 1+4" and the second problem information "5, 4, 3, 2", it can be determined that it is a math arithmetic problem. Then, the calculation is directly performed on the first problem information "1+1, 1+2, 1+3, 1+4" to obtain the calculation result and match it with the second problem information "5, 4, 3, 2". If the match is successful, it is graded as a correct matching; otherwise, it is graded as an incorrect matching.
[0063] As an optional implementation method in this embodiment, see Figure 2 As shown in the figure, the method described in this embodiment for determining the type of the matching question based on the first question information and the second question information, and using a model corresponding to the type of the question to determine whether the first question information in the first image block matches the second question information in the second image block, includes:
[0064] Pre-trained models are pre-trained to correspond to different types of matching questions;
[0065] The type of the matching question is determined based on the identified first and second question information.
[0066] According to the type of the matching question, the first question information and the second question information are imported into the training model corresponding to the question type of the matching question, and it is determined whether the first question information in the first image block matches the second question information in the second image block.
[0067] This embodiment addresses matching questions that cannot be automatically graded through direct algorithmic calculation. It uses a trained model for judgment. For example, for Chinese or English matching questions, a large number of matching questions of the same type are pre-collected. The reference answers to these questions are split into two parts according to the matching lines and imported into a neural network model for calculation to obtain a training model. Multiple training models for different types of matching questions are set up in the control system. By importing the two parts of the identified matching question into the training model, it can be determined whether the two parts match, thus achieving automatic grading.
[0068] Therefore, as an optional embodiment of the present invention, the training model described in this embodiment includes a Chinese language training model pre-trained for Chinese language matching questions, and / or an English language training model pre-trained for English language matching questions, and / or a picture training model pre-trained for picture matching questions.
[0069] As an optional implementation of this embodiment, the step of identifying the connecting lines in the test question image and determining the first image block and the second image block corresponding to the two endpoints of the connecting lines includes:
[0070] OCR recognition is performed on the test question image, and the test question image is divided into several image blocks based on the OCR recognition results;
[0071] The answer lines in the test question image are identified, and the image blocks closest to the two endpoints of the lines are selected as the first image block and the second image block.
[0072] OCR (Optical Character Recognition) refers to the process by which electronic devices (such as scanners or digital cameras) examine printed characters on paper, determine their shapes by detecting dark and light patterns, and then translate the shapes into computer text using character recognition methods. In other words, for printed characters, optical methods are used to convert the text in paper documents into black and white dot matrix image files, and recognition software converts the text in the image into text format for further editing and processing by word processing software.
[0073] The main OCR process can be roughly divided into the following parts: image preprocessing; layout processing; image segmentation; feature extraction and model training; and post-recognition processing.
[0074] Image preprocessing
[0075] Because the thickness, smoothness, and printing quality of paper can all cause text distortion, resulting in interference such as broken strokes, merging, and smudges, noisy text images must be processed before text recognition. Preprocessing generally includes grayscale conversion, binarization, tilt detection and correction, line and character segmentation, image smoothing, normalization, etc.
[0076] Page layout
[0077] Page layout processing can generally be divided into three main parts: page layout analysis, page layout understanding, and page layout reconstruction.
[0078] Page Layout Analysis
[0079] The text image is segmented into different parts, and the attributes of each part are labeled, such as text, image, and table. Currently, the core idea of layout analysis is based on connected component analysis, and later derived layout analysis methods based on neural networks are also based on connected components. A connected component is defined as the region in the image where any pixel in the binary matrix after binarization is considered connected if all pixels surrounding it have the same pixel value. The attributes of the connected component can be marked based on characteristics such as its size or pixel distribution, which can then be used as a basis for further processing.
[0080] Page layout understanding
[0081] Obtain the article's logical structure, including the logical attributes of each section, the article's hierarchical relationships, and the reading order. Determine the sequence to which the connected components belong based on the connected component location information recorded during page layout analysis.
[0082] Page layout redesign
[0083] Based on the layout analysis and OCR results, an electronic document containing textual and layout information is reconstructed.
[0084] Image segmentation
[0085] Image segmentation can be broadly categorized into two main types: row (column) segmentation and character segmentation. Only after segmentation can individual characters be easily recognized and processed.
[0086] Feature extraction and model training
[0087] Before deep learning was widely applied in image recognition, template matching was a common method. Later, the resurgence of neural networks brought a new lease on life to OCR. Now, with the improvement of computer hardware computing power, deep neural networks trained on large amounts of data have achieved remarkable results in image recognition.
[0088] The image block in this embodiment is the image result after layout analysis and processing in the OCR recognition process. See [link / reference] Figure 4 An example of image processing is shown.
[0089] Since the lines in the matching questions are all hand-drawn by the students, it is impossible to maintain standardization or consistency. Therefore, in order to better locate the first and second image blocks corresponding to the two ends of the matching lines, as an optional implementation method in this embodiment, see [link to implementation details]. Figure 3 As shown in the figure, the identification of the answer connection line in the test question image in this embodiment, and the selection of the image blocks closest to the two endpoints of the connection line as the first image block and the second image block respectively, includes:
[0090] Identify all the answer lines for a single matching question in the question image;
[0091] Draw multiple initial rectangles using each answer curve as its diagonal;
[0092] When the connecting question is a left-right connecting question, the corrected horizontal side length is obtained by summing up the horizontal side lengths of multiple initial rectangles and calculating the average value.
[0093] The horizontal side length of each initial rectangle is corrected to obtain the corrected horizontal side length. The position of the corrected rectangle is translated so that the center of the answer line coincides with the center of the diagonal of the corrected rectangle.
[0094] The image blocks closest to the two endpoints of the diagonal line connecting the answer are selected as the first image block and the second image block, respectively.
[0095] As an optional implementation method in this embodiment, see [link to relevant documentation]. Figure 3 As shown in the figure, the identification of the answer connection line in the test question image in this embodiment, and the selection of the image blocks closest to the two endpoints of the connection line as the first image block and the second image block respectively, includes:
[0096] Identify all the answer lines for a single matching question in the question image;
[0097] Draw multiple initial rectangles using each answer curve as its diagonal;
[0098] When the connection question is a vertical connection question, the vertical side lengths of multiple initial rectangles are summed and the average value is calculated to obtain the corrected vertical side length;
[0099] The vertical side length of each initial rectangle is corrected to obtain a corrected rectangle. The position of the corrected rectangle is translated so that the center of the answer line coincides with the center of the diagonal of the corrected rectangle.
[0100] The image blocks closest to the two endpoints of the diagonal line connecting the answer are selected as the first image block and the second image block, respectively.
[0101] As an optional implementation of this embodiment, in the process of calculating the average of the horizontal side lengths of multiple initial rectangles to obtain the corrected horizontal side length, or calculating the average of the vertical side lengths of multiple initial rectangles to obtain the corrected vertical side length, the horizontal side lengths or vertical side lengths are subtracted pairwise to obtain the length difference value. The length difference value is compared with a preset difference threshold, and the horizontal side lengths or vertical side lengths with larger length deviations are filtered out and discarded when calculating the average. This is mainly because the answer curves are generally hand-drawn by students, and there are bound to be answer lines with large deviations. Such answer curves will increase the correction error when correcting, so they need to be discarded.
[0102] This embodiment also provides an automatic grading device for connection-based test questions, which operates the automatic grading method for connection-based test questions as described above. The automatic grading device for connection-based test questions includes:
[0103] The image acquisition module acquires images of the matching questions.
[0104] The image recognition module identifies the answer connection line in the test question image, determines the first image block and the second image block corresponding to the two endpoints of the answer connection line, and respectively identifies the first test question information in the first image block and the second test question information in the second image block;
[0105] The system includes a judgment and processing module that determines the type of the connection question based on the first question information and the second question information, and uses an algorithm and / or model corresponding to the type of question to determine whether the first question information in the first image block matches the second question information in the second image block; if the judgment result is yes, the connection is correct, and if the judgment result is no, the connection is incorrect.
[0106] The automatic grading device for connection-based test questions in this embodiment identifies the test question information corresponding to both ends of the connection through an image recognition module. The judgment and processing module determines the type of the connection-based test question based on the test question information. Then, according to different types, the corresponding algorithm or model is used to determine whether the test question information at both ends of the connection matches, thereby realizing the automatic grading of connection-based test questions.
[0107] The automatic grading device for matching questions in this embodiment can automatically grade matching questions of the corresponding type through appropriate algorithms or models. It does not require the use of a large question bank or the prior production and storage of matching questions, thus simplifying the automatic grading method and improving the efficiency of automatic grading of matching questions.
[0108] As an optional implementation of this embodiment, the judgment processing module determines the type of the connection question based on the first question information and the second question information, and uses an algorithm corresponding to the type of question to determine whether the first question information in the first image block matches the second question information in the second image block, including:
[0109] When the matching question is determined to be a mathematical arithmetic question based on the first question information and the second question information, mathematical operations are performed on the arithmetic formulas in the first question information / second question information to obtain the operation result, and it is determined whether the operation result matches the matching result in the second question information / first question information.
[0110] In this embodiment, the automatic grading device for matching questions allows the image recognition module to identify that the matching question belongs to mathematical arithmetic problems. The judgment and processing module then performs mathematical calculations based on the identified question information at one end of the matching line to obtain the result. The result is then matched with the question at the other end of the matching line to achieve automatic grading. Since mathematical arithmetic problems constitute a significant portion of the primary and secondary school curriculum, this embodiment directly converts the matching question into a mathematical calculation when it is identified as belonging to the mathematical arithmetic category, thus achieving automatic grading.
[0111] As an optional implementation of this embodiment, the judgment processing module determines the type of the connection question based on the first question information and the second question information, and uses a model corresponding to the type of question to determine whether the first question information in the first image block matches the second question information in the second image block, including:
[0112] Pre-trained models are pre-trained to correspond to different types of matching questions;
[0113] The type of the matching question is determined based on the identified first and second question information.
[0114] According to the type of the matching question, the first question information and the second question information are imported into the training model corresponding to the question type of the matching question, and it is determined whether the first question information in the first image block matches the second question information in the second image block.
[0115] This embodiment of the automatic grading device for matching questions addresses matching questions that cannot be automatically graded through direct algorithmic calculation. It uses a trained model for judgment. For example, for Chinese or English matching questions, a large number of matching questions of the same type are collected in advance. The reference answers of the collected matching questions are split into two parts according to the matching lines and imported into a neural network model for calculation to obtain a training model. The control system sets up multiple training models for different types of matching questions. The two parts of the identified matching question information are imported into the training model respectively to determine whether the two parts of the information match, thereby achieving automatic grading.
[0116] Therefore, as an optional embodiment of the present invention, the training model described in this embodiment includes a Chinese language training model pre-trained for Chinese language matching questions, and / or an English language training model pre-trained for English language matching questions, and / or a picture training model pre-trained for picture matching questions.
[0117] As an optional implementation of this embodiment, the image recognition module in this embodiment identifies the connecting lines in the test question image and determines the first image block and the second image block corresponding to the two endpoints of the connecting lines, including:
[0118] OCR recognition is performed on the test question image, and the test question image is divided into several image blocks based on the OCR recognition results;
[0119] The answer lines in the test question image are identified, and the image blocks closest to the two endpoints of the lines are selected as the first image block and the second image block.
[0120] OCR (Optical Character Recognition) refers to the process by which electronic devices (such as scanners or digital cameras) examine printed characters on paper, determine their shapes by detecting dark and light patterns, and then translate the shapes into computer text using character recognition methods. In other words, for printed characters, optical methods are used to convert the text in paper documents into black and white dot matrix image files, and recognition software converts the text in the image into text format for further editing and processing by word processing software.
[0121] The main OCR process can be roughly divided into the following parts: image preprocessing; layout processing; image segmentation; feature extraction and model training; and post-recognition processing.
[0122] Image preprocessing
[0123] Because the thickness, smoothness, and printing quality of paper can all cause text distortion, resulting in interference such as broken strokes, merging, and smudges, noisy text images must be processed before text recognition. Preprocessing generally includes grayscale conversion, binarization, tilt detection and correction, line and character segmentation, image smoothing, normalization, etc.
[0124] Page layout
[0125] Page layout processing can generally be divided into three main parts: page layout analysis, page layout understanding, and page layout reconstruction.
[0126] Page Layout Analysis
[0127] The text image is segmented into different parts, and the attributes of each part are labeled, such as text, image, and table. Currently, the core idea of layout analysis is based on connected component analysis, and later derived layout analysis methods based on neural networks are also based on connected components. A connected component is defined as the region in the image where any pixel in the binary matrix after binarization is considered connected if all pixels surrounding it have the same pixel value. The attributes of the connected component can be marked based on characteristics such as its size or pixel distribution, which can then be used as a basis for further processing.
[0128] Page layout understanding
[0129] Obtain the article's logical structure, including the logical attributes of each section, the article's hierarchical relationships, and the reading order. Determine the sequence to which the connected components belong based on the connected component location information recorded during page layout analysis.
[0130] Page layout redesign
[0131] Based on the layout analysis and OCR results, an electronic document containing textual and layout information is reconstructed.
[0132] Image segmentation
[0133] Image segmentation can be broadly categorized into two main types: row (column) segmentation and character segmentation. Only after segmentation can individual characters be easily recognized and processed.
[0134] Feature extraction and model training
[0135] Before deep learning was widely applied in image recognition, template matching was a common method. Later, the resurgence of neural networks brought a new lease on life to OCR. Now, with the improvement of computer hardware computing power, deep neural networks trained on large amounts of data have achieved remarkable results in image recognition.
[0136] The image block in this embodiment is the image result after layout analysis and processing in the OCR recognition process.
[0137] Since the lines in the matching questions answered by students are all hand-drawn, it is impossible to maintain standardization or consistency. Therefore, in order to better locate the first and second image blocks corresponding to the two ends of the answer lines, as an optional implementation method in this embodiment, the image recognition module identifies the answer lines in the question image and selects the image blocks closest to the two endpoints of the lines as the first and second image blocks, respectively, including:
[0138] Identify all the answer lines for a single matching question in the question image;
[0139] Draw multiple initial rectangles using each answer curve as its diagonal;
[0140] When the connecting question is a left-right connecting question, the corrected horizontal side length is obtained by summing up the horizontal side lengths of multiple initial rectangles and calculating the average value.
[0141] The horizontal side length of each initial rectangle is corrected to obtain the corrected horizontal side length. The position of the corrected rectangle is translated so that the center of the answer line coincides with the center of the diagonal of the corrected rectangle.
[0142] The image blocks closest to the two endpoints of the diagonal line connecting the answer are selected as the first image block and the second image block, respectively.
[0143] Furthermore, in this embodiment, the image recognition module identifies the answer connection line in the test question image, and selects the image blocks closest to both endpoints of the connection line as the first image block and the second image block, respectively:
[0144] Identify all the answer lines for a single matching question in the question image;
[0145] Draw multiple initial rectangles using each answer curve as its diagonal;
[0146] When the connection question is a vertical connection question, the vertical side lengths of multiple initial rectangles are summed and the average value is calculated to obtain the corrected vertical side length;
[0147] The vertical side length of each initial rectangle is corrected to obtain a corrected rectangle. The position of the corrected rectangle is translated so that the center of the answer line coincides with the center of the diagonal of the corrected rectangle.
[0148] The image blocks closest to the two endpoints of the diagonal line connecting the answer are selected as the first image block and the second image block, respectively.
[0149] As an optional implementation of this embodiment, in the process of calculating the average of the horizontal side lengths of multiple initial rectangles to obtain the corrected horizontal side length, or calculating the average of the vertical side lengths of multiple initial rectangles to obtain the corrected vertical side length, the horizontal side lengths or vertical side lengths are subtracted pairwise to obtain the length difference value. The length difference value is compared with a preset difference threshold, and the horizontal side lengths or vertical side lengths with larger length deviations are filtered out and discarded when calculating the average. This is mainly because the answer curves are generally hand-drawn by students, and there are bound to be answer lines with large deviations. Such answer curves will increase the correction error when correcting, so they need to be discarded.
[0150] This embodiment also provides a storage medium storing a computer-executable program, which, when executed, implements the automatic grading method for the connected test questions.
[0151] The storage medium described in this embodiment may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0152] This embodiment also provides an electronic device, including a processor and a memory, wherein the memory is used to store a computer-executable program, and when the computer program is executed by the processor, the processor executes the automatic grading method for the online test questions.
[0153] The electronic device is manifested in the form of a general-purpose computing device. It may contain one or more processors that work collaboratively. This invention also does not preclude distributed processing, meaning that processors may be distributed across different physical devices. The electronic device of this invention is not limited to a single entity, but may also be the sum of multiple physical devices.
[0154] The memory stores a computer-executable program, typically machine-readable code. The computer-readable program can be executed by the processor to enable the electronic device to perform the method of the present invention, or at least some steps of the method.
[0155] The memory includes volatile memory, such as random access memory (RAM) and / or cache memory, and may also be non-volatile memory, such as read-only memory (ROM).
[0156] It should be understood that the electronic device of the present invention may also include elements or components not shown in the examples above. For example, some electronic devices also include display units such as a display screen, and some electronic devices also include human-computer interaction elements such as buttons and keyboards. Any electronic device capable of executing a computer-readable program in its memory to implement the method of the present invention or at least some steps of the method can be considered as an electronic device covered by the present invention.
[0157] From the above description of the embodiments, those skilled in the art will readily understand that the present invention can be implemented by hardware capable of executing specific computer programs, such as the system of the present invention, and the electronic processing unit, server, client, mobile phone, control unit, processor, etc. included in the system. The present invention can also be implemented by computer software that executes the methods of the present invention, for example, by control software executed by a microprocessor, electronic control unit, client, server, etc. However, it should be noted that the computer software executing the methods of the present invention is not limited to execution in one or a specific set of hardware entities; it can also be implemented in a distributed manner by unspecified hardware. For computer software, the software product can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or distributed across a network, as long as it enables electronic devices to execute the methods according to the present invention.
[0158] The above embodiments are only used to illustrate the present invention and are not intended to limit the technical solutions described herein. Although the present invention has been described in detail with reference to the above embodiments, the present invention is not limited to the specific embodiments described above. Therefore, any modifications or equivalent substitutions to the present invention, as well as all technical solutions and improvements that do not depart from the spirit and scope of the invention, are covered within the scope of the claims of the present invention.
Claims
1. An automatic correction method of a connected-question test, characterized by, The method comprises the following steps: obtaining a question image of a connecting line question; identifying an answer connecting line in the question image, and determining a first image block and a second image block corresponding to two end points of the answer connecting line; identifying first question information in the first image block and second question information in the second image block respectively; judging the type of the connecting line question according to the first question information and the second question information, and judging whether the first question information in the first image block matches the second question information in the second image block by using an algorithm and / or a model corresponding to the type of the question; the step of identifying the connecting line in the question image and determining the first image block and the second image block corresponding to the two end points of the connecting line comprises the following steps: performing OCR identification on the question image, and dividing the question image into a plurality of image blocks according to the OCR identification result of the question image; identifying the answer connecting line in the question image, and selecting the image block closest to the two end points of the connecting line as the first image block and the second image block respectively; the step of identifying the answer connecting line in the question image and selecting the image block closest to the two end points of the connecting line as the first image block and the second image block respectively comprises the following steps: identifying all answer connecting lines of a connecting line question in the question image; drawing a plurality of initial rectangular frames with each answer curve as a diagonal line; when the connecting line question is a left-right connecting line question, calculating an average value of the horizontal edge lengths of the plurality of initial rectangular frames to obtain a modified horizontal edge length; modifying the horizontal edge length of each initial rectangular frame to the modified horizontal edge length to obtain a modified rectangular frame, and translating the position of the modified rectangular frame so that the center of the answer connecting line coincides with the center of the diagonal line of the modified rectangular frame; selecting the image block closest to the two end points of the diagonal line where the answer connecting line is located as the first image block and the second image block respectively; the step of identifying the answer connecting line in the question image and selecting the image block closest to the two end points of the connecting line as the first image block and the second image block respectively comprises the following steps: identifying all answer connecting lines of a connecting line question in the question image; drawing a plurality of initial rectangular frames with each answer curve as a diagonal line; when the connecting line question is an up-down connecting line question, calculating an average value of the vertical edge lengths of the plurality of initial rectangular frames to obtain a modified vertical edge length; modifying the vertical edge length of each initial rectangular frame to the modified vertical edge length to obtain a modified rectangular frame, and translating the position of the modified rectangular frame so that the center of the answer connecting line coincides with the center of the diagonal line of the modified rectangular frame; selecting the image block closest to the two end points of the diagonal line where the answer connecting line is located as the first image block and the second image block respectively; in the calculation process of calculating the average value of the horizontal edge lengths of the plurality of initial rectangular frames to obtain the modified horizontal edge length or calculating the average value of the vertical edge lengths of the plurality of initial rectangular frames to obtain the modified vertical edge length, the horizontal edge length or the vertical edge length is subtracted pairwise to obtain a length difference value, the length difference value is compared with a preset difference threshold value, the horizontal edge length or the vertical edge length with a larger length deviation is screened out, and is discarded in the calculation of the average value.
2. The automatic correction method of the connecting line test question according to claim 1, wherein if the result of the judgment is yes, the connecting line is correct, and if the result of the judgment is no, the connecting line is incorrect.
3. The automatic correction method of the connecting line test question according to claim 2, wherein the step of judging the type of the connecting line test question according to the first test question information and the second test question information, and judging whether the first test question information in the first image block and the second test question information in the second image block match or not by using an algorithm corresponding to the type of the test question comprises: when the connecting line test question is judged to be a mathematical arithmetic question according to the first test question information and the second test question information, performing mathematical operation on the arithmetic formula in the first test question information / second test question information to obtain an operation result, and judging whether the operation result matches the connecting line result in the second test question information / first test question information. The step of judging the type of the connecting line test question according to the first test question information and the second test question information, and judging whether the first test question information in the first image block and the second test question information in the second image block match or not by using a model corresponding to the type of the test question comprises: a pre-trained training model corresponding to different types of connecting line test questions is preset; the type of the connecting line test question is judged according to the recognized first test question information and the second test question information; 4. The method of automatically grading a linked question according to claim 1, wherein, the first test question information and the second test question information are input into the training model corresponding to the type of the connecting line test question according to the type of the connecting line test question, and whether the first test question information in the first image block and the second test question information in the second image block match or not is judged. The training model comprises a Chinese training model pre-trained for Chinese connecting line test questions, and / or an English training model pre-trained for English connecting line test questions, and / or a picture training model pre-trained for picture connecting line test questions. The automatic correction device of the connecting line test question comprises: an image acquisition module for acquiring a test question image of the connecting line test question; 5. The method of automatically grading a linked question according to claim 4, wherein, an image recognition module for recognizing the connecting line in the test question image, determining the first image block and the second image block corresponding to the two end points of the connecting line, and recognizing the first test question information in the first image block and the second test question information in the second image block, respectively; 6. An apparatus for automatically grading a link test question, which operates the automatic grading method for a link test question according to any one of claims 1 to 5, characterized by and a judgment processing module for judging the type of the connecting line test question according to the first test question information and the second test question information, and judging whether the first test question information in the first image block and the second test question information in the second image block match or not by using an algorithm and / or a model corresponding to the type of the test question; if the result of the judgment is yes, the connecting line is correct, and if the result of the judgment is no, the connecting line is incorrect. The step of recognizing the connecting line in the test question image, and determining the first image block and the second image block corresponding to the two end points of the connecting line comprises: performing OCR recognition on the test question image, and dividing the test question image into a plurality of image blocks according to the OCR recognition result of the test question image; recognizing the connecting line in the test question image, and selecting the image block closest to the two end points of the connecting line as the first image block and the second image block, respectively; The identifying the answer connection line in the test question image comprises: identifying all answer connection lines of a connection line test question in the test question image; drawing a plurality of initial rectangular frames with each answer curve as a diagonal line; when the connection line test question is a left-right connection line test question, calculating an average value of the horizontal edge lengths of the plurality of initial rectangular frames to obtain a modified horizontal edge length; modifying the horizontal edge length of each initial rectangular frame to the modified horizontal edge length to obtain a modified rectangular frame, and translating the position of the modified rectangular frame so that the center of the answer connection line coincides with the center of the diagonal line of the modified rectangular frame; selecting an image block closest to each end point of the diagonal line where the answer connection line is located as a first image block and a second image block, respectively; The identifying the answer connection line in the test question image comprises: identifying all answer connection lines of a connection line test question in the test question image; drawing a plurality of initial rectangular frames with each answer curve as a diagonal line; when the connection line test question is an up-down connection line test question, calculating an average value of the vertical edge lengths of the plurality of initial rectangular frames to obtain a modified vertical edge length; modifying the vertical edge length of each initial rectangular frame to the modified vertical edge length to obtain a modified rectangular frame, and translating the position of the modified rectangular frame so that the center of the answer connection line coincides with the center of the diagonal line of the modified rectangular frame; selecting an image block closest to each end point of the diagonal line where the answer connection line is located as a first image block and a second image block, respectively; In the calculation process of calculating an average value of the horizontal edge lengths of the plurality of initial rectangular frames to obtain a modified horizontal edge length or calculating an average value of the vertical edge lengths of the plurality of initial rectangular frames to obtain a modified vertical edge length, the horizontal edge length or the vertical edge length is subtracted pairwise to obtain a length difference value, the length difference value is compared with a preset difference threshold value, the horizontal edge length or the vertical edge length with a larger length deviation is screened out, and is discarded when the average value is calculated. 7.A storage medium storing a computer executable program, wherein the computer executable program is executed to implement the automatic correction method of the connection line test question according to any one of claims 1-5.
Citation Information
Patent Citations
Test question detection and recognition method and device, electronic equipment and medium
CN112347997A
Connection question correction method and device, electronic device and storage medium
CN112989768A