Homework correcting method and device
Through text recognition and logical reasoning of multi-modal models, it solves the problems of database update difficulty and limited solution scope of homework correction in the existing technology, achieves efficient and accurate homework correction, and improves the user experience.
Patent Information
- Application Number
- CN202410357252.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-08-23
AI Technical Summary
Existing homework correction technology has problems such as difficulty in updating the database in real time, limited problem-solving scope, and problem-solving strategies that need to be updated in real time, resulting in slow correction speed and low accuracy.
By obtaining the question image for text recognition, the target matrix is generated, and the pre-trained multi-modal model is used for logical reasoning and correction, which improves the scope and accuracy of problem solving and adapts to problem-solving strategies for different types of questions.
The speed and accuracy of homework correction have been improved, and the compatibility with new question types has been enhanced. Users can instantly understand the answer situation and improve the user experience.
Smart Images

Figure CN118537874A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a homework grading method and device. Background Art
[0002] With the rapid development of computer technology, artificial intelligence has been widely used in the field of education. For example, it can automatically correct images taken by users and feed back the results to users so that users can know the status of their homework immediately. The current correction strategy is to search for the same questions in the database and correct them by comparing the user's answers with the answers in the database. However, this correction strategy requires a large amount of answer data to build a database, and it also needs to update the database in real time. It is very easy for the same questions to not exist in the database, and thus the problem of being unable to correct or incorrectly correcting them will occur. In addition, searching in a database containing a large amount of answer data will also reduce the correction speed to a certain extent. Summary of the invention
[0003] In order to solve the above technical problems, the present disclosure provides a homework grading method and device, which effectively improves the grading speed while ensuring the grading accuracy.
[0004] According to one aspect of the present disclosure, there is provided a homework marking method, comprising:
[0005] Acquire a question image, and perform text recognition on the question image to generate a text recognition result and a target matrix, wherein the target matrix is composed of the order of answer texts included in the question image;
[0006] Using the text recognition result and the question image as inputs of a pre-trained multimodal model to obtain an output result, wherein the output result includes the text to be corrected of the target question in the question image and the question type of the target question;
[0007] Determine a correction mode corresponding to the question type, and obtain a reference text based on the text to be corrected in the correction mode;
[0008] The reference text is compared with the answer text corresponding to the target question in the target matrix to generate a correction result for the target question.
[0009] According to another aspect of the present disclosure, there is provided a homework grading device, comprising:
[0010] An acquisition unit, used for acquiring a problem image to be calculated, wherein the problem image includes at least one operation symbol;
[0011] A calculation unit, used to calculate the target result of the question image by using a plurality of pre-trained auxiliary correction models corresponding to the operation symbols to obtain an output result;
[0012] The output result includes at least one formula and the target result, wherein the at least one formula represents the calculation steps for obtaining the target result, and the target result is obtained based on the target character combination in the at least one formula.
[0013] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory storing a program, wherein the program comprises instructions, which, when executed by the processor, enable the processor to execute the above-mentioned homework grading method.
[0014] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute a method for grading homework.
[0015] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-mentioned homework grading method when executed by a processor.
[0016] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0017] The problem image to be calculated is obtained, and the problem image includes at least one operation symbol; the target result of the problem image is calculated by using a large model of multiple auxiliary corrections that is pre-trained and corresponds to the operation symbol to obtain an output result; wherein the output result includes at least one formula and a target result, and the at least one formula represents the calculation steps for obtaining the target result, and the target result is obtained according to the target character combination in the at least one formula. The method provided by the present disclosure improves the calculation accuracy of the formula. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 A flow chart of a homework correction method provided by an embodiment of the present disclosure;
[0021] Figure 2 A schematic diagram of a topic image provided by an embodiment of the present disclosure;
[0022] Figure 3 A detailed flow chart of S102 in the homework grading method provided in an embodiment of the present disclosure;
[0023] Figure 4 A detailed flow chart of S103 in the homework grading method provided in an embodiment of the present disclosure;
[0024] Figure 5 A flow chart of another homework correction method provided by an embodiment of the present disclosure;
[0025] Figure 6 A schematic diagram of the structure of a homework correction device provided by an embodiment of the present disclosure;
[0026] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] In order to more clearly understand the above-mentioned purposes, features and advantages of the present disclosure, the embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be interpreted as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0029] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0032] At present, there are the following problems in homework marking:
[0033] (1) The problem of database needing real-time updating: The current grading strategy is to search for the same questions in the database and correct them by comparing the user's answers with the database answers. Therefore, a large amount of answer data is required to support the database. At the same time, it is also necessary to collect the latest questions and update the answers in real time. However, updating the answer database consumes a lot of manpower and material resources.
[0034] (2) Problems with limited scope of problem solving: Currently, the accuracy rate is relatively high for single, simple answers. However, for complex and diverse answers, or those that cannot be described in words, such as drawing questions and connecting lines, there is less support, or the answers are not exactly the same as those in the database, resulting in low accuracy.
[0035] (3) Problems where problem-solving strategies need to be updated in real time: For new question types that are different from those in the question bank, or variants of a certain question type, it is necessary to design corresponding problem-solving process strategies to support the question type.
[0036] In view of the above technical problems, the present application provides a method for correcting homework. After obtaining the image of the question to be corrected, the question image is recognized to obtain the recognition result and a matrix composed of the order of the answer text. Through the understanding ability related to the multimodal model, logical reasoning is performed based on the question image and the recognition result to obtain the problem-solving result. This multimodal method also has a certain reasoning ability for new question types, and is less affected by the scope of the problem-solving, which effectively improves the accuracy of the problem-solving. Subsequently, the answers in the matrix are corrected through the problem-solving results, and the correction accuracy is also relatively high, which is convenient for users to immediately understand the answer situation, and further improves the user experience. It is described in detail through the following embodiments.
[0037] Specifically, the homework grading method can be executed by a terminal or a server. Specifically, the terminal or the server can grade the question image through a large model of multiple auxiliary grading. The execution subject of the training method of the large model of multiple auxiliary grading and the execution subject of the homework grading method can be the same or different.
[0038] For example, in one application scenario, the server trains a large model for multiple auxiliary corrections. The terminal obtains the trained large model for multiple auxiliary corrections from the server, and the terminal corrects the title image through the trained large model for multiple auxiliary corrections. The title image may be an image captured by the terminal. Alternatively, the title image is obtained by the terminal from other devices. Alternatively, the title image is an image obtained by the terminal after performing image processing on a preset image, and the preset image may be captured by the terminal, or the preset image may be obtained by the terminal from other devices. Here, no specific limitation is made to other devices.
[0039] In another application scenario, the server trains a large model of multiple auxiliary corrections. Further, the server corrects the title image through the trained large model of multiple auxiliary corrections. The way the server obtains the title image can be similar to the way the terminal obtains the title image as described above, which will not be repeated here.
[0040] In another application scenario, the terminal trains a large model of multiple auxiliary corrections. Further, the terminal corrects the title image by using the trained large model of multiple auxiliary corrections.
[0041] It is understandable that the large model training methods and homework correction methods for various auxiliary corrections provided in the embodiments of the present disclosure are not limited to the several possible scenarios described above.
[0042] Figure 1 The flowchart of the homework grading method provided by the embodiment of the present disclosure is applied to the homework grading scenario and can be executed by the terminal. In one possible scenario, the user terminal takes a picture of the homework to be graded to obtain a title image, and uploads the title image to the terminal. The terminal grades the title image and feeds back the grading result to the user terminal. Specifically, the method includes: Figure 1 The following steps S101 to S104 are shown:
[0043] S101, obtaining a title image, and performing text recognition on the title image to generate a text recognition result and a target matrix.
[0044] The target matrix is composed of the order of the answer texts included in the question image.
[0045] It is understandable that the question image is obtained, for example, by using a camera configured by the learning device to photograph the user's homework to obtain the question image, and the question image includes at least one question, and the question can be at least one of the question types selected from the group consisting of a drawing question, a connection question, an application question, a fill-in-the-blank question, and a judgment question. It is understandable that the question image can be an image corrected from an initial captured image, or the question image is an initial captured image, which is not limited here. The following embodiment takes the question image as an example of a corrected image to illustrate a possible correction process, and other possible correction methods are not described in detail here. The correction process is: select a homework paper area from the captured image, the homework paper area refers to the area containing the question and the answer, which can be understood as the area obtained after removing the background part of the image; use a perspective transformation method to transform the homework paper area to obtain a neat question image, and the question image can be understood as a question interface / question page.
[0046] It is understandable that after obtaining the question image, the question image is subjected to text recognition to obtain a text recognition result containing the complete content of the question image, and at the same time, all the answer texts involved are matrixed during the recognition process to obtain a target matrix, which is composed of the answer texts according to the position order in the question image, so as to accurately locate the answer to the question in the subsequent correction process. This is explained in detail through the following embodiments.
[0047] Optionally, performing text recognition on the title image in S101 to generate a text recognition result and a target matrix may be specifically implemented through the following steps:
[0048] Detect text lines in the question image to obtain multiple text boxes that select each text line; determine the first position of a target text box containing answer text among the multiple text boxes in the question image, and perform a matrix operation on the first position and the answer text to generate a target matrix; perform text recognition on the multiple text boxes to generate a text recognition result.
[0049] It is understandable that the text lines of the preset number of lines in the question image are detected. Specifically, single-line detection or multi-line detection can be performed. Single-line detection refers to taking a line of text as the detection unit, and obtaining a text box that selects each text line. In this case, each text box selects a line of text. Multi-line detection refers to taking multiple lines of text as the detection unit, and obtaining a text box that selects multiple lines of text. Then, single-line detection can be continued on the basis of the text box. The specific number of text lines detected is not limited. After obtaining multiple text boxes, the target text box containing the answer text is determined from the multiple text boxes. In one possible case, only one text box containing the answer text is detected from the question image. In another possible case, the target text box and the remaining text boxes containing only the question text are detected from the question image. Subsequently, the first position of the target text box in the question image is determined, the first position is converted into a row and column position, and the answer text included in the target text box is associated with the row and column position. For example, the answer text is directly used as the content at the row and column position to generate a target matrix. In addition, after obtaining multiple text boxes, the first recognition model is used to perform text recognition on the multiple text boxes to obtain a complete text recognition result. The recognition model can use an optical character recognition method (Optical Character Recognition, OCR). Other methods that can achieve text recognition are not limited here and can be determined according to user needs.
[0050] The text lines include printed lines and handwritten lines.
[0051] Optionally, the above-mentioned detecting text lines in the title image to obtain multiple text boxes for selecting each text line can be specifically implemented by the following steps:
[0052] The printed body line and the handwritten body line in the title image are detected to obtain a printed body frame that selects the printed body line and a handwritten body frame that selects the handwritten body line; the printed body frame and the handwritten body frame located in the same text line are merged to obtain a mixed body frame; wherein the multiple text frames include the printed body frame and the mixed body frame that are not merged.
[0053] It is understandable that the text line can be further divided into a printed line and a handwritten line. The printed line can be understood as a question text line, and the handwritten line can be understood as an answer text line. Each text line includes at least one character. The printed line and the handwritten line are detected to obtain a printed frame that selects the printed line and a handwritten frame that selects the handwritten line containing the answer text. It is understandable that the handwritten line only includes handwriting (answer text) and does not include printed text (question text). Correspondingly, the printed line only includes printed text but does not include handwriting. This separate detection method can accurately distinguish between questions and answers, which is convenient for the subsequent construction of the target matrix. Subsequently, the overlap between the text boxes (IoU, Intersection over Union) is calculated or based on the position of each text box on the question image, the outer frames of the printed box and the handwritten box located in the same text line are merged to obtain a mixed box. The multiple text boxes include mixed boxes and unmerged printed boxes.
[0054] Optionally, the above-mentioned determining the first position of the target text box containing the answer text in the multiple text boxes in the question image, and performing a matrix operation on the first position and the answer text to generate a target matrix can be specifically implemented by the following steps:
[0055] The position of a target text box containing answer text among the multiple text boxes is determined as the first position in the question image, or the text boxes are sorted based on their positions in the question image, and the serial number of the target text box is determined as the first position; the row and column positions of the answer text are determined based on the first position and the second position of the answer text in the target text box; the row and column positions are associated with the answer text to generate a target matrix.
[0056] It is understandable that the position of the target text box in the question image is taken as the first position. For example, the position of the target text box in the question image can be determined according to the pixels or feature points contained in the target text box, or all text boxes can be sorted according to their positions in the question image, and the serial number of the target text box is taken as the first position. Subsequently, the number of answer texts included in the target text box is determined, or the number of handwriting boxes included in the target text box is counted, and the second position of the answer text in the target text box is determined. The second position can also be the specific position of the answer text in the target text box, or the serial number of the handwriting box in the target text box. A possible embodiment is to determine the third position of the answer text framed by the handwriting box based on the first position of the target text box in the question image and the second position of the handwriting box in the target text box. The third position can be understood as the row and column position in the target matrix. Subsequently, the third position is associated with the answer text to generate a target matrix, in which the answer text and the corresponding target text box can be accurately determined based on the row and column positions, and then the question selected by the target text box can be locked, or the row and column positions can be directly associated with the target question selected by the target text box for quick positioning.
[0057] For example, see Figure 2 , Figure 2 A schematic diagram of a title image provided in an embodiment of the present disclosure, title image 1 is a detection schematic diagram obtained after single-line detection, title image 1 includes multiple handwritten frames and multiple printed frames, and the overlap of the printed frames and handwritten frames included in each row is calculated to obtain a mixed frame as shown in title image 2, for example, the handwritten frame 11 and the printed frame 12 are merged to obtain a mixed frame 21, and the handwritten frame 13, the handwritten frame 14 and the printed frame 15 are merged to obtain a mixed frame 22. As shown in the question image 2, the serial number of the hybrid frame 21 in the question image is 1, that is, the first position is 1, and the serial number of the handwritten frame 11 in the hybrid frame 21 is 1, that is, the second position is 1. Then, according to the first position and the second position, the row and column position of the answer text in the handwritten frame 11 can be determined to be 1A, which can be expressed as 1A=AA in the matrix, which can be understood as the answer content of the first row and the first column is AA. Similarly, the matrix obtained based on the hybrid frame 22 is expressed as 2A=BB, 2B=CC, which can be understood as the answer content of the second row and the first column is BB, and the answer content of the second row and the second column is CC, that is, there are two handwritten answers in the third row, BB and CC respectively, and the sorting result in the target matrix can be expressed as (AA, BB-CC).
[0058] S102: Using the text recognition result and the title image as inputs of a pre-trained multimodal model to obtain an output result.
[0059] The output result includes the text to be corrected of the target question in the question image and the question type of the target question.
[0060] It can be understood that, based on the above S101, the text recognition result and the question image are used as the input of a pre-trained multimodal model to obtain an output result. The multimodal model can use the MathGPT model as a basis. The multimodal model can process different modal data such as text, image and / or video. The multimodal model is used to divide large questions and classify questions. Among them, the output result of the multimodal model includes the text to be corrected of the target question in the question image and the question type of the target question. The target question refers to a question in the question image, or a question to be corrected selected by the user from the question image. The text to be corrected may include the answer text and the question text, or may only include the question text.
[0061] S103: Determine a correction mode corresponding to the question type, and obtain a reference text based on the text to be corrected in the correction mode.
[0062] It is understandable that, based on the above S102, different question types correspond to different grading modes, and the various grading strategies set can be applied to different question types to increase the scope of problem solving and grading compatibility. Determine the grading mode corresponding to the question type, and generate a reference text based on the text to be corrected in the grading mode, or directly generate the grading result in the grading mode, wherein the grading mode includes a database search mode and a deductive problem solving mode.
[0063] S104: Compare the reference text with the answer text corresponding to the target question in the target matrix to generate a correction result for the target question.
[0064] It can be understood that, based on the above S101 and S103, the answer text corresponding to the target question is determined in the target matrix. Based on the above example, if the target question is the first question, AA can be determined as the answer text of the target question. After obtaining the reference text, the reference text and the answer text are compared to generate the correction result of the target question. The correction result can include information such as whether the answer is right or wrong, the correct answer, and the problem-solving process.
[0065] The homework grading method provided by the present application improves the efficiency of locating the answers to questions by constructing a matrix composed of the order of answer texts; divides and classifies questions and extracts question information displayed in different forms through a multimodal model, thereby effectively improving the scope of problem solving; sets different problem-solving strategies based on different question types, and performs grading with more suitable problem-solving strategies, which can also improve the accuracy of grading to a certain extent; utilizes the wide adaptability and reasoning ability of the large model, and performs problem solving by performing logical reasoning on the grading text, which can understand similar or new question types, has stronger compatibility, and effectively improves the scope of problem solving and the accuracy of problem solving; and quickly and accurately feeds back the grading results to the user, effectively improving the user experience.
[0066] Figure 3 The detailed flow chart of S102 in the homework grading method provided in the embodiment of the present disclosure, wherein the text recognition result and the question image are used as the input of the pre-trained multimodal model to obtain the output result, specifically including the following: Figure 3 The following steps S301 to S302 are shown:
[0067] S301 , associating an image region of a target question in the question image with a corresponding text region in the text recognition result to obtain question data of the target question.
[0068] It can be understood that the image area of the target question in the question image and the text area corresponding to the target question in the text recognition result are associated to obtain the question data of the target question. For graphic and text questions, the text recognition results include the question text and the answer text, and the question image includes the graphics involved in the target question. In this case, the image area and the text area are associated, and the graphic questions involved in the image area can be translated into text-type questions through a multimodal model to facilitate subsequent reasoning. This conversion method between modalities can correct a variety of question types and effectively increase the scope of problem solving.
[0069] S302: Identify the type of the target topic based on the topic data, and call a recognition model corresponding to the topic type to generate a text to be corrected for the target topic based on the topic data.
[0070] It can be understood that, based on the above S301, the question data is identified to determine the question type of the target question, and the question type includes a first type and a second type. The first type can be understood as the data type of the question, such as pure text data, graphic data, and mixed graphic and text data, etc. The second type can be understood as the type of problem solving of the question. After determining the question type, the second recognition model corresponding to the question type is called to generate the text to be corrected of the target question based on the question data, and the text to be corrected is used for subsequent generation of reference text.
[0071] The topic data also includes the hierarchical relationship between the target topic and other topics in the topic image except the target topic.
[0072] It is understandable that the question data also includes the hierarchical relationship or level relationship between questions. The hierarchical relationship refers to the situation where a large question contains small questions. For example, an application question includes multiple small questions. The hierarchical relationship can be obtained by dividing the questions through a multimodal model. Specifically, the hierarchical relationship includes the correlation relationship between the target question and the remaining questions.
[0073] Optionally, in the case where the various topics included in the topic image have a hierarchical relationship, the above-mentioned calling the recognition model corresponding to the topic type to generate the text to be corrected of the target topic based on the topic data can be specifically implemented by the following steps:
[0074] The recognition model corresponding to the question type is called to generate an initial text based on the question data; the fill-in text corresponding to the target question is obtained from the remaining questions based on the hierarchical relationship, wherein the fill-in text refers to the shared information between all questions at the same level; and the text to be corrected of the target question is generated according to the initial text and the fill-in text.
[0075] It is understandable that the multimodal model also includes multiple second recognition models, which are used to recognize texts of different question types. The second recognition model corresponding to the question type is called to perform text and / or graphic recognition based on the question data to generate initial text.
[0076] Understandably, one possible situation is to obtain the fill-in text corresponding to the target question from the remaining questions based on the hierarchical relationship. The fill-in text refers to the shared information between all questions at the same level as the target question and at this level. For example, the target question is the third question in the big question, and the text involved in the third question is related to a text in the second question. Then, a text in the second question is used as the fill-in text for the third question, so as to obtain the complete text to be corrected for the target question based on the initial text and the fill-in text, so as to facilitate the subsequent generation of the reference text directly based on the text to be corrected, that is, to obtain the fill-in text from the remaining questions before correction.
[0077] Optionally, a second recognition model corresponding to the question type is called to generate an initial text based on the question data, and the hierarchical relationship and the initial text are associated to obtain the text to be corrected, so as to obtain a reference text based on the text to be corrected in the correction mode.
[0078] Understandably, another possible situation is that after obtaining the initial text, the hierarchical relationship is associated with the initial text to obtain the text to be corrected of the target question, or the initial text of the target question is associated with the initial texts of the remaining questions based on the hierarchical relationship to obtain the text to be corrected of the target question. Subsequently, when correcting the text to be corrected, the reference text of the target question is obtained based on the initial text of the target question and the initial texts of the remaining questions, that is, the filler text is obtained from the remaining questions during the correction process.
[0079] It is understandable that, when there is no hierarchical relationship between the various topics included in the topic image, the second recognition model corresponding to the topic type is called to generate the text to be corrected based on the topic data.
[0080] Among them, the topic type includes the first type.
[0081] It can be understood that the topic type includes a first type, and the first type refers to the data mode included in the topic information of the target topic, for example, the topic information includes both text and graphics, or the topic information only includes text or graphics.
[0082] Optionally, the above-mentioned calling the recognition model corresponding to the question type to generate the initial text based on the question data, or calling the recognition model corresponding to the question type to generate the text to be corrected based on the question data, can be specifically implemented by the following steps:
[0083] In the case where the first type is a text question, a pre-trained text recognition model is called to generate an initial text of the target question based on the question data; or, in the case where the first type is a graphic question, a pre-trained graphic recognition model is called to generate the initial text based on the question data; or, in the case where the first type is a graphic-text question, the initial text is obtained by calling the graphic recognition model to generate a first text based on the image area and calling the text recognition model to generate a second text based on the text area; or, a pre-trained graphic-text recognition model is called to generate the initial text based on the question data.
[0084] It is understandable that in the case where the first type is a text question, that is, the question information is displayed in the form of text, such as fill-in-the-blank questions and true-or-false questions, in this case, calling a pre-trained text recognition model to generate the target question's text to be corrected based on the question data can be understood as performing text recognition again, and the text to be corrected is the text recognition result. The text area in the text recognition result can also be directly used as the text to be corrected. In the case where the first type is a graphic question, that is, the question information is displayed in the form of a graphic, such as a connection question and a box selection question, in this case, the graphic recognition model is called to perform recognition based on the image area in the question information, and the graphic recognition result and the recognition result included in the text area are combined to generate the initial text. In the case where the first type is a graphic question, that is, the question information is displayed through text and graphics, such as a geometry question, in this case, the graphic recognition model is called to generate the initial text based on the question data, or the graphic recognition model is called to generate the first text based on the image area, and the text recognition model is called to generate the second text based on the text area, and then the initial text is generated according to the first text and the second text.
[0085] The homework grading method provided in the present application takes the question image and text recognition results as the input of the multimodal model, and outputs the question type, the text to be graded, and the hierarchy of the large question containing the small questions through the multimodal model. The descriptive text of the graphic question can be extracted to generate the text to be graded, which is convenient for the subsequent grading of different question types, effectively improves the scope of problem solving, and eliminates the need to detect the model of the large question and compare the answers to obtain the question type, thereby improving the grading efficiency to a certain extent.
[0086] Figure 4 This is a detailed flow chart of S103 in the homework grading method provided by the embodiment of the present disclosure, wherein determining the grading mode corresponding to the question type and obtaining the reference text based on the to-be-graded text in the grading mode specifically includes the following steps: Figure 4 The following steps S401 to S402 are shown:
[0087] Wherein, the question type includes the second type.
[0088] It is understandable that the question type also includes the second type, which refers to the problem-solving method. The second type includes calculation type and reasoning type. For example, when solving a problem, multiple reasonings are required to obtain a reference answer, or only calculations are required to obtain a reference answer, and calculations may also be involved in the reasoning process.
[0089] S401: When the second type is a calculation type, call a calculation plug-in to perform calculation based on the text to be corrected to obtain the reference text.
[0090] It is understandable that when the second type is a calculation type, such as oral arithmetic questions and formula questions, in this case, the calculation plug-in is called to perform calculations based on the text to be corrected to obtain a reference text, that is, the plug-in can be called to call a mature oral arithmetic correction service for all oral arithmetic questions and obtain an oral arithmetic correction result, which can be a reference text or a correction result of whether it is correct or not. Among them, the oral arithmetic correction service supports corrections such as horizontal and vertical forms, escaped forms, equation solving, and unit conversion.
[0091] S402: When the second type is an inference type, search for a question sample corresponding to the text to be corrected in a pre-constructed database, and obtain the reference text according to the answer to the question sample; or, when the question sample is not found, call a pre-trained correction model to obtain the reference text based on the text to be corrected.
[0092] It is understandable that when the second type is a reasoning type, such as application, choice, fill-in-the-blank, true or false questions, etc., in this case, the question bank search plug-in is called to search the database for question samples corresponding to the text to be corrected. The question sample can be completely the same or partially the same as the text to be corrected. Specifically, the similarity between the question sample and the text to be corrected can be calculated, and the reference answer can be further obtained based on the answer to the question sample. When the question sample is not found in the database, or when it is determined that the second type is a reasoning type, a pre-trained correction model is called to correct the text to be corrected and output a reference text. At least one correction method of question bank search and model correction can be performed.
[0093] In a possible implementation, the target question is multiple choice, fill-in-the-blank or judgment, and a question bank search plug-in is called. The plug-in can be an application programming interface (API). If the database has the same question sample and correct answer (reference answer) as the text to be corrected, the reference answer can be compared with the answer text in the target matrix and the correction result can be returned. If no question sample is found, the correction model for multiple choice, fill-in-the-blank and judgment in MathGPT is called to correct the text to be corrected, output the reference answer, and compare it with the answer text to obtain the correct or not correction result, and at the same time, the information such as the text to be corrected, the question image and the reference answer are associated and stored in the question bank.
[0094] Among them, the reasoning type includes application questions.
[0095] Optionally, the above-mentioned comparing the reference text with the answer text corresponding to the target question in the target matrix to generate the correction result of the target question can be specifically achieved through the following steps:
[0096] The reference text and the answer text corresponding to the target question are semantically analyzed by using a pre-trained application question model to determine whether the answer text and the reference text have the same semantics, and a determination result is output; and a grading result for the target question is generated based on the determination result.
[0097] Understandably, when the target question is of the reasoning type and is an applied question in the reasoning type, the question bank search plug-in is called. If there are question samples and correct answers (standard answers / answer texts) corresponding to the text to be corrected in the question bank, the applied question model is used to determine whether the answer text in the target matrix and the reference answer have the same semantics, that is, to determine whether the handwritten answer and the standard answer have the same meaning. For example, the standard answer is "Xiaohong has a total of 5 apples", and the handwritten answer is "The one with 5 apples is Xiaohong". Through semantic analysis by the applied question model, the judgment result that the handwritten answer and the standard answer have the same semantics can be output, and the correction result is generated according to the judgment result. The correction result includes whether the target question is written correctly and whether the target question is written incorrectly.
[0098] Understandably, for word problems, if no question sample is found in the question bank, use the word problem solving plug-in to analyze step by step through the thinking chain, and when calculating numbers, call the calculation plug-in to obtain the calculation results, and finally perform the next step of analysis until the final result is obtained (reference text).
[0099] It can be understood that for connection questions, picture-based topic questions, and geometry questions, the graphics in the questions are converted into text through the recognition model to obtain descriptive text. For example, connection questions are converted into a connecting b, c connecting d, etc., geometry questions have descriptive text about auxiliary lines, and picture-based topic questions have descriptive text about graphics. The recognition model generates the text to be corrected for the question based on the descriptive text and the recognized text in the text recognition results.
[0100] The homework grading method provided in this application provides a variety of grading strategies. By combining the basic grading strategy with the large model grading strategy, when the same question cannot be found in the question bank, the model grading method can also be used to ensure that the homework grading can be completed. In addition, the grading accuracy can be improved by verifying the grading results of multiple correction strategies.
[0101] Based on the above embodiments, Figure 5 Another flow chart of a homework grading method provided by an embodiment of the present disclosure is applied to a scenario in which a user shoots homework using a front camera of a learning machine, and specifically includes the following process:
[0102] (1) Obtain the captured question image and perform document correction on the question image; (2) Detect the printed text lines and handwritten text lines in the corrected question image, and merge the outer frames of the printed text frame and the handwritten text frame located in the same text line through a row-forming algorithm, and sort them from top to bottom according to the order of the handwritten text lines to obtain a target matrix; (3) Recognize each text line in the question image through a text recognition model to obtain a full-page text recognition text; (4) Use the text recognition result and the question image as input to the multimodal model, split the question through the multimodal model, separate the full page of text according to the large questions to determine the hierarchical relationship between the questions, and mark the question type of each question to obtain the text to be corrected for each question; (5) Call different correction models according to the question type for classified correction, and execute the corresponding steps in (6)-(8) to obtain the correction result; (6) If the question type is an oral calculation question, call the calculation plug-in, and returns the correction result; (7) If the question type is multiple choice, fill-in-the-blank, true or false, connection question, geometry question, and picture description question, call the question bank search plug-in. If the same question and correct answer exist in the question bank, compare the correct answer with the handwritten answer in the target matrix and return the correction result; or, call the correction model to correct the text to be corrected and return the correction result; (8) If the question type is an application question, call the question bank search plug-in. If the same question and correct answer exist in the question bank, use the application question model to determine whether the correct answer and the handwritten answer have the same meaning and return the correction result; or, use the application question solving plug-in to perform step-by-step analysis through the thinking chain. When calculation is involved, call the calculation plug-in to obtain the calculation result for subsequent analysis, and use the application result to compare with the handwritten answer and return the correction result; (9) Write the question-related information into the question bank.
[0103] It is understandable that the specific implementation instructions involved in the above-mentioned homework correction method can be found in the above-mentioned embodiment, which will not be repeated here.
[0104] Figure 6 This is a schematic diagram of the structure of a homework grading device provided in an embodiment of the present disclosure. The homework grading device is applied to a server. The device 600 is used to execute the above-mentioned homework grading method. The device 600 specifically includes an acquisition unit 601, an identification unit 602, a grading unit 603 and a generation unit 604, wherein:
[0105] The acquisition unit 601 is used to acquire a question image, and perform text recognition on the question image to generate a text recognition result and a target matrix, wherein the target matrix is composed of the order of the answer texts included in the question image;
[0106] The recognition unit 602 is used to use the text recognition result and the question image as inputs of a pre-trained multimodal model to obtain an output result, wherein the output result includes the text to be corrected of the target question in the question image and the question type of the target question;
[0107] A correction unit 603, configured to determine a correction mode corresponding to the question type, and obtain a reference text based on the text to be corrected in the correction mode;
[0108] The generating unit 604 is used to compare the reference text with the answer text corresponding to the target question in the target matrix to generate a correction result of the target question.
[0109] Optionally, the acquiring unit 601 is used to:
[0110] Detecting text lines in the title image and obtaining a plurality of text boxes for selecting each text line;
[0111] Determine a first position of a target text box containing answer text in the plurality of text boxes in the question image, and perform a matrix operation on the first position and the answer text to generate a target matrix;
[0112] Perform text recognition on the multiple text boxes to generate text recognition results.
[0113] Optionally, the text lines in device 600 include printed lines and handwritten lines.
[0114] Optionally, the acquiring unit 601 is used to:
[0115] Detecting the printed body line and the handwritten body line in the title image, and obtaining a printed body frame that selects the printed body line and a handwritten body frame that selects the handwritten body line;
[0116] Merging the printed body frame and the handwritten body frame located in the same text line to obtain a mixed body frame;
[0117] The multiple text boxes include the printed box and the mixed box that are not merged.
[0118] Optionally, the acquiring unit 601 is used to:
[0119] Determine the position of a target text box containing answer text among the multiple text boxes in the question image as the first position, or, sort the text boxes based on the position of each text box in the question image, and determine the sequence number of the target text box as the first position;
[0120] Determine the row and column position of the answer text based on the first position and the second position of the answer text in the target text box;
[0121] The row and column positions are associated with the answer text to generate a target matrix.
[0122] Optionally, the identification unit 602 is used for:
[0123] Associating an image region of a target question in the question image with a corresponding text region in the text recognition result to obtain question data of the target question;
[0124] The topic type of the target topic is identified based on the topic data, and a recognition model corresponding to the topic type is called to generate a text to be corrected of the target topic based on the topic data.
[0125] Optionally, the topic data in the device 600 further includes a hierarchical relationship between the target topic and other topics in the topic image except the target topic.
[0126] Optionally, the identification unit 602 is used for:
[0127] Calling the recognition model corresponding to the question type to generate an initial text based on the question data;
[0128] Acquire filler text corresponding to the target topic from the remaining topics based on the hierarchical relationship, wherein the filler text refers to shared information between all topics at the same level;
[0129] The text to be corrected of the target topic is generated according to the initial text and the fill-in text.
[0130] Optionally, the topic type in the device 600 includes a first type.
[0131] Optionally, the identification unit 602 is used for:
[0132] In the case where the first type is a text question, calling a pre-trained text recognition model to generate an initial text of the target question based on the question data; or,
[0133] In the case where the first type is a graphic question, calling a pre-trained graphic recognition model to generate the initial text based on the question data; or,
[0134] In the case where the first type is a picture-text question, the initial text is obtained by calling the graphic recognition model to generate a first text based on the image area and calling the text recognition model to generate a second text based on the text area; or, calling a pre-trained picture-text recognition model to generate the initial text based on the question data.
[0135] Optionally, the topic type in the device 600 includes the second type.
[0136] Optionally, the correction unit 603 is used to:
[0137] In the case where the second type is a calculation type, calling a calculation plug-in to perform calculation based on the text to be corrected to obtain the reference text;
[0138] When the second type is the reasoning type, a question sample corresponding to the text to be corrected is searched in a pre-constructed database, and the reference text is obtained according to the answer to the question sample; or, a pre-trained correction model is called to obtain the reference text based on the text to be corrected.
[0139] Optionally, the reasoning type in the device 600 includes application questions.
[0140] Optionally, the generating unit 604 is used for:
[0141] Performing semantic analysis on the reference text and the answer text corresponding to the target question through a pre-trained application question model to determine whether the answer text and the reference text have the same semantics, and outputting a determination result;
[0142] The correction result of the target question is generated according to the judgment result.
[0143] The implementation principle and technical effects of the device provided in this embodiment are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0144] The exemplary embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and the computer program is used to cause the electronic device to perform the method according to the embodiment of the present disclosure when executed by the at least one processor.
[0145] The exemplary embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor of a computer, the computer is used to enable the computer to perform the method according to the embodiments of the present disclosure.
[0146] refer to Figure 7 , a block diagram of an electronic device 700 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0147] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0148] A plurality of components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 may be any type of device capable of inputting information to the electronic device 700, and the input unit 706 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 707 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 704 may include, but is not limited to, a disk, an optical disk. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0149] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above. For example, in some embodiments, the homework correction method or the training method of the large model of multiple auxiliary corrections may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via the ROM 702 and / or the communication unit 709. In some embodiments, the computing unit 701 may be configured to perform the homework correction method or the training method of the large model of multiple auxiliary corrections by any other appropriate means (e.g., by means of firmware).
[0150] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0151] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0152] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0153] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0154] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0155] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and the server relationship is generated by computer programs running on respective computers and having a client-server relationship with each other.
[0156] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A homework marking method, characterized in that: include: Acquire a question image, and perform text recognition on the question image to generate a text recognition result and a target matrix, wherein the target matrix is composed of the order of answer texts included in the question image; Using the text recognition result and the question image as inputs of a pre-trained multimodal model to obtain an output result, wherein the output result includes the text to be corrected of the target question in the question image and the question type of the target question; Determine a correction mode corresponding to the question type, and obtain a reference text based on the text to be corrected in the correction mode; The reference text is compared with the answer text corresponding to the target question in the target matrix to generate a correction result for the target question.
2. The method according to claim 1, characterized in that The performing text recognition on the title image to generate a text recognition result and a target matrix includes: Detecting text lines in the title image and obtaining a plurality of text boxes for selecting each text line; Determine a first position of a target text box containing answer text in the plurality of text boxes in the question image, and perform a matrix operation on the first position and the answer text to generate a target matrix; Perform text recognition on the multiple text boxes to generate text recognition results.
3. The method according to claim 2, characterized in that The text lines include printed lines and handwritten lines. The detecting of the text lines in the title image to obtain a plurality of text boxes for selecting each text line includes: Detecting the printed body line and the handwritten body line in the title image, and obtaining a printed body frame that selects the printed body line and a handwritten body frame that selects the handwritten body line; Merging the printed body frame and the handwritten body frame located in the same text line to obtain a mixed body frame; The multiple text boxes include the printed box and the mixed box that are not merged.
4. The method according to claim 2, characterized in that: The step of determining the first position of a target text box containing answer text in the plurality of text boxes in the question image, and performing a matrix operation on the first position and the answer text to generate a target matrix comprises: Determine the position of a target text box containing answer text among the multiple text boxes in the question image as the first position, or, sort the text boxes based on the position of each text box in the question image, and determine the sequence number of the target text box as the first position; Determine the row and column position of the answer text based on the first position and the second position of the answer text in the target text box; The row and column positions are associated with the answer text to generate a target matrix.
5. The method according to claim 1, characterized in that The text recognition result and the title image are used as inputs of a pre-trained multimodal model to obtain an output result, including: Associating an image region of a target question in the question image with a corresponding text region in the text recognition result to obtain question data of the target question; The topic type of the target topic is identified based on the topic data, and a recognition model corresponding to the topic type is called to generate a text to be corrected of the target topic based on the topic data.
6. The method according to claim 5, characterized in that The topic data also includes a hierarchical relationship between the target topic and other topics in the topic image except the target topic, and calling the recognition model corresponding to the topic type to generate a text to be corrected of the target topic based on the topic data includes: Calling the recognition model corresponding to the question type to generate an initial text based on the question data; Acquire filler text corresponding to the target topic from the remaining topics based on the hierarchical relationship, wherein the filler text refers to shared information between all topics at the same level; The text to be corrected of the target topic is generated according to the initial text and the fill-in text.
7. The method according to claim 5, characterized in that The topic type includes a first type, and the calling of a recognition model corresponding to the topic type to generate an initial text based on the topic data includes: In the case where the first type is a text question, calling a pre-trained text recognition model to generate an initial text of the target question based on the question data; or, In the case where the first type is a graphic question, calling a pre-trained graphic recognition model to generate the initial text based on the question data; or, In the case where the first type is a picture-text question, the initial text is obtained by calling the graphic recognition model to generate a first text based on the image area and calling the text recognition model to generate a second text based on the text area; or, calling a pre-trained picture-text recognition model to generate the initial text based on the question data.
8. The method according to claim 1, characterized in that: The topic type includes a second type, and determining a correction mode corresponding to the topic type and obtaining a reference text based on the text to be corrected in the correction mode includes: In the case where the second type is a calculation type, calling a calculation plug-in to perform calculation based on the text to be corrected to obtain the reference text; When the second type is the reasoning type, a question sample corresponding to the text to be corrected is searched in a pre-constructed database, and the reference text is obtained according to the answer to the question sample; or, a pre-trained correction model is called to obtain the reference text based on the text to be corrected.
9. The method according to claim 8, characterized in that The reasoning type includes application questions, and the comparison between the reference text and the answer text corresponding to the target question in the target matrix to generate the correction result of the target question includes: Performing semantic analysis on the reference text and the answer text corresponding to the target question through a pre-trained application question model to determine whether the answer text and the reference text have the same semantics, and outputting a determination result; The correction result of the target question is generated according to the judgment result.
10. A homework grading device, characterized in that: include: An acquisition unit, used to acquire a question image, and perform text recognition on the question image to generate a text recognition result and a target matrix, wherein the target matrix is composed of the order of the answer texts included in the question image; A recognition unit, used to use the text recognition result and the question image as inputs of a pre-trained multimodal model to obtain an output result, wherein the output result includes the text to be corrected of the target question in the question image and the question type of the target question; A correction unit, used for determining a correction mode corresponding to the question type, and obtaining a reference text based on the text to be corrected in the correction mode; A generating unit is used to compare the reference text with the answer text corresponding to the target question in the target matrix to generate a correction result of the target question.
Citation Information
Patent Citations
Question assisting method and system
CN109815955A
Exercise identification method and device, electronic equipment and storage medium
CN111507330A
Automatic homework correcting method and device, electronic equipment and storage medium
CN111753767A
Education question automatic correction method and device and electronic equipment
CN113407675A
Question judgment method and device, electronic equipment and medium
CN113792133A
Cited By
Homework grading method and apparatus
WO2025200929A1
