A method and apparatus suitable for text recognition error correction

By combining a text detection model and a trained glyph similarity model with an edit distance model, the OCR text recognition results are corrected, solving the problem of inaccurate error correction in existing technologies. A full list of texts is generated, achieving accurate correction of text recognition.

CN116563853BActive Publication Date: 2026-01-13CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310560184.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2026-01-13
Estimated Expiration
2043-05-18

AI Technical Summary

Technical Problem

Existing technologies, especially when it is impossible to obtain the full standard output or the latest full standard in a timely manner, cannot accurately correct errors generated when recognizing text such as product list categories, ethnic groups, address districts and counties, and customs declarations.

Method used

By acquiring a partial list of texts, the text detection model is used to obtain the target text recognition results. Content with a confidence level higher than a preset threshold is added to the full list of texts. By combining the trained glyph similarity model and edit distance model, error correction processing is performed on text content with a confidence level lower than the preset threshold, including the correction of characters and words.

Benefits of technology

It enables precise error correction of content with a confidence level below a threshold during text recognition, ensuring the accuracy of recognition results and generating a full list of texts, which meets the needs of the application scenario.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116563853B_ABST
    Figure CN116563853B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of method and device suitable for text recognition error correction, the method is by obtaining first text list;The target text to be identified is input to text detection model, and the target text recognition result is obtained;The first text content in the target text recognition result with confidence higher than the preset threshold is supplemented to the first text list, and second text list is obtained;The target text recognition result is input to training glyph similarity model, and glyph similarity function is obtained;Second text content in the target text recognition result with confidence lower than the preset threshold is corrected, can the recognition result with confidence higher than threshold be added to existing non-full text list to obtain full text list, can the error generated by text recognition be accurately corrected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus suitable for text recognition and error correction. Background Technology

[0002] In existing technologies, errors in OCR text recognition of images are corrected purely using semantic and language models. This method, which directly uses traditional edit distance models for error correction, can lead to incorrect corrections of correctly recognized text, or inaccurate corrections of incorrectly recognized text. This is especially problematic when dealing with product categories, ethnicities, addresses (districts / counties), and customs declarations. Without access to full standard outputs or timely access to the latest full standard data, existing technologies cannot accurately correct errors generated during OCR text recognition. Summary of the Invention

[0003] In order to solve at least one of the problems mentioned in the background art, the present invention proposes a method and apparatus for text recognition error correction, which aims to accurately correct errors generated during text recognition.

[0004] To achieve the above objectives, the technical solution adopted by the present invention includes:

[0005] A method for text recognition error correction includes:

[0006] Obtain the first text list, wherein the first text list is not the full text list;

[0007] The target text to be identified is input into the text detection model to obtain the target text recognition result;

[0008] The first text content with a confidence level higher than a preset threshold from the target text recognition results is added to the first text list to obtain a second text list, wherein the second text list is a full text list;

[0009] The target text recognition result is input into the training glyph similarity model to obtain the glyph similarity function;

[0010] The second text content with a confidence level lower than a preset threshold in the target text recognition result is subjected to error correction processing.

[0011] Further, the step of inputting the target text recognition result into the training glyph similarity model to obtain the glyph similarity function includes:

[0012] All characters in the target text recognition result are converted into images and input into the training glyph similarity model to obtain a distance matrix. The glyph similarity function between each character image and other character images is calculated through the distance matrix.

[0013] Furthermore, the step of correcting the second text content in the target text recognition result with a confidence level lower than a preset threshold includes:

[0014] When the target text recognition result includes the confidence score of each character, error correction processing is performed on characters with a confidence score lower than a preset threshold.

[0015] When the target text recognition result includes the confidence level of each word, error correction processing is performed on words with a confidence level lower than a preset threshold.

[0016] Furthermore, the error correction processing for text with a confidence level below a preset threshold includes:

[0017] Set the parameters of the edit distance model to obtain the first edit distance model;

[0018] Identify the text and its position with a confidence level below a preset threshold and the text and its position with a confidence level above a preset threshold within the target words;

[0019] Determine the set of potential words in the second text list that satisfy the word order of the target words;

[0020] Calculate and sort the sum of the edit distances of each potential word in the potential word set relative to the target word;

[0021] The potential word in the potential word set with the smallest sum of edit distances to the target word is identified as the first word, and the target word is replaced with the first word.

[0022] Furthermore, the error correction process for words with a confidence level below a preset threshold includes:

[0023] Set the parameters of the edit distance model to obtain the second edit distance model;

[0024] Words with confidence levels below a preset threshold are identified as target words;

