Handwritten content multi-candidate identification method applied to test question correction and related device

By employing a single main branch path to decode printed text and multiple handwritten branch paths to decode handwritten text in parallel during test grading, the problem of errors in recognizing printed and handwritten text was solved, achieving higher grading accuracy and efficiency.

CN121884355APending Publication Date: 2026-04-17IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
IFLYTEK CO LTD
Filing Date
2025-12-31
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing test grading methods cannot effectively distinguish between printed and handwritten text, resulting in a high probability of errors in handwritten text recognition and affecting grading accuracy.

Method used

A single main branch path decoding strategy is used to decode printed text, while a multi-handwritten branch path parallel decoding strategy is used to decode handwritten text, generating multiple handwritten text recognition results. These handwritten text results are then distinguished and marked using preset tags, and each answer area is graded individually.

Benefits of technology

It improves the accuracy and efficiency of handwritten text recognition, enhances the accuracy and timeliness of test grading, and can match answers according to the granularity of the answer area, thereby improving the accuracy of grading results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121884355A_ABST
    Figure CN121884355A_ABST
Patent Text Reader

Abstract

The invention discloses a handwritten content multi-candidate recognition method applied to test question correction and a related device, and relates to the technical field of image processing. After text recognition is carried out on the answer image including the answer result displayed in the handwritten form in the answer area, the question stem displayed in the printed form in the obtained text recognition result corresponds to one printed text recognition result, and the answer result displayed in the handwritten form corresponds to a plurality of handwritten text recognition results; therefore, the accuracy of test question correction can be improved by correcting the test questions based on the recognition results of the handwritten texts of the answer areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method and related apparatus for multi-candidate recognition of handwritten content applied to test paper grading. Background Technology

[0002] In educational settings, automatic test grading often requires first recognizing the test question image to obtain the test content recognition result, and then matching the recognized result with the answer to obtain the grading result. The test content includes the question stem and the student's answer area. Typically, the question stem is in standard printed text with regular characters and clear structure, while the student's answer area is mostly handwritten text, which varies in writing quality, handwriting style, cursiveness, and spatial layout.

[0003] Existing test grading methods can only produce one recognition result for both printed and handwritten texts. This greatly increases the probability of recognition errors for handwritten texts and affects the accuracy of test grading.

[0004] Therefore, how to improve the accuracy of grading test questions that involve a mix of printed and handwritten text has become a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of the above problems, this application provides a method and related apparatus for recognizing multiple candidates of handwritten content in test paper grading, so as to improve the accuracy of grading test papers with a mixture of printed and handwritten text. The specific solution is as follows:

[0006] The first aspect of this application provides a method for multi-candidate recognition of handwritten content applied to test paper grading, including:

[0007] Obtain the answer image to be graded, the answer image including the question stem displayed in printed form and at least one answer area, the answer area including the answer result displayed in handwritten form;

[0008] Text recognition is performed on the answer image to obtain the text recognition result of the answer image. In the recognition result of the answer image, the question stem displayed in printed form corresponds to one printed text recognition result, and the answer result displayed in handwritten form corresponds to multiple handwritten text recognition results.

[0009] In one possible implementation, performing text recognition on the response image to obtain the text recognition result of the response image includes:

[0010] The answer image is input into an image text recognition model. The image text recognition model uses a first decoding strategy to decode the question stem displayed in printed form and a second decoding strategy to decode the answer result displayed in handwritten form, thereby obtaining the text recognition result of the answer image.

[0011] The first decoding strategy uses a single main branch path for decoding, while the second decoding strategy uses multiple handwritten branch paths for parallel decoding.

[0012] In one possible implementation, the text recognition result of the response image includes:

[0013] The text recognition results of each text line in the answer image; the text recognition results of each text line are marked with a preset handwritten text recognition result marker pair, and each handwritten text recognition result is distinguished by a preset handwritten marker pair. The handwritten text recognition result marker pair and the handwritten marker pair both include a start marker and an end marker.

[0014] In one possible implementation, the decoding of the printed question stem using a first decoding strategy and the decoding of the handwritten answer using a second decoding strategy include:

[0015] For the current decoding position, determine whether the current decoding position corresponds to the decoding of handwritten text based on the handwritten markers in the decoded sequence;

[0016] If the current decoding position corresponds to handwritten text decoding, then the second decoding strategy is used for decoding; otherwise, the first decoding strategy is used for decoding.

