Text recognition method and device based on text correction model
By combining OCR with a text correction model and taking into account the context of the text, the OCR recognition results are corrected, solving the problem of low OCR recognition rate and achieving higher recognition accuracy and less manual intervention.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2023-07-24
- Publication Date
- 2026-07-24
AI Technical Summary
Existing OCR recognition technology is prone to destroying the correlation information between texts during the recognition process, resulting in low recognition rates and requiring a lot of manual intervention. Improving recognition accuracy is the main research direction.
By combining OCR text recognition technology with a text correction model, and taking into account the context of the text, the text correction model is used to correct the OCR recognition results, thereby improving the recognition accuracy.
It improves the accuracy of OCR text recognition, reduces manual intervention, and saves labor costs and time.
Smart Images

Figure CN116912833B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of character recognition, and can also be used in the financial field. Specifically, it relates to a character recognition method and apparatus based on a text error correction model. Background Technology
[0002] With the development and maturation of OCR (Optical Character Recognition) technology, OCR text recognition technology is being used in more and more situations. However, many factors affect the OCR recognition rate, including the quality of the printed text, the standardization of handwritten fonts, and the quality of the image acquisition equipment. Statistics show that the overall recognition rate for printed text can reach 95%, and for handwritten text, it's 90%. OCR recognition accuracy is a key indicator of OCR technology. A high OCR false recognition rate often requires more manual intervention, impacting efficiency and wasting labor costs. Therefore, improving the OCR recognition rate is currently the main research direction for OCR recognition development.
[0003] The inventors discovered that existing OCR recognition methods divide images containing text into regions, perform text recognition on the segmented images containing individual text, and finally integrate the recognition results into complete text content. This text recognition method greatly reduces the difficulty of training and implementing OCR recognition models, but it also destroys the correlation information between different texts. Summary of the Invention
[0004] To address the problems in the prior art, this application provides a text recognition method and apparatus based on a text error correction model, which can effectively improve the accuracy of text recognition.
[0005] To solve at least one of the above problems, this application provides the following technical solution:
[0006] Firstly, this application provides a character recognition method based on a text error correction model, comprising:
[0007] The target image is segmented, and optical character recognition is performed on the segmented target image to obtain the initial text recognition result.
[0008] Based on the initial text recognition result and the set text correction model, the target text recognition result is obtained, wherein the text correction model includes the correlation between each character in the initial text recognition result.
[0009] Further, obtaining the target text recognition result based on the initial text recognition result and the set text correction model includes:
[0010] The correlation between each character in the initial text recognition result is determined based on the established text error correction model;
[0011] The target text recognition result is determined based on the recognition probability of each character in the initial text recognition result and the correlation relationship.
[0012] Further, determining the target text recognition result based on the recognition probability of each character in the initial text recognition result and the association relationship includes:
[0013] Obtain the recognition probability of each character in the initial text recognition result, and determine the error correction parameters of the recognition probability according to the correlation between each character in the set text error correction model;
[0014] The target text recognition result is determined based on the error correction parameters and the recognition probability of each character.
[0015] Furthermore, the step of determining the error correction parameters for the recognition probability based on the correlation between each character in the set text error correction model includes:
[0016] Determine if the correlation between two adjacent characters in the set text correction model is greater than a threshold;
[0017] If so, then the error correction parameter of the recognition probability is determined to be a positive value.
[0018] Furthermore, the step of determining the error correction parameters for the recognition probability based on the correlation between each character in the set text error correction model includes:
[0019] Determine if the correlation between two adjacent characters in the set text correction model is less than a threshold;
[0020] If so, then the error correction parameter of the recognition probability is determined to be negative.
[0021] Further, determining the target text recognition result based on the error correction parameters and the recognition probability of each character includes:
[0022] The recognition probability of each character is corrected according to the error correction parameters;
[0023] The target text recognition result is determined based on the corrected recognition probability.
[0024] Furthermore, after obtaining the target text recognition result based on the initial text recognition result and the set text correction model, the method further includes:
[0025] Determine if this is the last character to be recognized;
[0026] If so, then end the current text recognition operation.
[0027] Secondly, this application provides a character recognition device based on a text error correction model, comprising:
[0028] The segmentation and recognition module is used to perform image segmentation processing on the target image, and to perform optical character recognition on the target image after image segmentation processing to obtain an initial text recognition result.
[0029] The text correction module is used to obtain the target text recognition result based on the initial text recognition result and the set text correction model, wherein the text correction model includes the correlation between each character in the initial text recognition result.
[0030] Furthermore, the text correction module includes:
[0031] The relationship determination unit is used to determine the relationship between each character in the initial text recognition result according to the set text error correction model;
[0032] The target recognition unit is used to determine the target text recognition result based on the recognition probability of each character in the initial text recognition result and the association relationship.
[0033] Furthermore, the target identification unit includes:
[0034] The error correction parameter determination subunit is used to obtain the recognition probability of each character in the initial text recognition result and determine the error correction parameters of the recognition probability according to the correlation between each character in the set text error correction model.
[0035] The target result recognition subunit is used to determine the target text recognition result based on the error correction parameters and the recognition probability of each character.
[0036] Furthermore, the error correction parameter determination subunit includes:
[0037] The first threshold judgment subunit is used to determine whether the correlation between two adjacent characters in the set text correction model is greater than the threshold.
[0038] The first parameter determines the subunit, which is used to determine that the error correction parameter of the recognition probability is positive if it is positive.
[0039] Furthermore, the error correction parameter determination subunit includes:
[0040] The second threshold judgment subunit is used to determine whether the correlation between two adjacent characters in the set text correction model is less than the threshold.
[0041] The second parameter determines the subunit, which is used to determine that the error correction parameter of the recognition probability is negative if it is true.
[0042] Furthermore, the error correction parameter determination subunit includes:
[0043] A probability correction subunit is used to correct the recognition probability of each character according to the error correction parameters;
[0044] The probability determination subunit is used to determine the target text recognition result based on the corrected recognition probability.
[0045] Furthermore, the text correction module also includes:
[0046] The end judgment unit is used to determine whether it is the last character to be recognized;
[0047] The recognition result unit is used to end the current text recognition operation if the result is yes.
[0048] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the text recognition method based on the text error correction model.
[0049] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the text recognition method based on the text error correction model.
[0050] Fifthly, this application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the text recognition method based on the text error correction model.
[0051] As can be seen from the above technical solution, this application provides a text recognition method and device based on a text correction model. By organically combining OCR text recognition technology with a text correction model, and by comprehensively considering the context of the text, the OCR text recognition rate is improved. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 This is one of the flowcharts illustrating the text recognition method based on a text correction model in the embodiments of this application;
[0054] Figure 2 This is the second flowchart illustrating the text recognition method based on a text correction model in the embodiments of this application;
[0055] Figure 3 This is the third flowchart illustrating the text recognition method based on a text correction model in the embodiments of this application;
[0056] Figure 4 This is the fourth flowchart illustrating the text recognition method based on a text correction model in the embodiments of this application;
[0057] Figure 5 This is the fifth flowchart illustrating the text recognition method based on a text correction model in the embodiments of this application;
[0058] Figure 6 This is the sixth flowchart illustrating the text recognition method based on a text correction model in the embodiments of this application;
[0059] Figure 7 This is the seventh flowchart illustrating the text recognition method based on a text correction model in the embodiments of this application;
[0060] Figure 8 This is one of the structural diagrams of the character recognition device based on the text error correction model in the embodiments of this application;
[0061] Figure 9 This is the second structural diagram of the character recognition device based on the text error correction model in the embodiments of this application;
[0062] Figure 10 This is the third structural diagram of the text recognition device based on the text error correction model in the embodiments of this application;
[0063] Figure 11 This is the fourth structural diagram of the character recognition device based on the text error correction model in the embodiments of this application;
[0064] Figure 12 This is the fifth structural diagram of the character recognition device based on the text correction model in the embodiments of this application;
[0065] Figure 13 This is the sixth structural diagram of the character recognition device based on the text correction model in the embodiments of this application;
[0066] Figure 14 This is the seventh structural diagram of the character recognition device based on the text correction model in the embodiments of this application;
[0067] Figure 15 This is a schematic diagram of the structure of the electronic device in the embodiments of this application. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.
[0069] In the technical solutions of this application, the acquisition, storage, use, processing, etc. of data all comply with the relevant provisions of national laws and regulations.
[0070] Considering that the OCR recognition solution in the prior art divides an image containing text into regions, performs character recognition on the pictures of the segmented single-character images, and finally integrates each recognized result into the complete text content. This character recognition solution greatly reduces the training and implementation difficulty of the OCR recognition model, but this method also destroys the associated information between different characters. This application provides a character recognition method and device based on a text correction model. By organically combining OCR character recognition technology with the text correction model and comprehensively considering the context before and after characters, the OCR character recognition rate is improved.
[0071] In order to effectively improve the accuracy of character recognition, this application provides an embodiment of a character recognition method based on a text correction model. Refer to Figure 1 , the character recognition method based on the text correction model specifically includes the following content:
[0072] Step S101: Perform image segmentation processing on the target image, and perform optical character recognition on the target image after the image segmentation processing to obtain an initial text recognition result;
[0073] Optionally, in this application, this application can recognize through "image segmentation" + "OCR recognition model".
[0074] For example, due to reasons such as scribbled text fonts or picture taking, the result of recognizing the image of "Industrial and Commercial Bank of China" is "中", "国", "工", "商", "很", "行", where the character "银" is misrecognized as "很".
[0075] Step S102: Obtain a target text recognition result according to the initial text recognition result and a set text correction model, where the text correction model includes the associated relationship between each character in the initial text recognition result.
[0076] Optionally, in this application, the application can re-perform OCR recognition on all results and organically combine the results of the text error correction model with the results of OCR recognition. Specifically, the first-pass OCR results are used as the input for the text error correction model service, and the final text recognition results are obtained by integrating the two models. For example, when re-recognizing the character "中", the OCR recognition result is "中" at 90%, "早" at 2%, and other characters at 8%. At the same time, the result input to the text error correction model is: "中" combined with the previous recognized "国", and the text error correction model outputs correctly. However, in the text error correction model, "早" or other content cannot be associated with the surrounding context, resulting in the text error correction model outputting an error. Therefore, the final recognition probability of "中" is 90% + K (K is the proportion of the text error correction model, the larger the K value, the greater the influence of the text error correction model and the smaller the influence of the OCR recognition image. The K value can be selected according to the specific scenario. Generally, K does not exceed 30%. When K = 0, it is a conventional OCR recognition), and the recognition rate of the character "早" remains 2%. Since 90% + K > 2%, the recognition result is still "中".
[0077] Optionally, in this application, when the character "银" is recognized, the OCR recognition result is "很" at 53%, "银" at 44%, and other characters at 3%. However, at the same time, in combination with the text error correction model, when the text is "很", due to the inability to associate with the surrounding context, the text error correction model outputs an error. But when it is "银", the text error correction model outputs correctly. Finally, the combined probability of "银" based on the OCR recognition rate is 44% + K. When the K value is greater than 9%, the incorrect OCR recognition result "很" can be successfully corrected to "银".
[0078] From the above description, it can be seen that the text recognition method based on the text error correction model provided by the embodiments of this application can organically combine the OCR text recognition technology with the text error correction model, and improve the OCR text recognition rate by comprehensively considering the context before and after the text.
[0079] In an embodiment of the text recognition method based on the text error correction model of this application, refer to Figure 2 , it may specifically include the following content:
[0080] Step S201: Determine the association relationship between each character in the initial text recognition result according to the set text error correction model;
[0081] Step S202: Determine the target text recognition result according to the recognition probability of each character in the initial text recognition result and the association relationship.
[0082] Optionally, in this application, the application can re-perform OCR recognition on all results and organically combine the results of the text error correction model with the results of OCR recognition, and obtain the final text recognition results by integrating the two models.
[0083] In one embodiment of the character recognition method based on a text error correction model in this application, see [link to relevant documentation]. Figure 3 It can also specifically include the following:
[0084] Step S301: Obtain the recognition probability of each character in the initial text recognition result, and determine the error correction parameters of the recognition probability according to the correlation between each character in the set text error correction model;
[0085] Step S302: Determine the target text recognition result based on the error correction parameters and the recognition probability of each character.
[0086] For example, in this text correction model, the word "early" or other content cannot be associated with the preceding and following content, causing the text correction model to output an error. Therefore, the probability of the final recognition result being "medium" is 90% + K (K is the proportion of the text correction model; the larger the K value, the greater the influence of the text correction model and the smaller the influence of OCR recognition; the K value can be selected according to the specific scenario. Generally, K does not exceed 30%, and when K = 0, it is conventional OCR recognition), while the recognition rate of the word "early" is still 2%. Since 90% + K > 2%, the recognition result is still "medium".
[0087] In one embodiment of the character recognition method based on a text error correction model in this application, see [link to relevant documentation]. Figure 4 It can also specifically include the following:
[0088] Step S401: Determine that the correlation between two adjacent characters in the set text correction model is greater than a threshold;
[0089] Step S402: If yes, then determine that the error correction parameter of the recognition probability is positive.
[0090] In one embodiment of the character recognition method based on a text error correction model in this application, see [link to relevant documentation]. Figure 5 It can also specifically include the following:
[0091] Step S501: Determine that the correlation between two adjacent characters in the set text correction model is less than a threshold;
[0092] Step S502: If yes, then determine that the error correction parameter of the recognition probability is negative.
[0093] Optionally, in this application, the application can re-perform OCR recognition on all results, and organically combine the results of the text error correction model with the results of OCR recognition, and obtain the final text recognition result by integrating the two models. For example, when re-recognizing the character "中", the OCR recognition result is "中" at 90%, "早" at 2%, and other characters at 8%. At the same time, input the result of the text error correction model: "中" is combined with "国" in the previous recognition result, and the text error correction model outputs correctly, that is, the error correction parameter is positive.
[0094] In the text error correction model, "早" or other content cannot be associated with the surrounding content, resulting in the text error correction model outputting an error, that is, the error correction parameter is negative. Therefore, the probability that the final recognition result is "中" is 90% + K (K is the proportion of the text error correction model. The larger the K value, the greater the influence of the text error correction model and the smaller the influence of the OCR recognition image. The K value can be selected according to the specific scenario. Generally, K does not exceed 30%. When K = 0, it is the conventional OCR recognition). The recognition rate of the character "早" remains 2%. Since 90% + K > 2%, the recognition result is still "中".
[0095] Optionally, in this application, when the character "银" is recognized, the OCR recognition result is "很" at 53%, "银" at 44%, and other characters at 3%. However, at the same time, in combination with the text error correction model, when the text is "很", due to the inability to associate with the surrounding content, the text error correction model outputs an error. But when it is "银", the text error correction model outputs correctly. Finally, combining the OCR recognition rate, the probability of "银" = 44% + K. When the K value is greater than 9%, the incorrect OCR recognition result "很" can be successfully corrected to "银".
[0096] In an embodiment of the text recognition method based on the text error correction model of this application, see Figure 6 , it may specifically include the following content:
[0097] Step S601: Correct the recognition probability of each character according to the error correction parameter;
[0098] Step S602: Determine the target text recognition result according to the corrected recognition probability.
[0099] In an embodiment of the text recognition method based on the text error correction model of this application, see Figure 7 , it may specifically include the following content:
[0100] Step S701: Determine whether it is the last character to be recognized;
[0101] Step S702: If so, end the current text recognition operation.
[0102] To effectively improve the accuracy of character recognition, this application provides an embodiment of a text-based error correction model-based character recognition device for implementing all or part of the aforementioned text recognition method. See [link to embodiment]. Figure 8 The text recognition device based on the text error correction model specifically includes the following components:
[0103] The segmentation and recognition module 10 is used to perform image segmentation processing on the target image, and to perform optical character recognition on the target image after image segmentation processing to obtain an initial text recognition result.
[0104] The text correction module 20 is used to obtain the target text recognition result based on the initial text recognition result and the set text correction model, wherein the text correction model includes the correlation between each character in the initial text recognition result.
[0105] As can be seen from the above description, the text recognition device based on the text correction model provided in this application can organically combine OCR text recognition technology with the text correction model, and improve the OCR text recognition rate by comprehensively considering the context of the text.
[0106] In one embodiment of the character recognition device based on a text error correction model of this application, see [link to relevant documentation]. Figure 9 The text correction module 20 includes:
[0107] The relationship determination unit 21 is used to determine the relationship between each character in the initial text recognition result according to the set text error correction model;
[0108] The target recognition unit 22 is used to determine the target text recognition result based on the recognition probability of each character in the initial text recognition result and the association relationship.
[0109] In one embodiment of the character recognition device based on a text error correction model of this application, see [link to relevant documentation]. Figure 10 The target identification unit 22 includes:
[0110] The error correction parameter determination subunit 221 is used to obtain the recognition probability of each character in the initial text recognition result and determine the error correction parameter of the recognition probability according to the correlation between each character in the set text error correction model.
[0111] The target result recognition subunit 222 is used to determine the target text recognition result based on the error correction parameters and the recognition probability of each character.
[0112] In one embodiment of the character recognition device based on a text error correction model of this application, see [link to relevant documentation]. Figure 11 The error correction parameter determination subunit 221 includes:
[0113] The first threshold judgment subunit 2211 is configured to judge that the correlation between two adjacent characters in the set text error correction model is greater than the threshold;
[0114] The first parameter determination subunit 2212 is configured to, if so, determine that the error correction parameter of the recognition probability is a positive value.
[0115] In an embodiment of the text recognition device based on the text error correction model of the present application, refer to Figure 12 , the error correction parameter determination subunit 221 includes:
[0116] The second threshold judgment subunit 2213 is configured to judge that the correlation between two adjacent characters in the set text error correction model is less than the threshold;
[0117] The second parameter determination subunit 2214 is configured to, if so, determine that the error correction parameter of the recognition probability is a negative value.
[0118] In an embodiment of the text recognition device based on the text error correction model of the present application, refer to Figure 13 , the error correction parameter determination subunit 221 includes:
[0119] The probability correction subunit 2215 is configured to correct the recognition probability of each character according to the error correction parameter;
[0120] The probability determination subunit 2216 is configured to determine the target text recognition result according to the recognition probability after the correction.
[0121] In an embodiment of the text recognition device based on the text error correction model of the present application, refer to Figure 14 , the text error correction module 20 further includes:
[0122] The end judgment unit 23 is configured to judge whether it is the last character to be recognized;
[0123] The recognition result unit 24 is configured to, if so, end the current text recognition operation.
[0124] To further illustrate the present solution, the present application also provides a specific application example of implementing a text recognition method based on the text error correction model by using the above-mentioned text recognition device based on the text error correction model, which specifically includes the following content:
[0125] ① "Image segmentation" + "OCR recognition model" recognition. Due to reasons such as scribbled text fonts or picture taking, the result of recognizing the image of "Industrial and Commercial Bank of China" is "zhong", "guo", "gong", "shang", "hen", "hang", where the character "yin" is misrecognized as "hen".
[0126] ②All results are re-ocr-recognized, and the results of the text error correction model are organically combined with the results of the ocr recognition. The final text recognition result is obtained by integrating the two models. For example, when re-recognizing the character "中", the ocr recognition result is "中" at 90%, "早" at 2%, and other characters at 8%. At the same time, the result of the input text error correction model: "中" is combined with "国" in the previous recognition result, and the text error correction model outputs correctly. However, in the text error correction model, "早" or other content cannot be associated with the surrounding content, resulting in an incorrect output from the text error correction model. Therefore, the probability of the final recognition result being "中" is 90% + K (K is the proportion of the text error correction model. The larger the K value, the greater the influence of the text error correction model and the smaller the influence of the ocr recognition image. The K value can be selected according to the specific scenario. Generally, K does not exceed 30%. When K = 0, it is a conventional ocr recognition), and the recognition rate of the character "早" remains 2%. Since 90% + K > 2%, the recognition result is still "中".
[0127] ③When the character "银" is recognized in the text, the ocr recognition result is "很" at 53%, "银" at 44%, and other characters at 3%. However, at the same time, in combination with the text error correction model, when the text is "很", since it cannot be associated with the surrounding content, the text error correction model outputs an error. But when it is "银", the text error correction model outputs correctly. Finally, the probability of "银" combined with the ocr recognition rate = 44% + K. When the K value is greater than 9%, the incorrect ocr recognition result "很" in this case can be successfully corrected to "银".
[0128] ④All problems are executed in sequence, and the ocr text recognition solution based on the text error correction model is completed.
[0129] As can be seen from the above content, in this application, by embedding a text error correction model in the ocr recognition process, it is possible to combine the surrounding content during text recognition, thereby improving the accuracy of ocr text recognition, reducing the manual processing process caused by ocr misrecognition, and saving labor costs and time.
[0130] From the hardware level, in order to effectively improve the accuracy of text recognition, this application provides an embodiment of an electronic device for implementing all or part of the content in the text recognition method based on the text error correction model. The electronic device specifically includes the following content:
[0131] The system comprises a processor, memory, a communications interface, and a bus; wherein the processor, memory, and communications interface communicate with each other via the bus; the communications interface is used to realize information transmission between the text recognition device based on the text correction model and core business systems, user terminals, and related databases and other related devices; the logic controller can be a desktop computer, tablet computer, or mobile terminal, etc., and this embodiment is not limited to these. In this embodiment, the logic controller can be implemented with reference to the embodiments of the text recognition method based on the text correction model and the embodiments of the text recognition device based on the text correction model in the embodiments, the content of which is incorporated herein, and repeated details will not be described again.
[0132] It is understood that the user terminal may include smartphones, tablet computers, network set-top boxes, portable computers, desktop computers, personal digital assistants (PDAs), in-vehicle devices, smart wearable devices, etc. Among these, the smart wearable devices may include smart glasses, smartwatches, smart bracelets, etc.
[0133] In practical applications, the text recognition method based on the text error correction model can be partially executed on the electronic device side as described above, or all operations can be completed in the client device. The specific choice depends on the processing power of the client device and the limitations of the user's usage scenario. This application does not impose any limitations on this. If all operations are completed in the client device, the client device may further include a processor.
[0134] The aforementioned client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission. The server may include a server on the task scheduling center side; in other implementation scenarios, it may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, a server cluster consisting of multiple servers, or a distributed server structure.
[0135] Figure 15 This is a schematic block diagram illustrating the system configuration of the electronic device 9600 according to an embodiment of this application. Figure 15 As shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It is worth noting that... Figure 15 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.
[0136] In one embodiment, the text recognition method based on a text error correction model can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following control:
[0137] Step S101: Perform image segmentation processing on the target image, and perform optical character recognition on the target image after image segmentation processing to obtain the initial text recognition result;
[0138] Step S102: Based on the initial text recognition result and the set text correction model, obtain the target text recognition result, wherein the text correction model includes the correlation between each character in the initial text recognition result.
[0139] As can be seen from the above description, the electronic device provided in this application embodiment organically combines OCR text recognition technology with a text error correction model, and improves the OCR text recognition rate by comprehensively considering the context of the text.
[0140] In another embodiment, the text recognition device based on the text correction model can be configured separately from the central processing unit 9100. For example, the text recognition device based on the text correction model can be configured as a chip connected to the central processing unit 9100, and the text recognition method function based on the text correction model can be implemented through the control of the central processing unit.
[0141] like Figure 15 As shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily need to include these components. Figure 15 All components shown; in addition, the electronic device 9600 may also include Figure 15 For components not shown, please refer to existing technologies.
[0142] like Figure 15 As shown, the central processing unit 9100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives inputs and controls the operation of various components of the electronic device 9600.
[0143] The memory 9140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 9100 may execute the program stored in the memory 9140 to perform information storage or processing, etc.
[0144] Input unit 9120 provides input to central processing unit 9100. Input unit 9120 may be, for example, a keypad or touch input device. Power supply 9170 provides power to electronic device 9600. Display 9160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.
[0145] The memory 9140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 9140 can also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142 for storing application programs and function programs or processes for executing the operation of the electronic device 9600 via the central processing unit 9100.
[0146] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for the electronic device's communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0147] The communication module 9110 is a transmitter / receiver 9110 that transmits and receives signals via the antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processing unit 9100 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.
[0148] Based on different communication technologies, multiple communication modules 9110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby realizing typical telecommunications functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 9130 is coupled to a central processing unit 9100, enabling on-device recording via the microphone 9132 and on-device playback of stored sound via the speaker 9131.
[0149] Embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the text recognition method based on a text correction model, in which the execution subject is a server or client, as described in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the text recognition method based on a text correction model, in which the execution subject is a server or client, as described in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:
[0150] Step S101: Perform image segmentation processing on the target image, and perform optical character recognition on the target image after image segmentation processing to obtain the initial text recognition result;
[0151] Step S102: Based on the initial text recognition result and the set text correction model, obtain the target text recognition result, wherein the text correction model includes the correlation between each character in the initial text recognition result.
[0152] As can be seen from the above description, the computer-readable storage medium provided in this application embodiment organically combines OCR text recognition technology with a text error correction model, and improves the OCR text recognition rate by comprehensively considering the context of the text.
[0153] Embodiments of this application also provide a computer program product capable of implementing all steps of the text recognition method based on a text correction model, in which the execution subject is a server or client, as described in the above embodiments. When executed by a processor, this computer program / instruction implements the steps of the text recognition method based on a text correction model. For example, the computer program / instruction implements the following steps:
[0154] Step S101: Perform image segmentation processing on the target image, and perform optical character recognition on the target image after image segmentation processing to obtain the initial text recognition result;
[0155] Step S102: Based on the initial text recognition result and the set text correction model, obtain the target text recognition result, wherein the text correction model includes the correlation between each character in the initial text recognition result.
[0156] As can be seen from the above description, the computer program product provided in this application combines OCR text recognition technology with a text error correction model, and improves the OCR text recognition rate by comprehensively considering the context of the text.
[0157] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0158] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0159] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0160] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0161] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A character recognition method based on a text error correction model, characterized in that, The method includes: Image segmentation is performed on the target image containing text, and optical character recognition is performed on the target image after image segmentation to obtain the initial text recognition result. Based on the initial text recognition result and the set text correction model, the target text recognition result is obtained, wherein the text correction model includes the correlation between each character in the initial text recognition result; The step of obtaining the target text recognition result based on the initial text recognition result and the set text correction model includes: determining the correlation between each character in the initial text recognition result based on the set text correction model; and determining the target text recognition result based on the recognition probability of each character in the initial text recognition result and the correlation. The step of determining the target text recognition result based on the recognition probability of each character in the initial text recognition result and the association relationship includes: obtaining the recognition probability of each character in the initial text recognition result; determining the error correction parameter of the recognition probability based on the association relationship between each character in the set text error correction model; and determining the target text recognition result based on the error correction parameter and the recognition probability of each character. The step of determining the target text recognition result based on the error correction parameters and the recognition probability of each character includes: correcting the recognition probability of each character based on the error correction parameters; and determining the target text recognition result based on the corrected recognition probability. The method further includes: performing optical character recognition on the target text recognition result again, and obtaining the final text recognition result based on the result of the text error correction model and the result after the optical character recognition.
2. The character recognition method based on a text error correction model according to claim 1, characterized in that, The step of determining the recognition probability based on the correlation between each character in the set text error correction model includes: Determine if the correlation between two adjacent characters in the set text correction model is greater than a threshold; If so, then the error correction parameter of the recognition probability is determined to be a positive value.
3. The character recognition method based on a text error correction model according to claim 1, characterized in that, The step of determining the recognition probability based on the correlation between each character in the set text error correction model includes: Determine if the correlation between two adjacent characters in the set text correction model is less than a threshold; If so, then the error correction parameter of the recognition probability is determined to be negative.
4. The character recognition method based on a text error correction model according to claim 1, characterized in that, After obtaining the target text recognition result based on the initial text recognition result and the set text correction model, the method further includes: Determine if this is the last character to be recognized; If so, then end the current text recognition operation.
5. A character recognition device based on a text error correction model, characterized in that, include: The segmentation and recognition module is used to perform image segmentation processing on the target image containing text, and to perform optical character recognition on the target image after image segmentation processing to obtain the initial text recognition result. The text correction module is used to obtain the target text recognition result based on the initial text recognition result and the set text correction model, wherein the text correction model includes the correlation relationship between each character in the initial text recognition result; The text correction module includes: The relationship determination unit is used to determine the relationship between each character in the initial text recognition result according to the set text error correction model; The target recognition unit is used to determine the target text recognition result based on the recognition probability of each character in the initial text recognition result and the association relationship; The target recognition unit includes: The error correction parameter determination subunit is used to obtain the recognition probability of each character in the initial text recognition result and determine the error correction parameters of the recognition probability according to the correlation between each character in the set text error correction model. A target result recognition subunit is configured to determine a target text recognition result based on the error correction parameters and the recognition probability of each character; wherein, determining the target text recognition result based on the error correction parameters and the recognition probability of each character includes: correcting the recognition probability of each character based on the error correction parameters; and determining the target text recognition result based on the corrected recognition probability. The device is also used to re-perform optical character recognition on the target text recognition result, and obtain the final text recognition result based on the result of the text error correction model and the result after re-optical character recognition.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the text recognition method based on the text error correction model as described in any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the text recognition method based on a text error correction model as described in any one of claims 1 to 4.
8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps of the text recognition method based on the text error correction model as described in any one of claims 1 to 4.