[0025] Determine the set of potential words in the second text list that meet the target word similarity threshold;

[0026] Calculate the sum of the edit distances of each potential word in the potential word set relative to the target word;

[0027] The potential words are comprehensively sorted by combining the length of the target word, the number of characters to be replaced in the target word, and the sum of the edit distances of the potential words to the target word;

[0028] The potential word ranked first in the potential word set is identified as the second word, and the target word is replaced with the second word.

[0029] Furthermore, the method also includes when the sum of the edit distances of the second word is less than When the target word is replaced with the second word, the target word is replaced with the second word.

[0030] The present invention also relates to an apparatus suitable for text recognition error correction, comprising:

[0031] The first acquisition module is used to acquire a first text list, wherein the first text list is a non-full text list;

[0032] The text recognition module is used to input the target text to be recognized into the text detection model and obtain the target text recognition result;

[0033] The second acquisition module is used to supplement the first text content with a confidence level higher than a preset threshold in the target text recognition result to the first text list to obtain a second text list, wherein the second text list is a full text list;

[0034] The character shape similarity training module is used to input the target text recognition result into the character shape similarity training model to obtain the character shape similarity function;

[0035] The correction module is used to correct errors in the second text content in the target text recognition result whose confidence level is lower than a preset threshold.

[0036] The present invention also relates to a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0037] The present invention also relates to 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 computer program to implement the above-described method.

[0038] The present invention also relates to a computer program product, including a computer program and / or instructions, characterized in that the computer program and / or instructions, when executed by a processor, implement the steps of the above-described method.

[0039] The beneficial effects of this invention are as follows:

[0040] The method and apparatus for text recognition error correction described in this invention involve: obtaining a first text list; inputting the target text to be recognized into a text detection model to obtain the target text recognition result; supplementing the first text content with a confidence level higher than a preset threshold in the target text recognition result into the first text list to obtain a second text list; inputting the target text recognition result into a training glyph similarity model to obtain a glyph similarity function; and performing error correction processing on the second text content with a confidence level lower than a preset threshold in the target text recognition result. This method can add recognition results with a confidence level higher than the threshold to the existing incomplete text list to obtain the complete text list, thereby correcting errors generated by the text detection model within a certain range. Furthermore, different custom edit distance models are set according to the format of the output results of the text detection model, which is more suitable for the application scenario and can accurately correct errors generated by text recognition. Attached Figure Description

[0041] Figure 1 This is a schematic flowchart of a method for text recognition and error correction provided in an embodiment of the present invention.

[0042] Figure 2 This is a schematic diagram of a device structure suitable for text recognition and error correction provided in an embodiment of the present invention. Detailed Implementation

[0043] To more clearly illustrate the technical solutions of the embodiments in this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some examples or embodiments of this specification. For those skilled in the art, these drawings can be applied to other similar scenarios without creative effort. Unless obvious from the context or otherwise specified, the same reference numerals in the drawings represent the same structures or operations.

[0044] It should be understood that the terms “system,” “device,” “unit,” and / or “module” used herein are one way to distinguish different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.

[0045] As indicated in this specification and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0046] Flowcharts are used in this specification to illustrate the operations performed by the system according to embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0047] Terminology definition:

[0048] (1) OCR (Optical Character Recognition): refers to the process by which electronic devices examine characters printed on paper, determine their shape by detecting dark and light patterns, and then translate the shape into computer text using character recognition methods.

[0049] (2) Edit distance: Also known as Levenshtein distance, it is a type of edit distance. It refers to the minimum number of edit operations required to transform one string into another. Allowed edit operations include replacing one character with another, inserting a character, and deleting a character.

[0050] The first aspect of this invention relates to a process flow as follows: Figure 1 The method shown is suitable for text recognition error correction, including:

[0051] Step S1: Obtain the first text list, wherein the first text list is a non-full text list.

[0052] For example, the incomplete text list is the product name: [apple, banana, peach, salted fish, lamb leg, fresh beef, fresh burdock, fresh and dried celery, hot pot].

[0053] Step S2: Input the target text to be identified into the text detection model and obtain the target text recognition result.

[0054] In this preferred embodiment, the target text to be identified is an image, and the text detection model is an OCR model. The OCR model can accurately identify the text on the image and obtain an OCR result set.

[0055] Preferably, the OCR result set includes product name and confidence level.

[0056] For example, the OCR result set is: [wrench 0.99, banana 0.98, iron 0.2, anti-theft pin 0.4, ...].

[0057] Step S3: Add the first text content with a confidence level higher than a preset threshold from the target text recognition results to the first text list to obtain a second text list, wherein the second text list is a full text list.