[0017] In one possible implementation, determining whether the current decoding position corresponds to handwritten text decoding based on handwritten marker pairs in the decoded sequence includes:

[0018] Determine whether there are incomplete handwritten mark pairs in the decoded sequence;

[0019] If it exists, then the current decoding position corresponds to handwritten text decoding; if it does not exist, then the current decoding position corresponds to printed text decoding.

[0020] The second aspect of this application provides a method for grading test questions, including:

[0021] The answer areas are graded one by one according to their order of appearance in the test questions, and the grading results of each answer area are obtained. Each answer area corresponds to multiple handwritten text recognition results. The multiple handwritten text recognition results corresponding to the answer area are obtained based on the handwritten content multi-candidate recognition method applied to test question grading as described above.

[0022] The grading result of the test question is determined based on the grading results of each of the answer areas.

[0023] In one possible implementation, the answer area is graded as follows:

[0024] Obtain the standard answer in the answer area;

[0025] Multiple answer results in the answer area are determined based on the recognition results of multiple handwritten texts in the answer area;

[0026] The multiple answers in the answer area are matched with the standard answers in the answer area to obtain the matching results;

[0027] If the matching result indicates that at least one answer successfully matches the standard answer, then the answer in the answer area is determined to be correct.

[0028] A third aspect of this application provides a multi-candidate recognition device for handwritten content used in test paper grading, comprising:

[0029] The acquisition unit is used to acquire the answer image to be graded, the answer image including the question stem displayed in printed form and at least one answer area, the answer area including the answer result displayed in handwritten form;

[0030] The recognition unit is used to perform text recognition on the answer image to obtain the text recognition result of the answer image. In the recognition result of the answer image, the question stem displayed in printed form corresponds to one printed text recognition result, and the answer result displayed in handwritten form corresponds to multiple handwritten text recognition results.

[0031] In one possible implementation, the identification unit is specifically used for:

[0032] The answer image is input into an image text recognition model. The image text recognition model uses a first decoding strategy to decode the question stem displayed in printed form and a second decoding strategy to decode the answer result displayed in handwritten form, thereby obtaining the text recognition result of the answer image.

[0033] The first decoding strategy uses a single main branch path for decoding, while the second decoding strategy uses multiple handwritten branch paths for parallel decoding.

[0034] In one possible implementation, the text recognition result of the response image includes:

[0035] The text recognition results of each text line in the answer image; the text recognition results of each text line are marked with a preset handwritten text recognition result marker pair, and each handwritten text recognition result is distinguished by a preset handwritten marker pair. The handwritten text recognition result marker pair and the handwritten marker pair both include a start marker and an end marker.

[0036] In one possible implementation, the identification unit is specifically used for:

[0037] For the current decoding position, determine whether the current decoding position corresponds to the decoding of handwritten text based on the handwritten markers in the decoded sequence;

[0038] If the current decoding position corresponds to handwritten text decoding, then the second decoding strategy is used for decoding; otherwise, the first decoding strategy is used for decoding.

[0039] In one possible implementation, the identification unit is specifically used for:

[0040] Determine whether there are incomplete handwritten mark pairs in the decoded sequence;

[0041] If it exists, then the current decoding position corresponds to handwritten text decoding; if it does not exist, then the current decoding position corresponds to printed text decoding.

[0042] The fourth aspect of this application provides a method for grading test questions, including:

[0043] The answer area grading unit is used to grade each answer area one by one according to the order in which the answer areas appear in the test questions, and obtain the grading results of each answer area; each answer area corresponds to multiple handwritten text recognition results; the multiple handwritten text recognition results corresponding to the answer area are obtained based on the handwritten content multi-candidate recognition method applied to test question grading as described above;

[0044] The grading result determination unit is used to determine the grading result of the test question based on the grading results of each of the answer areas.

[0045] In one possible implementation, the answer area grading unit is specifically used for:

[0046] Obtain the standard answer in the answer area;

[0047] Multiple answer results in the answer area are determined based on the recognition results of multiple handwritten texts in the answer area;

[0048] The multiple answers in the answer area are matched with the standard answers in the answer area to obtain the matching results;

[0049] If the matching result indicates that at least one answer successfully matches the standard answer, then the answer in the answer area is determined to be correct.

[0050] The fifth aspect of this application provides a computer program product, including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the handwritten content multi-candidate recognition method for test paper grading applied to the first aspect or any implementation thereof, and / or the test paper grading method of the second aspect or any implementation thereof.

