CN-116935407-B - Correction method, device, storage medium and equipment for digital character recognition result
Abstract
The invention discloses a method, a device, a storage medium and equipment for correcting a digital character recognition result, relates to the technical field of computers, and can solve the technical problems of low correction efficiency and low correction accuracy when digital characters are recognized into other digital characters. The method comprises the steps of obtaining a digital character recognition result and constraint conditions corresponding to the digital character recognition result, obtaining similar digital characters corresponding to each digital character in the digital character recognition result when the constraint conditions are used for judging that the digital character recognition result is wrong, and obtaining a target digital character correction result which accords with the constraint conditions by replacing the corresponding digital characters with the similar digital characters.
Inventors
- ZHANG YANKAI
Assignees
- 平安国际融资租赁有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230724
Claims (8)
- 1. A method for correcting a digital character recognition result, the method comprising: acquiring a digital character recognition result and a constraint condition corresponding to the digital character recognition result; When the constraint condition is used for judging that the digital character recognition result is wrong, obtaining similar digital characters corresponding to each digital character in the digital character recognition result; replacing the corresponding digital character by using the similar digital character to obtain a target digital character correction result conforming to the constraint condition; The step of replacing the corresponding digital character with the similar digital character to obtain a target digital character correction result conforming to the constraint condition comprises the following steps: determining a constraint type of the constraint condition, wherein the constraint type comprises a first preset value, a second preset value, the first preset value and the second preset value; Determining a replacement rule according to the constraint type, and replacing the corresponding digital character with the similar digital character by utilizing the replacement rule to obtain a target digital character correction result conforming to the constraint condition; The method for determining the replacement rule according to the constraint type, and replacing the corresponding digital character with the similar digital character by using the replacement rule to obtain a target digital character correction result conforming to the constraint condition comprises the following steps: if the constraint type is greater than the first preset value, determining a first target digital character of each bit of the first preset value, selecting a first minimum similar digital character of the first target digital characters which is greater than or equal to the corresponding bit in the similar digital characters corresponding to the digital characters, and replacing the digital characters of the same bit by the first minimum similar digital character to obtain a first digital character correction result; if the first digital character correction result is larger than the first preset value, the first digital character correction result is used as a minimum target digital character correction result; if the first digital character correction result is equal to the first preset value, determining a first lowest digital character of the first digital character correction result and a lowest digital character in the digital character recognition result, judging whether a second minimum similar digital character larger than the first minimum similar digital character corresponding to the lowest digital character exists in the similar digital characters corresponding to the lowest digital character, if so, replacing the first lowest digital character by the second minimum similar digital character to obtain a minimum target digital character correction result, and if not, carrying out carry operation on the first digital character correction result step by step until the minimum target digital character correction result is obtained; And obtaining a target digital character correction result larger than the first preset value according to the minimum target digital character correction result and the similar digital character corresponding to the digital character.
- 2. The method of claim 1, wherein the determining a replacement rule according to the constraint type, replacing the corresponding numeric character with the similar numeric character by the replacement rule, and obtaining a target numeric character correction result conforming to the constraint condition, further comprises: If the constraint type is smaller than the second preset value, determining a second target digital character of each bit of the second preset value, selecting a first maximum similar digital character of the second target digital character which is smaller than or equal to the corresponding bit in the similar digital characters corresponding to the digital characters, and replacing the digital characters of the same bit by using the first maximum similar digital character to obtain a second digital character correction result; if the second digital character correction result is smaller than the second preset value, the second digital character correction result is used as a maximum target digital character correction result; If the second digital character correction result is equal to the second preset value, determining a second lowest-order digital character of the second digital character correction result, judging whether a second maximum similar digital character smaller than the first maximum similar digital character corresponding to the lowest-order digital character exists in the similar digital characters corresponding to the lowest-order digital character, if yes, replacing the second lowest-order digital character with the second maximum similar digital character to obtain a maximum target digital character correction result, and if not, gradually performing borrowing operation on the second digital character correction result until the maximum target digital character correction result is obtained; And obtaining a target digital character correction result smaller than the second preset value according to the maximum target digital character correction result and the similar digital character corresponding to the digital character.
- 3. The method of claim 2, wherein the determining a replacement rule according to the constraint type, replacing the corresponding numeric character with the similar numeric character by the replacement rule, and obtaining a target numeric character correction result conforming to the constraint condition, further comprises: if the constraint type is greater than the first preset value and less than the second preset value; And if the minimum target digital character correction result is smaller than the second preset value and the maximum target digital character correction result is larger than the first preset value, obtaining a target digital character correction result which is larger than the first preset value and smaller than the second preset value according to the minimum target digital character correction result, the maximum target digital character correction result and the similar digital character corresponding to the digital character.
- 4. The method of claim 1, wherein the step-wise performing a carry operation comprises: Determining the next lower digit character in the digit character recognition result; judging whether a second minimum similar digital character larger than the first minimum similar digital character of the corresponding bit exists in the similar digital characters corresponding to the secondary low-order digital character; If yes, replacing the first low-order digital character of the first digital character correction result by the second minimum similar digital character, and replacing the first lowest-order digital character with the minimum number in the similar digital characters corresponding to the lowest-order digital character; if not, carrying out carry operation further.
- 5. The method of claim 2, wherein the step-wise borrowing comprises: Determining the next lower digit character in the digit character recognition result; judging whether a second maximum similar digital character smaller than the first maximum similar digital character of the corresponding bit exists in the similar digital characters corresponding to the secondary low-order digital character; If yes, replacing the second low-order digital character of the second digital character correction result by the second maximum similar digital character, and replacing the second lowest-order digital character with the maximum number in the similar digital characters corresponding to the lowest-order digital character; If not, further borrowing operation is carried out.
- 6. A correction device for a digital character recognition result, the device comprising: The acquisition module is used for acquiring a digital character recognition result and a constraint condition corresponding to the digital character recognition result; the judging module is used for acquiring similar digital characters corresponding to each digital character in the digital character recognition result when judging that the digital character recognition result is in error by utilizing the constraint condition; the correction module is used for replacing the corresponding digital character by the similar digital character to obtain a target digital character correction result conforming to the constraint condition; The correction module comprises a determination unit and a replacement unit; The determining unit is configured to determine a constraint type of the constraint condition, where the constraint type includes a constraint type greater than a first preset value, less than a second preset value, greater than the first preset value and less than the second preset value; the replacing unit is used for determining a replacing rule according to the constraint type, and replacing the corresponding digital character with the similar digital character by utilizing the replacing rule to obtain a target digital character correction result conforming to the constraint condition; The replacing unit is used for determining a first target digital character of each bit of the first preset value if the constraint type is larger than the first preset value, selecting a first minimum similar digital character of the first target digital character corresponding to the digital character, using the first minimum similar digital character to replace the digital character of the same bit to obtain a first digital character correcting result, using the first digital character correcting result as a minimum target digital character correcting result if the first digital character correcting result is larger than the first preset value, determining a first minimum digital character of the first digital character correcting result and a minimum digital character in the digital character identification result if the first minimum digital character of the first digital character correcting result is equal to the first preset value, judging whether a second minimum digital character larger than the first minimum similar digital character corresponding to the digital character exists in the similar digital character corresponding to the minimum digital character, using the minimum digital character to correct the first digital character, and obtaining a target digital character according to the maximum similar character correcting result if the minimum digital character is smaller than the first digital character, and gradually correcting the target digital character until the first digital character is obtained.
- 7. A storage medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of correcting a digital character recognition result according to any one of claims 1 to 5.
- 8. A computer device comprising a memory, a processor and a computer program stored on the storage medium and executable on the processor, characterized in that the processor implements the method of correcting the digital character recognition result of any one of claims 1 to 5 when executing the program.
Description
Correction method, device, storage medium and equipment for digital character recognition result Technical Field The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a storage medium, and a device for correcting a digital character recognition result. Background Optical character recognition (Optical Character Recognition, OCR) refers to a process of analyzing and recognizing an image file, acquiring layout information, and returning the layout information in the form of text, however, OCR recognition may be erroneous and require correction. Currently, when a digital character is erroneously recognized as another digital character, 10 digital characters of 0 to 9 are used for replacement, and the correction efficiency and correction accuracy are low. Disclosure of Invention In view of the above, the present invention provides a method, apparatus, storage medium and device for correcting digital character recognition results, which can solve the technical problems of low correction efficiency and low correction accuracy when digital characters are recognized into other digital characters. According to an aspect of the present invention, there is provided a method of correcting a digital character recognition result, the method comprising: acquiring a digital character recognition result and a constraint condition corresponding to the digital character recognition result; When the constraint condition is used for judging that the digital character recognition result is wrong, obtaining similar digital characters corresponding to each digital character in the digital character recognition result; and replacing the corresponding digital character by using the similar digital character to obtain a target digital character correction result conforming to the constraint condition. Preferably, the replacing the corresponding digital character with the similar digital character to obtain a target digital character correction result meeting the constraint condition includes: determining a constraint type of the constraint condition, wherein the constraint type comprises a first preset value, a second preset value, the first preset value and the second preset value; And determining a replacement rule according to the constraint type, and replacing the corresponding digital character with the similar digital character by utilizing the replacement rule to obtain a target digital character correction result conforming to the constraint condition. Preferably, if the constraint type is greater than the first preset value, determining a first target digital character of each bit of the first preset value, selecting a first minimum similar digital character of the first target digital characters which is greater than or equal to the corresponding bit in the similar digital characters corresponding to the digital characters, and replacing the digital characters of the same bit with the first minimum similar digital character to obtain a first digital character correction result; if the first digital character correction result is larger than the first preset value, the first digital character correction result is used as a minimum target digital character correction result; if the first digital character correction result is equal to the first preset value, determining a first lowest digital character of the first digital character correction result and a lowest digital character in the digital character recognition result, judging whether a second minimum similar digital character larger than the first minimum similar digital character corresponding to the lowest digital character exists in the similar digital characters corresponding to the lowest digital character, if so, replacing the first lowest digital character by the second minimum similar digital character to obtain a minimum target digital character correction result, and if not, carrying out carry operation on the first digital character correction result step by step until the minimum target digital character correction result is obtained; And obtaining a target digital character correction result larger than the first preset value according to the minimum target digital character correction result and the similar digital character corresponding to the digital character. Preferably, the determining a replacement rule according to the constraint type, replacing the corresponding digital character with the similar digital character by using the replacement rule to obtain a target digital character correction result conforming to the constraint condition, and further includes: If the constraint type is smaller than the second preset value, determining a second target digital character of each bit of the second preset value, selecting a first maximum similar digital character of the second target digital character which is smaller than or equal to the corresponding bit in the similar digital characters cor