[0058] Preferably in this embodiment, the preset threshold of confidence is 0.95. The products "banana" and "wrench" with confidence greater than 0.95 in the above OCR result set are supplemented to the first text list, and duplicate removal is performed to obtain the second text list, that is, the product names in the full text list: [apple, banana, peach, salted fish, lamb leg, fresh beef, fresh burdock, fresh celery, hot pot, wrench].

[0059] Step S4: Input the target text recognition result into the trained glyph similarity model to obtain a glyph similarity function.

[0060] Preferably in this embodiment, all the characters in the target text recognition result are respectively converted into images and input into the trained glyph similarity model to obtain a distance matrix, and a glyph similarity function between each character image and other character images is calculated through the distance matrix.

[0061] Exemplarily, assuming there are 30,000 characters, each character corresponds to a vector, and the cosine distance between vectors represents the similarity degree of two characters, then a 30,000 X 30,000 cosine similarity matrix can be obtained. For example, the similarity between "female" and "ru" is higher than that between "male" and "female"; this method can calculate the glyph similarity function sim between each character image and other character images.

[0062] Step S5: Perform error correction on the second text content with a confidence lower than the preset threshold in the target text recognition result.

[0063] Specifically, according to different output methods of the OCR result, different subsequent steps are taken for error correction.

[0064] Preferably in this embodiment, when the target text recognition result includes the confidence of each character, error correction is performed on the characters with a confidence lower than the preset threshold. The specific steps are as follows:

[0065] Set the parameters of the edit distance model to obtain the first edit distance model;

[0066] Determine the characters with a confidence lower than the preset threshold and their positions in the target word, as well as the characters with a confidence higher than the preset threshold and their positions;

[0067] Determine the set of potential words in the second text list that satisfy the word order of the target word;

[0068] Calculate and sort the sum of the edit distances between each potential word in the set of potential words and the target word;

[0069] Determine the potential word with the smallest sum of edit distances compared to the target word in the set of potential words as the first word, and replace the target word with the first word.

[0070] Assume that the first edit distance model is Edit Distance Model A. Exemplarily, the edit distances for both "addition" and "deletion" are set to 1, and the edit distance for "modification" is set to 1 - sim[a][b], where sim[a][b] represents the similarity between two text images.

[0071] Exemplarily, if the OCR output result is "fresh cow parsnip - [0.99, 0.99, 0.35]" and the preset confidence threshold is 0.95, only the character "parsnip" with a confidence lower than 0.95 needs to be corrected at this time.

[0072] Exemplarily, if the OCR output result is "hot pot order monthly fresh cow parsnip - [0.99, 0.99, 0.35, 0.15, 0.12, 0.98, 0.99, 0.56]" and the preset confidence threshold is 0.95, first select the characters "fire", "pot", "fresh", "cow" with a confidence higher than 0.95. Then, traverse and filter in the second text list to obtain the set of potential words A that satisfies the word order of "hot pot abc fresh cow d". Calculate and sort the sum of the edit distances between each potential word in the set of potential words A and "hot pot order monthly fresh cow parsnip", and determine the potential word with the smallest sum of edit distances compared to "hot pot order monthly fresh cow parsnip" in the set of potential words A as the first word, and replace "hot pot order monthly fresh cow parsnip" with the first word.

[0073] When the target text recognition result includes the confidence of each word, perform error correction on the words with a confidence lower than the preset threshold. The specific steps are as follows:

[0074] Set the parameters of the edit distance model to obtain the second edit distance model;

[0075] Determine the word with a confidence lower than the preset threshold as the target word;

[0076] Determine the set of potential words that meet the target word similarity threshold in the second text list;

[0077] Calculate the sum of the edit distances between each potential word in the set of potential words and the target word;

[0078] Comprehensively sort the potential words by combining the length of the target word, the number of characters to be replaced in the target word, and the size of the sum of the edit distances between the potential word and the target word;

[0079] The potential word ranked first in the potential word set is identified as the second word, and the target word is replaced with the second word.

[0080] Assuming the second edit distance model is edit distance model Z, for example, the edit distance for "add" and "delete" is set to 1, and the edit distance for "modify" is set to max(1-sim[a][b], 0.49), where sim[a][b] represents the similarity between two text images, and 0.49 is the set threshold, which can be set according to actual needs.