[0051] A sixth aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0052] The memory is used to store computer programs;

[0053] The processor is used to execute the computer program so that the electronic device can implement the handwritten content multi-candidate recognition method for test paper grading applied to the first aspect or any implementation thereof, and / or the test paper grading method of the second aspect or any implementation thereof.

[0054] The seventh aspect of this application provides a computer-readable storage medium carrying one or more computer programs that, when executed by an electronic device, enable the electronic device to use the first aspect or any implementation thereof for the handwritten content multi-candidate recognition method for test paper grading, and / or the second aspect or any implementation thereof for the test paper grading method.

[0055] By employing the above technical solutions, the test paper grading method and related apparatus provided in this application, after performing text recognition on an answer image including a question stem displayed in printed form and at least one answer area, and the answer area including the answer result displayed in handwritten form, the obtained text recognition results show that the question stem displayed in printed form corresponds to one printed text recognition result, and the answer result displayed in handwritten form corresponds to multiple handwritten text recognition results, thereby increasing the probability that the answer result is correctly recognized. Therefore, test paper grading based on multiple handwritten text recognition results of each answer area can improve the accuracy of test paper grading. Attached Figure Description

[0056] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0057] Figure 1 A flowchart illustrating a method for recognizing multiple candidates of handwritten content used in test paper grading, provided in an embodiment of this application;

[0058] Figure 2 This is a schematic diagram illustrating an example of a response image provided in an embodiment of this application;

[0059] Figure 3 This application provides a schematic diagram of a main branch being expanded into multiple handwritten branches in an embodiment of the present application.

[0060] Figure 4 This application provides a schematic diagram illustrating the merging of multiple handwritten branch paths into a single main branch path.

[0061] Figure 5 This application provides a schematic diagram of a complete dynamic alternating decoding process.

[0062] Figure 6 A flowchart illustrating a test paper grading method provided in an embodiment of this application;

[0063] Figure 7 A schematic diagram of a multi-candidate recognition device for handwritten content applied to test paper grading, provided in an embodiment of this application;

[0064] Figure 8 A schematic diagram of a test paper grading device provided in this application embodiment;

[0065] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0066] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0067] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0068] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0069] In educational settings, automatic test grading often requires first recognizing the test question image to obtain the test content recognition result, and then matching the recognized result with the answer to obtain the grading result. The test content includes the question stem and the student's answer area. Typically, the question stem is in standard printed text with regular characters and clear structure, while the student's answer area is mostly handwritten text, which varies in writing quality, handwriting style, cursiveness, and spatial layout.

[0070] OCR (Optical Character Recognition) technology aims to convert text regions in an image into a machine-readable format. Its core process typically includes feature extraction, sequence modeling, and decoding stages. The decoding stage mainly performs a global path search based on the character probability distribution obtained in the sequence modeling stage to infer the most likely text sequence.

[0071] Currently, OCR technology is widely used for the automated recognition of test questions. It has a high accuracy rate for printed text. However, due to factors such as writing quality, handwriting style, cursive writing, and spatial layout, the difficulty of OCR recognition for handwritten text increases significantly, which can easily lead to misrecognition or omission, resulting in a lower accuracy rate.

[0072] To improve recognition accuracy, when using OCR technology to recognize test questions, a full-image beam-search decoding mechanism is often employed in the decoding stage. This involves performing a global path search on both printed and handwritten text within the entire test question image, outputting multiple candidate text sequences to select the most probable one. However, the computational cost of the full-image beam-search decoding mechanism increases exponentially with the number of candidate text sequences, leading to low efficiency in question grading.

[0073] To address this issue, a feasible solution proposed by those skilled in the art is to first detect text lines using a detection model, then classify the text lines to determine whether they are printed or handwritten text lines. Next, both types of text lines are identified separately. During the decoding phase of the identification process, only handwritten text lines are decoded using a beam-search mechanism to output multiple candidate text sequences, from which the most probable handwritten text line sequence is selected. Finally, the identification results of all text lines are recombined by sorting the text lines to obtain the most probable full-image text sequence, which is then used for answer matching to obtain the correction result.

[0074] However, this solution involves numerous steps, resulting in high system complexity and long reasoning delays. Furthermore, under complex layouts (such as mixed text and image layouts, intermittent line breaks, and non-linear layouts), the text line ordering is prone to misalignment, leading to breaks in the semantic structure of the question stem and severely affecting the contextual understanding and answer matching accuracy of the grading system.