[0081] For example, the original product name is "fresh burdock," and the OCR output is "fresh burdock radical." There is also another product called "fresh dried celery." Calculations show that the edit distance from "burdock" to "dried" is 0.1, from "celery" to "radical" is 0.29, and from "radical" to "burdock" is 0.4. The model will then consider that the sum of the edit distances of changing both "burdock" and "radical" to "dried" and "celery" (0.39) is lower than the edit distance of changing "radical" to "burdock" (0.4), thus correcting the error. Based on empirical exploration of optical text recognition results, when it's uncertain which character is most likely to be misidentified, correcting fewer characters is more effective than correcting more. Therefore, in this embodiment, a weighted analysis is performed on three factors: the length of the target word, the number of characters to be replaced in the target word, and the sum of the edit distances between potential words and the target word. This comprehensive analysis yields the correction result closest to the target text. The threshold of 0.49 is set to ensure that the edit distance is relatively small when correcting similar characters, and also to ensure that the model corrects as few characters as possible.

[0082] In this preferred embodiment, when the sum of the edit distances of the second words is less than When the target word is replaced with the second word, the target word is replaced with the second word.

[0083] When performing an edit distance-based search of the entire vocabulary for words with confidence scores below a preset threshold, the minimum sum of edit distances is determined to be less than... If the word is too long, a replacement is made. This is because the longer the word being identified, the higher the probability of making a mistake, and therefore the greater the sum of edit distances that can be corrected.

[0084] The method for text recognition error correction described in this invention involves: obtaining a first text list; inputting the target text to be recognized into a text detection model to obtain the target text recognition result; supplementing the first text content with a confidence level higher than a preset threshold in the target text recognition result into the first text list to obtain a second text list; inputting the target text recognition result into a training glyph similarity model to obtain a glyph similarity function; and performing error correction processing on the second text content with a confidence level lower than a preset threshold in the target text recognition result. This method can add recognition results with a confidence level higher than the threshold to the existing incomplete text list to obtain the complete text list, thereby correcting errors generated by the text detection model within a certain range. Furthermore, different custom edit distance models are set according to the format of the output results of the text detection model, which is more suitable for the application scenario and can accurately correct errors generated by text recognition.

[0085] Another aspect of the present invention relates to an apparatus suitable for text recognition error correction, the structure of which is as follows: Figure 2 As shown, it includes:

[0086] The first acquisition module is used to acquire a first text list, wherein the first text list is a non-full text list;

[0087] The text recognition module is used to input the target text to be recognized into the text detection model and obtain the target text recognition result;

[0088] The second acquisition module is used to supplement the first text content with a confidence level higher than a preset threshold in the target text recognition result to the first text list to obtain a second text list, wherein the second text list is a full text list;

[0089] The character shape similarity training module is used to input the target text recognition result into the character shape similarity training model to obtain the character shape similarity function;

[0090] The correction module is used to correct errors in the second text content in the target text recognition result whose confidence level is lower than a preset threshold.

[0091] By using this device, the above-mentioned computational processing methods can be executed and the corresponding technical effects can be achieved.

[0092] Embodiments of the present invention also provide a computer-readable storage medium capable of implementing all steps of the text recognition error correction method described in the above embodiments, wherein the computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the text recognition error correction method described in the above embodiments.

[0093] Embodiments of the present invention also provide an electronic device for performing the above-described method. As an implementation device for the method, the electronic device includes at least a processor and a memory. In particular, the memory stores data and related computer programs required for performing the method. The processor calls the data and programs in the memory to execute all the steps of the method and obtain the corresponding technical effect.

[0094] Preferably, the electronic device may include a bus architecture, which may include any number of interconnected buses and bridges. The bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same element, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor during operation.

[0095] Additionally, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operating control) used may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a buffer, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices, which can store the aforementioned data information, and may also store programs for executing the information, and the processor can execute the program stored in the memory to achieve information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it can be a button or touch input device; the power supply is used to provide power to the electronic device; the display is used to display images and text, for example, it can be an LCD display. The communication module is a transmitter / receiver that transmits and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which can be the same as in conventional mobile communication terminals. Based on different communication technologies, multiple communication modules can be incorporated into the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) is also coupled to a speaker and microphone via an audio processor to provide audio output through the speaker and receive audio input from the microphone, thereby enabling typical telecommunications functions. The audio processor can include any suitable buffer, decoder, amplifier, etc. Furthermore, the audio processor is coupled to a central processing unit, enabling on-device recording via the microphone and on-device playback of stored sound via the speaker.

[0096] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, 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.

[0097] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), 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 system that specifies functions in one or more boxes.

[0098] 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 an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0099] 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 functions specified in one or more boxes. Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0100] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method suitable for text recognition error correction, characterized in that, The method comprises the following steps: obtaining a first text list, wherein the first text list is a non-full text list; inputting a target text to be recognized into a text detection model to obtain a target text recognition result; supplementing first text content with a confidence higher than a preset threshold in the target text recognition result to the first text list to obtain a second text list, wherein the second text list is a full text list; inputting the target text recognition result into a trained glyph similarity model to obtain a glyph similarity function; performing error correction processing on second text content with a confidence lower than a preset threshold in the target text recognition result; wherein different steps are taken for error correction processing according to different ways of OCR output results; when the target text recognition result contains the confidence of each character, performing error correction processing on characters with a confidence lower than a preset threshold: setting parameters of an edit distance model to obtain a first edit distance model; determining characters with a confidence lower than a preset threshold and their positions and characters with a confidence higher than a preset threshold and their positions in a target word; determining a set of potential words in the second text list that satisfy the order of the target word; calculating the size of the sum of edit distances of each potential word in the set of potential words compared with the target word and sorting them; determining a potential word with the smallest sum of edit distances compared with the target word in the set of potential words as a first word, and replacing the target word with the first word; when the target text recognition result contains the confidence of each word, performing error correction processing on words with a confidence lower than a preset threshold: setting parameters of an edit distance model to obtain a second edit distance model; determining a word with a confidence lower than a preset threshold as a target word; determining a set of potential words in the second text list that satisfy the similarity threshold of the target word; calculating the size of the sum of edit distances of each potential word in the set of potential words compared with the target word; comprehensively sorting the potential words in combination with the length of the target word, the number of characters to be replaced in the target word, and the size of the sum of edit distances of the potential words compared with the target word; determining a potential word with the first comprehensive order in the set of potential words as a second word, and replacing the target word with the second word.

2. The method of claim 1, wherein, The method comprises the following steps: inputting all characters of the target text recognition result into the trained glyph similarity model to obtain a distance matrix, and calculating the glyph similarity function between each character image and other character images through the distance matrix.

3. The method of claim 1, wherein, The method further includes replacing the target term with the second term when the sum of edit distances of the second term is less than the sum of edit distances of the target term.

4. An apparatus suitable for text recognition error correction, characterized in that, The method comprises the following steps: a first obtaining module for obtaining a first text list, wherein the first text list is a non-full text list; a text recognition module for inputting a target text to be recognized into a text detection model to obtain a target text recognition result; The second obtaining module is configured to supplement first text content with a confidence higher than a preset threshold in the target text recognition result to the first text list to obtain a second text list, wherein the second text list is a full-amount text list. The training glyph similarity module is configured to input the target text recognition result into a training glyph similarity model to obtain a glyph similarity function. The correction module is configured to perform error correction processing on second text content with a confidence lower than a preset threshold in the target text recognition result. Different steps are taken for error correction processing according to different manners of the OCR output result. When the target text recognition result contains the confidence of each character, characters with a confidence lower than a preset threshold are subjected to error correction processing. Parameters of an edit distance model are set to obtain a first edit distance model. Characters with a confidence lower than a preset threshold and their positions and characters with a confidence higher than a preset threshold and their positions in a target word are determined. A set of potential words in the second text list that meet the order of the target word are determined. The size of the sum of edit distances of each potential word in the set of potential words compared with the target word is calculated and sorted. The potential word with the smallest sum of edit distances compared with the target word in the set of potential words is determined as a first word, and the target word is replaced by the first word. When the target text recognition result contains the confidence of each word, words with a confidence lower than a preset threshold are subjected to error correction processing. Parameters of an edit distance model are set to obtain a second edit distance model. Words with a confidence lower than a preset threshold are determined as target words. A set of potential words in the second text list that meet the similarity threshold of the target word are determined. The size of the sum of edit distances of each potential word in the set of potential words compared with the target word is calculated. The potential words are comprehensively sorted in combination with the length of the target word, the number of characters to be replaced in the target word, and the size of the sum of edit distances of the potential words compared with the target word. The potential word with the first comprehensive order in the set of potential words is determined as a second word, and the target word is replaced by the second word.

5. A computer readable storage medium, characterized in that, The storage medium has a computer program stored thereon, and the computer program is executed by the processor to implement the method in any one of claims 1 to 3.

6. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method in any one of claims 1 to 3.

7. A computer program product comprising computer programs and / or instructions, characterized in that, The computer program and / or instructions are executed by the processor to implement the steps of the method in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Text error correction method and device, electronic equipment and readable storage medium

    CN113420546A

  • Image text recognition and error correction method and system, electronic device and medium

    CN113743415A