[0075] Moreover, the full-image beam-search decoding mechanism and the above-mentioned schemes can only generate the most probable full-image text sequence for answer matching. That is, when a question stem contains multiple answer regions, it is impossible to generate a text sequence for each independent answer region, which restricts the accuracy of subsequent answer matching. It is impossible to match answers according to the granularity of the answer region, which can easily affect the accuracy of the grading results.

[0076] To address the aforementioned issues, this application provides a method for recognizing multiple candidates of handwritten content for test question grading. This method can improve the grading accuracy for test questions where printed and handwritten texts are interspersed.

[0077] The following is a detailed description of the multi-candidate recognition method for handwritten content applied to test paper grading, based on embodiments of this application, with reference to the accompanying drawings.

[0078] Reference Figure 1 , Figure 1 This application provides a flowchart illustrating a multi-candidate recognition method for handwritten content applied to test paper grading, as shown in the embodiments of this application. Figure 1 As shown in the embodiment of this application, a method for recognizing multiple candidates of handwritten content applied to test paper grading may include the following steps, which are described in detail below.

[0079] S101: Obtain the answer image to be graded, the answer image including the question stem displayed in printed form and at least one answer area, the answer area including the answer result displayed in handwritten form;

[0080] In this application, the image of the answer to be graded is the image of the test question that needs to be graded. The test question usually includes a question stem and an answer area. A certain answer area in the test question is used for the test taker to write the answer to the question stem in the answer area. Usually, the question stem is in standard printed font, with regular characters and clear structure, while the answer written by the test taker in the answer area is handwritten and has differences in handwriting quality, handwriting style, degree of cursive writing and spatial layout.

[0081] Therefore, as one possible implementation, the answer image includes a question stem displayed in printed form and at least one answer area, which includes the answer result displayed in handwritten form. For ease of understanding, refer to... Figure 2 , Figure 2 This is a schematic diagram illustrating an example of a response image provided in an embodiment of this application.

[0082] In this application, image acquisition devices such as cameras or scanning devices such as scanning pens can be used to scan assignments or exam papers to obtain answer images. The answer image may contain one or multiple questions to be graded. To avoid grading errors due to poor answer image quality, after acquiring the answer image, operations such as denoising, binarization, or tilt correction can be performed to improve the image quality. This application does not impose any limitations on these operations.

[0083] S102: Perform text recognition on the answer image to obtain the text recognition result of the answer image. In the recognition result of the answer image, the question stem displayed in printed form corresponds to one printed text recognition result, and the answer result displayed in handwritten form corresponds to multiple handwritten text recognition results.

[0084] Considering the stable structure of printed text and its high accuracy in text recognition, while handwritten text suffers from lower accuracy due to factors such as handwriting diversity, fluctuating writing quality, and image noise, and given that the accuracy of handwritten text recognition plays a crucial role in the correctness of test grading, this application proposes that, in the text recognition results obtained after performing text recognition on the answer image, the question stem displayed in printed form corresponds to one printed text recognition result, while the answer result displayed in handwritten form corresponds to multiple handwritten text recognition results. This approach not only increases the probability of the answer result being correctly recognized but also relatively ensures the efficiency of text recognition for the answer image, thereby maximizing the accuracy and timeliness of test grading.

[0085] In this application, since the answer results displayed in handwritten form in each answer area correspond to multiple handwritten text recognition results, the probability of the answer results being correctly recognized is increased. Therefore, grading test questions based on multiple handwritten text recognition results in each answer area can improve the accuracy of test question grading.

[0086] In another embodiment of this application, a specific implementation method for performing text recognition on the response image to obtain the text recognition result of the response image is described, which may include:

[0087] The answer image is input into an image text recognition model. The image text recognition model uses a first decoding strategy to decode the question stem displayed in printed form and a second decoding strategy to decode the answer result displayed in handwritten form, thereby obtaining the text recognition result of the answer image.

[0088] The first decoding strategy uses a single main branch path for decoding, while the second decoding strategy uses multiple handwritten branch paths for parallel decoding.

[0089] In this application, the image text recognition model is an end-to-end recognition model. After the answer image is input into the image text recognition model, the image text recognition model can predict the text recognition result of the answer image end-to-end.

[0090] In one possible implementation, the image text recognition model includes an encoder and a decoder. Unlike traditional image text recognition models, the decoder in this application uses a first decoding strategy to decode the question stem displayed in printed form and a second decoding strategy to decode the answer result displayed in handwritten form. To ensure that the final text recognition result of the answer image corresponds to one printed text recognition result for the question stem displayed in printed form and multiple handwritten text recognition results for the answer result displayed in handwritten form, in this application, the first decoding strategy uses a single main branch path decoding, and the second decoding strategy uses multiple handwritten branch paths for parallel decoding. When the first decoding strategy is switched to the second decoding strategy, the decoded single main branch path is expanded into multiple handwritten branch paths before subsequent decoding. When the second decoding strategy is switched to the first decoding strategy, the decoded multiple handwritten branch paths are merged into a single main branch path before subsequent decoding.

[0091] It should be noted that the maximum length of both the main branch path and the handwritten branch path can be preset, making decoding more controllable.

[0092] In one possible implementation, the first decoding strategy can be a greedy search decoding strategy (e.g., argmax decoding strategy), and the maximum length of the main branch path can be 4000 tokens. The second decoding strategy can be a beam-search decoding strategy, and the maximum length of the handwritten branch path can be 100 tokens.

[0093] It should be noted that the first decoding strategy and the second decoding strategy can also be other decoding strategies, as long as they can satisfy the condition that the first decoding strategy uses a single main branch path for decoding and the second decoding strategy uses multiple handwritten branch paths for parallel decoding. This application does not impose any restrictions on this.

[0094] In one possible implementation, the image text recognition model can be an OCR recognition model, where the specific structures of the encoder and decoder can be set according to the requirements of the scenario. For example, the encoder can adopt a convolutional neural network, and the decoder can adopt a Transformer-based network. This application does not impose any limitations on this.

[0095] Compared to the traditional approach of first detecting whether a text line is printed or handwritten before recognizing it, the technical solution of this application does not require printing or handwriting detection of the text line. It can directly predict the text recognition result of the response image end-to-end based on the response image, which is more concise and can still ensure the accuracy of recognition for response images with complex layouts.

[0096] In one possible implementation, the text recognition result of the response image includes:

[0097] The text recognition results of each text line in the answer image; the text recognition results of each text line are marked with a preset handwritten text recognition result marker pair, and each handwritten text recognition result is distinguished by a preset handwritten marker pair. The handwritten text recognition result marker pair and the handwritten marker pair both include a start marker and an end marker.

[0098] In this application, a decoding method can be adopted that uses a first decoding strategy to decode the question stem displayed in printed form and a second decoding strategy to decode the answer result displayed in handwritten form. The answer image is decoded according to the text line order to obtain the text recognition result of each text line. The text recognition result of each text line conforms to a preset format specification. The preset format specification is used to indicate which content in the text recognition result of the text line is the handwritten text recognition result, which content is the printed text recognition result, and how to distinguish between each handwritten text recognition result. In one possible implementation, the preset format specification includes marking the handwritten text recognition result with preset handwritten text recognition result tag pairs and distinguishing each handwritten text recognition result with preset handwritten tag pairs. The handwritten text recognition result tag pairs and the handwritten tag pairs both include a start tag and an end tag.

[0099] Specifically, the handwritten text recognition results are labeled with preset handwritten text recognition result tags, and each handwritten text recognition result is distinguished by preset handwritten tag pairs. This can be achieved by automatically wrapping the handwritten text recognition results with preset handwritten text recognition result tags (e.g., ...). <topk> and< / topk> Special marker pairs), the text recognition results located between these marker pairs are determined to be handwritten text recognition results. Between these marker pairs, the handwritten text recognition results are sorted from high to low path probability. Each handwritten text recognition result is automatically wrapped with a preset handwritten marker pair (e.g., <hand> and< / hand> (Special marker pairs) The text between these marker pairs is identified as a handwritten text recognition result, while the rest is considered a printed text recognition result.

[0100] For ease of understanding, for example, the text recognition result of a text line can be represented as:

[0101] [Printed Text Recognition Results] <topk> <hand> [Handwritten text recognition result 1]< / hand> <hand> [Handwritten text recognition result 2]< / hand> …… < / topk> [Printed text recognition results].

[0102] In one possible implementation, the decoding of the printed question stem using a first decoding strategy and the decoding of the handwritten answer using a second decoding strategy include:

[0103] For the current decoding position, determine whether the current decoding position corresponds to handwritten text decoding based on the handwritten mark pairs in the decoded sequence; if the current decoding position corresponds to handwritten text decoding, then use the second decoding strategy for decoding; otherwise, use the first decoding strategy for decoding.

[0104] In one possible implementation, determining whether the current decoding position corresponds to handwritten text decoding based on handwritten markers in the decoded sequence includes:

[0105] Determine whether there are incomplete handwritten mark pairs in the decoded sequence; if so, determine that the current decoding position corresponds to the decoding of handwritten text; if not, determine that the current decoding position corresponds to the decoding of printed text.

[0106] In this application, the existence of incomplete handwritten tag pairs in the decoded sequence means that the most recent handwritten tag pair in the decoded sequence only has a start tag but no end tag. The absence of incomplete handwritten tag pairs in the decoded sequence means that every handwritten tag pair in the decoded sequence contains both a start tag and an end tag.

[0107] For ease of understanding, let's assume the relationship between the question stem and the answer area in the image to be graded is: Question Stem - Answer Area - Question Stem - Answer Area - Question Stem. The first decoding strategy is the argmax decoding strategy, with a preset maximum length of 4000 tokens for the main branch. The second decoding strategy is the beam-search decoding strategy, with beam=3. The maximum length of the handwritten branch path is 100 tokens, and the handwritten tag pairs are... <hand> and< / hand> For special marker pairs, based on the decoding method of this application, the specific decoding process is as follows:

[0108] The initial input is the start symbol. <s> The model employs an autoregressive argmax decoding strategy to maintain a single main branch path. When the main branch outputs the end-of-line character...< / s> Decoding will terminate when the preset maximum length (e.g., 4000 tokens) is reached.

[0109] The decoding output of the main branch path at a certain moment is <hand>When the system determines that the subsequent content belongs to the answer area, it triggers a decoding strategy switching mechanism, switching to beam-search decoding: the current main branch state is copied into three independent "handwritten branch paths," and a beam search algorithm is used for multi-path parallel decoding. The initial decoding history of each beam branch inherits the context state of the main branch at the time of switching to ensure semantic coherence. A diagram illustrating the expansion of the main branch into multiple handwritten branches is shown below. Figure 3 As shown.

[0110] When any handwritten branch decodes the end marker< / hand> When the handwriting branch reaches its maximum decoding length (e.g., 100 characters) without generating an end marker, a marker is forcibly inserted according to predefined rules to close the region boundary, thus ensuring structural integrity and predictability of subsequent processing. This mechanism effectively balances the flexibility of handwritten content recognition with the structural constraints of the system output.

[0111] When all handwritten branches terminate, they are appended to the end of the main branch path history, and then decoding continues as a single main branch path. A diagram illustrating the merging of multiple handwritten branch paths into a single main branch path is shown below. Figure 4 As shown.

[0112] The above process is repeated cyclically to form a dynamic alternating decoding process of "argmax → beam-search → argmax → beam-search → argmax". Once this dynamic alternating decoding process is completed, the recognition result of "question stem - answer area - question stem - answer area - question stem" is obtained. A schematic diagram of the complete dynamic alternating decoding process is shown below. Figure 5 As shown.

[0113] Based on the above-mentioned multi-candidate recognition method for handwritten content applied to test paper grading, this application embodiment also provides a test paper grading method, referring to... Figure 6 , Figure 6 This is a flowchart illustrating a test paper grading method provided in an embodiment of this application, such as... Figure 6 As shown in the embodiment of this application, a test paper grading method may include the following steps, which are described in detail below.

[0114] S201: Each answer area is graded sequentially according to its appearance order in the test question, resulting in a grading result for each answer area; each answer area corresponds to multiple handwritten text recognition results; the multiple handwritten text recognition results corresponding to the answer area are obtained based on a multi-candidate handwritten content recognition method applied to test question grading;

[0115] S202: Based on the grading results of each of the answer areas, determine the grading result of the test question.

[0116] In this application, after obtaining multiple handwritten text recognition results for each of the answer areas, fine-grained output of "one question with multiple blanks and multiple candidates for each blank" is achieved. Then, each of the answer areas is graded one by one according to the order in which the answer areas appear in the test question, and the grading results of each answer area are obtained. Answer matching can be performed according to the granularity of the answer area. First, the grading results of each answer area are obtained, and then the grading results of each answer area are merged to obtain the grading result of the entire test question, which can improve the accuracy of the grading results.

[0117] In one possible implementation, the answer area is graded as follows:

[0118] S2021: Obtain the standard answer in the answer area;

[0119] After obtaining the answer image to be graded, the standard answers for each answer area of ​​the corresponding question in the answer image can be obtained. The standard answers can be pre-set, or they can be obtained by recognizing the printed text in the answer image and then searching for the corresponding question in the question bank based on the recognition result through character similarity matching. Alternatively, they can be obtained by using a large language model to answer the recognition result in real time. This application does not impose any limitations on these methods.

[0120] S022: Based on the recognition results of multiple handwritten texts in the answer area, determine multiple answer results in the answer area;

[0121] In this application, all or part of the multiple handwritten text recognition results in the answer area can be determined as multiple answer results in the answer area, and this application does not impose any limitations on this.

[0122] S2023: Match the multiple answers in the answer area with the standard answer in the answer area to obtain a matching result; if the matching result indicates that at least one answer is successfully matched with the standard answer, then the answer in the answer area is determined to be correct.

[0123] The answer area is determined to be incorrect only if the matching results indicate that multiple answers do not match the standard answer.

[0124] The above describes a method for recognizing multiple candidates of handwritten content for test paper grading, provided by an embodiment of this application. The following describes the apparatus for performing the above-described method for recognizing multiple candidates of handwritten content for test paper grading.

[0125] Please see Figure 7 , Figure 7 This is a schematic diagram of a multi-candidate recognition device for handwritten content used in test paper grading, provided as an embodiment of this application. Figure 7 As shown, the handwritten content multi-candidate recognition device used for test paper grading includes:

[0126] The acquisition unit 11 is used to acquire the answer image to be graded, the answer image including the question stem displayed in printed form and at least one answer area, the answer area including the answer result displayed in handwritten form;

[0127] The recognition unit 12 is used to perform text recognition on the answer image to obtain the text recognition result of the answer image. In the recognition result of the answer image, the question stem displayed in printed form corresponds to one printed text recognition result, and the answer result displayed in handwritten form corresponds to multiple handwritten text recognition results.

[0128] In one possible implementation, the identification unit is specifically used for:

[0129] The answer image is input into an image text recognition model. The image text recognition model uses a first decoding strategy to decode the question stem displayed in printed form and a second decoding strategy to decode the answer result displayed in handwritten form, thereby obtaining the text recognition result of the answer image.

[0130] The first decoding strategy uses a single main branch path for decoding, while the second decoding strategy uses multiple handwritten branch paths for parallel decoding.

[0131] In one possible implementation, the text recognition result of the response image includes:

[0132] The text recognition results of each text line in the answer image; the text recognition results of each text line are marked with a preset handwritten text recognition result marker pair, and each handwritten text recognition result is distinguished by a preset handwritten marker pair. The handwritten text recognition result marker pair and the handwritten marker pair both include a start marker and an end marker.

[0133] In one possible implementation, the identification unit is specifically used for:

[0134] For the current decoding position, determine whether the current decoding position corresponds to the decoding of handwritten text based on the handwritten markers in the decoded sequence;

[0135] If the current decoding position corresponds to handwritten text decoding, then the second decoding strategy is used for decoding; otherwise, the first decoding strategy is used for decoding.

[0136] In one possible implementation, the identification unit is specifically used for:

[0137] Determine whether there are incomplete handwritten mark pairs in the decoded sequence;

[0138] If it exists, then the current decoding position corresponds to handwritten text decoding; if it does not exist, then the current decoding position corresponds to printed text decoding.

[0139] Please see Figure 8 , Figure 8 This is a schematic diagram of a test paper grading device provided in an embodiment of this application. Figure 8 As shown, the test device includes:

[0140] The answer area grading unit is used to grade each answer area one by one according to the order in which the answer areas appear in the test questions, and obtain the grading results of each answer area; each answer area corresponds to multiple handwritten text recognition results; the multiple handwritten text recognition results corresponding to the answer area are obtained based on the handwritten content multi-candidate recognition method applied to test question grading;

[0141] The grading result determination unit is used to determine the grading result of the test question based on the grading results of each of the answer areas.

[0142] In one possible implementation, the answer area grading unit is specifically used for:

[0143] Obtain the standard answer in the answer area;

[0144] Multiple answer results in the answer area are determined based on the recognition results of multiple handwritten texts in the answer area;

[0145] The multiple answers in the answer area are matched with the standard answers in the answer area to obtain the matching results;

[0146] If the matching result indicates that at least one answer successfully matches the standard answer, then the answer in the answer area is determined to be correct.

[0147] The various units in the aforementioned handwritten content multi-candidate recognition device and test paper grading device applied to test paper grading can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each unit.

[0148] This application also provides an electronic device in its embodiments. (See reference...) Figure 9 The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 9 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0149] like Figure 9 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0150] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards, hard drives, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0151] This application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device enables the electronic device to implement any of the handwritten content multi-candidate recognition methods for test question grading provided in this application, and / or any test question grading method.

[0152] This application also provides a computer-readable storage medium carrying one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the handwritten content multi-candidate recognition methods for test paper grading provided in this application, and / or any test paper grading method.

[0153] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0154] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0155] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0156] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A method for recognizing multiple candidates of handwritten content applied to test paper grading, characterized in that, include: Obtain the answer image to be graded, the answer image including the question stem displayed in printed form and at least one answer area, the answer area including the answer result displayed in handwritten form; Text recognition is performed on the answer image to obtain the text recognition result of the answer image. In the recognition result of the answer image, the question stem displayed in printed form corresponds to one printed text recognition result, and the answer result displayed in handwritten form corresponds to multiple handwritten text recognition results.

2. The method according to claim 1, characterized in that, The step of performing text recognition on the response image to obtain the text recognition result of the response image includes: The answer image is input into an image text recognition model. The image text recognition model uses a first decoding strategy to decode the question stem displayed in printed form and a second decoding strategy to decode the answer result displayed in handwritten form, thereby obtaining the text recognition result of the answer image. The first decoding strategy uses a single main branch path for decoding, while the second decoding strategy uses multiple handwritten branch paths for parallel decoding.

3. The method according to claim 2, characterized in that, The text recognition results of the response image include: The text recognition results of each text line in the answer image; the text recognition results of each text line are marked with a preset handwritten text recognition result marker pair, and each handwritten text recognition result is distinguished by a preset handwritten marker pair. The handwritten text recognition result marker pair and the handwritten marker pair both include a start marker and an end marker.

4. The method according to claim 3, characterized in that, The process of decoding the printed question stem using a first decoding strategy and the process of decoding the handwritten answer using a second decoding strategy includes: For the current decoding position, determine whether the current decoding position corresponds to the decoding of handwritten text based on the handwritten markers in the decoded sequence; If the current decoding position corresponds to handwritten text decoding, then the second decoding strategy is used for decoding; otherwise, the first decoding strategy is used for decoding.

5. The method according to claim 4, characterized in that, The step of determining whether the current decoding position corresponds to handwritten text decoding based on handwritten markers in the decoded sequence includes: Determine whether there are incomplete handwritten mark pairs in the decoded sequence; If it exists, then the current decoding position corresponds to handwritten text decoding; if it does not exist, then the current decoding position corresponds to printed text decoding.

6. A method for grading test questions, characterized in that, include: The answer areas are graded one by one according to their order of appearance in the test questions to obtain the grading results for each answer area; each answer area corresponds to multiple handwritten text recognition results; the multiple handwritten text recognition results corresponding to the answer areas are obtained based on the handwritten content multi-candidate recognition method applied to test question grading as described in any one of claims 1 to 5; The grading result of the test question is determined based on the grading results of each of the answer areas.

7. The method according to claim 6, characterized in that, The following method is used to grade the answer area: Obtain the standard answer in the answer area; Multiple answer results in the answer area are determined based on the recognition results of multiple handwritten texts in the answer area; The multiple answers in the answer area are matched with the standard answers in the answer area to obtain the matching results; If the matching result indicates that at least one answer successfully matches the standard answer, then the answer in the answer area is determined to be correct.

8. A computer program product, characterized in that, The method includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the handwritten content multi-candidate recognition method for test item grading as described in any one of claims 1 to 5, and / or the test item grading method as described in any one of claims 6 to 7.

9. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program to enable the electronic device to implement the handwritten content multi-candidate recognition method for test paper grading as described in any one of claims 1 to 5, and / or the test paper grading method as described in any one of claims 6 to 7.

10. A computer-readable storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the handwritten content multi-candidate recognition method for test paper grading as described in any one of claims 1 to 5, and / or the test paper grading method as described in any one of claims 6 to 7.