A text recognition method and device

By comparing the preliminary recognition results of text recognition with the preset text collection list, and correcting the recognition results, the problem of inaccurate recognition of similar text in the prior art is solved, the accuracy and reliability of text recognition are improved, and it is applicable to Actual scene.

CN114170451BActive Publication Date: 2025-01-10JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111466431.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2025-01-10
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

The existing text recognition engines have low accuracy in identifying similar texts, resulting in unreliable recognition results and cannot be directly applied to actual scenarios.

Method used

By comparing the preliminary recognition results of text recognition with the preset text collection list, the preliminary recognition results are corrected, the recognition accuracy of similar texts is improved, and the reliability of the recognition results are ensured.

Benefits of technology

It improves the accuracy and reliability of text recognition, making the recognition results more suitable for practical applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114170451B_ABST
    Figure CN114170451B_ABST
Patent Text Reader

Abstract

The present invention discloses a text recognition method and device, and relates to the field of computer technology. A specific implementation of the method includes: using a text recognition model to perform text recognition processing on an image to obtain a preliminary recognition result; comparing the preliminary recognition result with a preset text set list for similarity to obtain a target text list that meets the requirements; and correcting the preliminary recognition result according to the target text list that meets the requirements to obtain a final text recognition result. This implementation implements a similarity comparison between the preliminary recognition result of text recognition and a preset text set list to correct the preliminary recognition result, thereby improving the recognition accuracy of similar texts and ensuring the reliability of the text recognition result, so that it can be better applied to actual scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a text recognition method and device. Background Art

[0002] With the development of digital information technology, the text recognition technology that uses computers to automatically recognize characters has developed rapidly. Taking the currently more mature optical character recognition (OCR) as an example, it uses optical technology and computer technology to realize text character recognition and is widely used in the fields of certificate recognition, bill recognition, license plate recognition, document recognition, etc.

[0003] In the process of implementing the present invention, the inventors found that the prior art has the following problems:

[0004] The accuracy of text extracted by the text recognition engine is not high. It is impossible to accurately recognize similar texts, which makes the text results extracted by the text recognition engine unreliable and cannot be used directly, which is not conducive to application in actual scenarios. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a text recognition method and device, which compares the preliminary recognition results of text recognition with a preset text set list for similarity, thereby correcting the preliminary recognition results, improving the recognition accuracy of similar texts, and ensuring the reliability of text recognition results, so that they can be better applied to actual scenarios.

[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a text recognition method is provided, comprising:

[0007] Use the text recognition model to perform text recognition processing on the image to obtain preliminary recognition results;

[0008] Compare the preliminary recognition results with a preset text set list for similarity to obtain a target text list that meets the requirements;

[0009] The preliminary recognition result is modified according to the target text list that meets the requirements to obtain a final text recognition result.

[0010] Optionally, before comparing the preliminary recognition result with a preset text set list for similarity, it also includes: dividing the preliminary recognition result into: a Chinese character result set, a foreign character result set and a digital result set; comparing the preliminary recognition result with a preset text set list for similarity includes: comparing the Chinese character result set, the foreign character result set and the digital result set with the preset text set list for similarity, respectively.

[0011] Optionally, before comparing the preliminary recognition result with a preset text set list for similarity, the method further includes: confirming that the number of text characters included in the preliminary recognition result meets a set requirement.

[0012] Optionally, comparing the preliminary recognition result with a preset text set list for similarity includes: comparing the preliminary recognition result with each line of text in the preset text set list for similarity in units of text lines.

[0013] Optionally, the target text list that meets the requirements includes: text in the text collection list that is completely identical to the text line of the preliminary recognition result; text in the text collection list that has a text inclusion relationship with the text line of the preliminary recognition result; text in the text collection list whose character similarity with the text line of the preliminary recognition result meets a set similarity threshold.

[0014] Optionally, the text collection list is obtained by preprocessing the text collection to be used in units of lines, and each line of text in the text collection list has a frequency attribute; the preliminary recognition result is compared with the preset text collection list for similarity to obtain a target text list that meets the requirements, including: comparing each text line in the preliminary recognition result with the preset text collection list for similarity to obtain the target text corresponding to each text line; for each text line, obtaining the frequency attribute value of the corresponding target text; for repeated text lines in the preliminary recognition result, if the number of similarity comparisons of the text line is equal to the frequency attribute value of the corresponding target text, then the target text is added to the target text list as the target text corresponding to the text line; otherwise, it is not added to the target text list.

[0015] Optionally, for a text line in the preliminary recognition result, if no target text corresponding to the text line is obtained, the text in the text collection list with the highest similarity to the text line is summarized according to a preset format, and confirmation is made as to whether to add it to the text collection list.

[0016] According to a second aspect of an embodiment of the present invention, there is provided a text recognition device, comprising:

[0017] A preliminary recognition result acquisition module is used to use a text recognition model to perform text recognition processing on the image to obtain a preliminary recognition result;

[0018] A text comparison module is used to compare the preliminary recognition result with a preset text set list for similarity to obtain a target text list that meets the requirements;

[0019] The text correction module is used to correct the preliminary recognition result according to the target text list that meets the requirements to obtain the final text recognition result.

[0020] According to a third aspect of an embodiment of the present invention, there is provided a text recognition electronic device, characterized in that it includes:

[0021] one or more processors;

[0022] a storage device for storing one or more programs,

[0023] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.

[0024] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.

[0025] An embodiment of the invention has the following advantages or beneficial effects: a preliminary recognition result is obtained by performing text recognition processing on an image using a text recognition model; the preliminary recognition result is compared with a preset text collection list for similarity to obtain a target text list that meets the requirements; the preliminary recognition result is corrected according to the target text list that meets the requirements to obtain a final text recognition result. The technical solution realizes the comparison of the preliminary recognition result of text recognition with a preset text collection list for similarity to correct the preliminary recognition result, improves the recognition accuracy of similar texts, ensures the reliability of text recognition results, and is better applied to actual scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0027] Figure 1 is a schematic diagram of the main process of the text recognition method according to an embodiment of the present invention;

[0028] Figure 2 1 is a schematic diagram of the overall flow of the text recognition method according to an embodiment of the present invention;

[0029] Figure 3 is a detailed flowchart of a text recognition method according to an embodiment of the present invention;

[0030] Figure 4 is a schematic diagram of main modules of a text recognition device according to an embodiment of the present invention;

[0031] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0032] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0034] At present, the accuracy of text extracted by the text recognition engine is not high. For similar texts, it is impossible to accurately recognize them, which makes the text results extracted by the text recognition engine unreliable and cannot be used directly, and cannot meet the actual application well. For example, for 0 and o, which are similar texts, it is easy to make recognition errors when using the text recognition engine to recognize them.

[0035] In order to solve the above-mentioned problems existing in the prior art, the present invention proposes a text recognition method, which compares the preliminary recognition results of text recognition with a preset text set list for similarity, thereby correcting the preliminary recognition results, improving the recognition accuracy of similar texts, and ensuring the reliability of text recognition results, so that it can be better applied to actual scenarios.

[0036] In the introduction to the embodiments of the present invention, the terms and their meanings are as follows:

[0037] OCR: Optical Character Recognition, refers to the process by which an electronic device (such as a scanner or digital camera) examines characters printed on paper, determines their shape by detecting dark and light patterns, and then uses character recognition methods to translate the shape into computer text;

[0038] SVD: Singular Value Decomposition, a matrix decomposition method that can be used not only for feature decomposition in dimensionality reduction algorithms, but also for natural language processing and other fields;

[0039] BM25 algorithm: an algorithm based on the probabilistic retrieval model, which can be used to evaluate the relevance between search terms and documents;

[0040] TF-IDF algorithm: Term Frequency–Inverse Document Frequency, a commonly used weighting technique for information retrieval and text mining;

[0041] Fuzz.ratio: A string comparison method.

[0042] Figure 1 is a schematic diagram of the main process of the text recognition method according to an embodiment of the present invention. Figure 1 As shown, the text recognition method of the embodiment of the present invention includes the following steps S101 to S103.

[0043] Step S101: Use a text recognition model to perform text recognition processing on the image to obtain a preliminary recognition result.

[0044] Specifically, based on the existing text recognition methods, the picture to be recognized is input into the text recognition model, and the text set in the picture to be recognized is extracted through the character recognition method to obtain a preliminary recognition result. The preliminary recognition result at this time may contain misrecognized characters, such as: "Graduate student" is extracted from the text recognition model as "research friend". In order to improve the accuracy of the recognition results, the preliminary recognition results are processed and corrected for the second time to obtain a recognition result with high accuracy.

[0045] Step S102: Compare the preliminary recognition result with a preset text set list for similarity to obtain a target text list that meets the requirements.

[0046] According to an embodiment of the present invention, before comparing the preliminary recognition result with a preset text set list for similarity, it also includes: confirming that the number of text characters included in the preliminary recognition result meets a set requirement.

[0047] Specifically, the purpose of text recognition technology is to automatically recognize image text through a computer, avoiding the process of manual recognition and then converting it into computer text, so as to improve business efficiency. If the number of text characters in the preliminary recognition result is too small, it is not meaningful to use the text recognition of the present invention. For example: if there is only one text character in the preliminary recognition result, then it is not meaningful to process and correct this one character. Therefore, in one embodiment of the present invention, it is necessary to perform the operation under the premise that the number of text characters included in the preliminary recognition result is greater than 1.

[0048] According to another embodiment of the present invention, comparing the preliminary recognition result with a preset text set list for similarity includes: comparing the preliminary recognition result with each line of text in the preset text set list for similarity in units of text lines.

[0049] Specifically, the preliminary recognition results extracted by the above-mentioned text recognition model are grouped by line, and each group is compared with a preset list of text sets in a loop similarity comparison. The user can also selectively group the key text information in the above-mentioned preliminary recognition results and compare it with the preset list of text sets in a loop similarity comparison to obtain a target text list that meets the requirements.

[0050] According to another embodiment of the present invention, the target text list that meets the requirements includes: the text in the text set list that is exactly the same as the text line of the preliminary recognition result; the text in the text set list that has a character inclusion relationship with the text line of the preliminary recognition result; the text in the text set list whose character similarity with the text line of the preliminary recognition result meets the set similarity threshold.

[0051] Specifically, according to the similarity comparison results between the preliminary recognition result and the preset text set list, it can be divided into three types: the text in the text set list that is exactly the same as the text line of the preliminary recognition result; the text in the text set list that has a character inclusion relationship with the text line of the preliminary recognition result. For example, the preliminary recognition result is "Green operation succeeded", and the text in the text set list is "Operation succeeded"; the text in the text set list whose character similarity with the text line of the preliminary recognition result is greater than the set similarity threshold. For example, the preliminary recognition result is "Guan Bin", and the text in the text set list is "Answer". At this time, the similarity result of the two texts is greater than the set similarity threshold (for example, 61.8%). That is, the "Answer" in the text set list is the target text that meets the requirements. In an embodiment of the present invention, the similarity threshold can be set according to the golden section point of the character shape.

[0052] Figure 2 It is a schematic diagram of the overall process of the text recognition method according to an embodiment of the present invention. The picture to be recognized is input into the OCR model for training. According to the OCR text extraction result, the preliminary recognition result is determined as the text with the number of text characters greater than 1; the preliminary recognition result is grouped by line and compared with the preset list of text sets in a grouped loop similarity comparison. In the comparison results between the preliminary recognition result and the preset list of text sets, if it meets the conditions of being exactly equal, or the two sets have an inclusion relationship, or the similarity is greater than 61.8%, then the text in the preset list of text sets meets the conditions, and subsequent correction processing can be performed.

[0053] According to another embodiment of the present invention, before comparing the similarity between the preliminary recognition result and the preset list of text sets, it further includes: dividing the preliminary recognition result into: a Chinese character result set, a foreign character result set, and a digital result set.

[0054] Specifically, in the existing text recognition methods, for picture texts that are a combination of Chinese, foreign and numbers, the confusion caused by foreign and number recognition is the main influencing factor of the text recognition accuracy. For example, in text recognition, the number "0" and the letter "o" are often confused. In order to solve this problem, the above preliminary recognition results are classified into Chinese, foreign and numbers, that is, the preliminary recognition results are divided into: Chinese character result set, foreign character result set and number result set. When the preliminary recognition results are compared with the preset text set list for similarity, the Chinese character result set, the foreign character result set and the number result set can be compared with the preset text set list for similarity.

[0055] By dividing the preliminary recognition results into Chinese, foreign language and digital result sets, the problem of character type confusion in conventional character recognition methods can be effectively avoided, thereby improving the recognition accuracy.

[0056] According to an embodiment of the present invention, the text set list is obtained by preprocessing the text set to be used in units of lines, and each line of text in the text set list has a frequency attribute.

[0057] Specifically, the above text set list is based on the text set to be used, and is preprocessed in a line unit according to a preset format. Each line includes a text segment information, and the format is shown in Table 1 below:

[0058] Table 1

[0059] Serial number Label action content Content Information property Property information

[0060] Preprocess the text collection to be used according to the above format to obtain a text collection list. For this format, since there may be repeated identical text content in the preliminary recognition results, and in the final text recognition results, there may be different subsequent operations for repeated identical text. For example, the image to be recognized is a web page searched by Baidu, and there are multiple "Baidu" words on the web page. For the "Baidu" search button next to the search bar, the "Baidu" here corresponds to the click search operation, while the "Baidu" in other locations has semantic communication and link push. In order to distinguish the subsequent different operations of the same repeated text in the image, the above format is accompanied by attribute information, and the attribute information includes: number and position. The number is used to identify the serial number of the specified repeated identical text to be recognized. In addition, for individual recognition positions that cannot be determined through text, they can be determined through the position of the attribute information in the above format. For example, in the Baidu search bar mentioned above, since the initial content of the search bar is empty, text recognition cannot locate this position. Through the position information in the attribute information in the above format, the position of the "Baidu" search button can be determined based on the number of times the "Baidu" search button is clicked, and then the search bar can be located according to the position of the attribute information in the format, so as to facilitate the recognition of automatically typed text content during subsequent non-manual operations.

[0061] By setting the properties of the text collection list, repeated texts can be better distinguished so that subsequent operations can be performed correctly, thereby improving the accuracy of text recognition and ensuring that the results of text recognition can be directly applied to actual business systems.

[0062] In addition, for the above format, since the text set of each line needs to contain all possible similar text segments, the content information of each line is composed of multiple similar text segments. For example, the text information corresponding to the standard text segment in the text set is content1, and the text information similar to the standard text segment is content2, content3, content4, and so on.

[0063] For example, the text set list is shown in Table 2 below:

[0064] Table 2

[0065]

[0066] The above exemplary text collection list is used for task effect analysis, and the corresponding subsequent operation is a click action. The content information includes "yesterday" and "work day". "Work day" is a similar text to the standard text "yesterday". The first "0" in the attribute information means that only the first text in the picture text with a high similarity to "yesterday" or "work day" needs to be identified for text replacement, and "(0, 0)" means that there is no need to offset and locate other positions.

[0067] According to another embodiment of the present invention, the preliminary recognition result is compared with a preset text collection list for similarity to obtain a target text list that meets the requirements, including: each text line in the preliminary recognition result is compared with a preset text collection list for similarity to obtain the target text corresponding to each text line; for each text line, the number of attribute values ​​of the corresponding target text is obtained; for repeated text lines in the preliminary recognition result, if the number of similarity comparisons of the text line is equal to the number of attribute values ​​of the corresponding target text, the target text is added to the target text list as the target text corresponding to the text line; otherwise, it is not added to the target text list.

[0068] Specifically, since there are differences between the results obtained by using different text recognition models to perform text recognition processing on images, it is necessary to uniformly and compatibly regularize the text recognition results in units of lines. The regularized output of the final text extraction results is shown in Table 3 below:

[0069] Table 3

[0070] Serial number content Location coordinates Similarity

[0071] The content of the above regularized output is the content of the line text segment, the position is the line position, and the similarity is the similarity when the text recognition model is extracted.

[0072] Each text line in the above preliminary recognition result is compared with the preset text collection list for similarity to obtain the target text corresponding to each text line that meets the requirements, wherein the similarity comparison can be achieved by using SVD singular value decomposition to obtain a vector to calculate the similarity, Fuzz.ratio algorithm, BM25 algorithm, TF-IDF algorithm and other character comparison methods; for each text line, obtain the corresponding number attribute value of the target text that meets the requirements, and this attribute value can be set in advance as needed; for the repeated identical text lines in the preliminary recognition result, if the number of similarity comparisons of the text line is equal to the number attribute value of the corresponding target text, of course, if the number value in the attribute information in the above text collection list is initially 0, the corresponding number of similarity comparisons minus 1 is equal to the number attribute value of the target text in the corresponding text collection list, then the target text is added to the target text list as the target text corresponding to the text line; otherwise, this target text is a non-recognition object and does not need to be added to the target text list.

[0073] According to another embodiment of the present invention, for a text line in the preliminary recognition result, if a target text corresponding to the text line is not obtained, the text in the text collection list that is most similar to the text line is summarized according to a preset format, and it is confirmed whether to add it to the text collection list.

[0074] Specifically, if the target text corresponding to the text line is not obtained, the text in the text set list with the highest similarity to the text line is summarized according to a preset format, and it is manually confirmed whether it needs to be added to the text set list. The preset format is shown in Table 4 below:

[0075] Table 4

[0076]

[0077] If it is manually confirmed that it can be added to the text collection list to enrich the text collection list and further improve the text recognition accuracy, it will be maintained in the format of the above text collection list for subsequent use.

[0078] Step S103: modify the preliminary recognition result according to the target text list that meets the requirements to obtain a final text recognition result.

[0079] Specifically, a result document is generated according to the target text list that meets the requirements and the preliminary recognition result, wherein the result document includes: labels, text content information and position coordinate information; the text is assembled and corrected according to the result document to obtain the final text recognition result.

[0080] Figure 3 1 is a detailed flow chart of the text recognition method of an embodiment of the present invention. After OCR text model extraction, an OCR text list is obtained. The text list is divided into Chinese characters, foreign characters and digital characters to obtain corresponding Chinese character result sets, foreign character result sets and digital result sets. When performing character division processing, it can also include: extraction and regularization processing; taking lines as units, using fuzz.ratio to perform line-by-line loop comparisons on the Chinese character result set, foreign character result set and digital result set with the text set list respectively. The three types of comparisons are similar. In the figure, one of the Chinese character result set, foreign character result set and digital result set is taken as an example to compare the similarity ratio. The comparison process is explained. If a text is found, and the text is any of the above-mentioned requirements of complete equality, inclusion relationship, and similarity>61.8%, then the attribute information in the text list is taken, and whether the requirements are met is determined according to the number value in the attribute information. If the requirements are met, the text information is added to the target text list; according to the result document, the OCR original text is replaced, the text is reloaded, the coordinates, labels and content are updated, the preliminary recognition results are corrected, and the final text recognition results are obtained; if no text that meets the requirements is found after the fuzz.ratio comparison, the text with the highest similarity is taken and the information is summarized according to the preset format, and it is manually confirmed whether it needs to be put into the text collection list.

[0081] Through the above-mentioned text recognition method, not only the recognition results of Chinese, foreign languages ​​and numbers are effectively distinguished, but also the preliminary recognition results are processed and corrected secondary based on the character comparison algorithm, which effectively ensures the reliability and accuracy of text recognition.

[0082] Figure 4 Schematic diagram of the main modules of the text recognition device according to an embodiment of the present invention. Figure 4 As shown, the text recognition device 400 mainly includes a preliminary recognition result acquisition module 401 , a text comparison module 402 and a text correction module 403 .

[0083] A preliminary recognition result acquisition module 401 is used to perform text recognition processing on the image using a text recognition model to obtain a preliminary recognition result;

[0084] The text comparison module 402 is used to compare the preliminary recognition result with a preset text set list for similarity to obtain a target text list that meets the requirements;

[0085] The text correction module 403 is used to correct the preliminary recognition result according to the target text list that meets the requirements to obtain a final text recognition result.

[0086] Specifically, the text recognition device 400 may also include a recognition result classification module (not shown in the figure), which is used to: before comparing the preliminary recognition results with a preset text set list for similarity, divide the preliminary recognition results into: a Chinese character result set, a foreign character result set and a digital result set; the text comparison module 402 may also be used to: compare the Chinese character result set, the foreign character result set and the digital result set with the preset text set list for similarity.

[0087] Specifically, the text recognition device 400 may further include a character number judgment module (not shown in the figure) for confirming that the number of text characters included in the preliminary recognition result meets the set requirements before comparing the preliminary recognition result with a preset text set list for similarity.

[0088] Specifically, the text comparison module 402 can also be used to: compare the preliminary recognition result in units of text lines with each line of text in a preset text set list for similarity.

[0089] Specifically, the target text list that meets the requirements includes: text in the text collection list that is completely identical to the text line of the preliminary recognition result; text in the text collection list that has a text inclusion relationship with the text line of the preliminary recognition result; text in the text collection list whose character similarity with the text line of the preliminary recognition result meets the set similarity threshold.

[0090] Specifically, the text set list is obtained by preprocessing the text set to be used in units of lines, and each line of text in the text set list has a frequency attribute.

[0091] Specifically, the text comparison module 402 can also be used to: compare the similarity of each text line in the preliminary recognition result with a preset text set list to obtain the target text corresponding to each text line; for each text line, obtain the number attribute value of the corresponding target text; for repeated text lines in the preliminary recognition result, if the number of similarity comparisons of the text line is equal to the number attribute value of the corresponding target text, then add the target text as the target text corresponding to the text line to the target text list; otherwise, do not add it to the target text list.

[0092] Specifically, the text comparison module 402 can also be used for: for a text line in the preliminary recognition result, if the target text corresponding to the text line is not obtained, the text with the highest similarity to the text line in the text collection list is summarized according to a preset format, and confirmation is made whether to add it to the text collection list.

[0093] Figure 5 An exemplary system architecture 500 is shown to which the text recognition method or text recognition apparatus according to the embodiment of the present invention can be applied.

[0094] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0095] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Terminal devices 501, 502, 503 can be installed with various communication client applications, such as text recognition applications, text scanning applications, etc. (only examples).

[0096] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0097] The server 505 may be a server that provides various services, such as a background management server (only an example) that supports text recognition performed by users using the terminal devices 501, 502, and 503. The background management server may use a text recognition model to perform text recognition processing on the image to obtain a preliminary recognition result; compare the preliminary recognition result with a preset text set list for similarity to obtain a target text list that meets the requirements; modify the preliminary recognition result according to the target text list that meets the requirements to obtain a final text recognition result, and feed back the processing result (such as a text recognition result, etc. - only an example) to the terminal device.

[0098] It should be noted that the text recognition method provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the text recognition device is generally disposed in the server 505 .

[0099] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0100] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 6 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0101] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0102] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0103] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.

[0104] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination thereof.

[0105] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0106] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, for example, it may be described as follows: a processor includes: a preliminary recognition result acquisition module, a text comparison module and a text correction module.

[0107] The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, a preliminary recognition result acquisition module can also be described as a "module for performing text recognition processing on images using a text recognition model to obtain preliminary recognition results."

[0108] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiment; or may exist independently without being assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device includes: using a text recognition model to perform text recognition processing on an image to obtain a preliminary recognition result; comparing the preliminary recognition result with a preset text set list for similarity to obtain a target text list that meets the requirements; and correcting the preliminary recognition result according to the target text list that meets the requirements to obtain a final text recognition result.

[0109] According to the technical solution of the embodiment of the present invention, it has the following advantages or beneficial effects: using a text recognition model to perform text recognition processing on an image to obtain a preliminary recognition result; comparing the preliminary recognition result with a preset text collection list for similarity to obtain a target text list that meets the requirements; correcting the preliminary recognition result according to the target text list that meets the requirements to obtain the final text recognition result. The technical solution realizes comparing the preliminary recognition result of text recognition with a preset text collection list for similarity to correct the preliminary recognition result, improves the recognition accuracy of similar texts, ensures the reliability of text recognition results, and is better applied to actual scenarios.

[0110] The specific implementation methods described herein do not constitute limitations on the scope of protection of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A text recognition method, characterized in that: include: Use the text recognition model to perform text recognition processing on the image to obtain preliminary recognition results; Compare the preliminary recognition results with a preset text set list for similarity to obtain a target text list that meets the requirements; The text set list is obtained by preprocessing the text set to be used in units of lines, and each line of text in the text set list has a frequency attribute; the preliminary recognition result is compared with the preset text set list for similarity to obtain a target text list that meets the requirements, including: Compare each text line in the preliminary recognition result with a preset text set list for similarity, and obtain the target text corresponding to each text line; for each text line, obtain the number attribute value of the corresponding target text; for repeated text lines in the preliminary recognition result, if the number of similarity comparisons of the text line is equal to the number attribute value of the corresponding target text, then add the target text as the target text corresponding to the text line to the target text list; otherwise, do not add it to the target text list; The preliminary recognition result is modified according to the target text list that meets the requirements to obtain a final text recognition result.

2. The method according to claim 1, characterized in that Before comparing the preliminary recognition result with the preset text set list for similarity, the method further includes: Dividing the preliminary recognition results into: a Chinese character result set, a foreign character result set and a number result set; Comparing the preliminary recognition result with a preset text set list for similarity includes: The Chinese character result set, the foreign character result set and the number result set are respectively compared with a preset text set list for similarity.

3. The method according to claim 1, characterized in that Before comparing the preliminary recognition result with the preset text set list for similarity, the method further includes: Confirm that the number of text characters included in the preliminary recognition result meets the set requirements.

4. The method according to claim 1, characterized in that: Comparing the preliminary recognition result with a preset text set list for similarity includes: The preliminary recognition result is compared with each line of text in a preset text set list in units of text lines.

5. The method according to claim 4, characterized in that The target text list that meets the requirements includes: Text in the text set list that is completely identical to the text line of the preliminary recognition result; The text in the text set list having a text inclusion relationship with the text line of the preliminary recognition result; The text in the text set list whose character similarity with the text line of the preliminary recognition result meets the set similarity threshold.

6. The method according to claim 1, characterized in that Also includes: For a text line in the preliminary recognition result, if no target text corresponding to the text line is obtained, the text in the text collection list with the highest similarity to the text line is summarized according to a preset format, and it is confirmed whether to add it to the text collection list.

7. A text recognition device, characterized in that: include: A preliminary recognition result acquisition module is used to use a text recognition model to perform text recognition processing on the image to obtain a preliminary recognition result; A text comparison module is used to compare the preliminary recognition result with a preset text set list for similarity to obtain a target text list that meets the requirements; The text set list is obtained by preprocessing the text set to be used in units of lines, and each line of text in the text set list has a frequency attribute; The text comparison module can also be used to: compare the similarity of each text line in the preliminary recognition result with a preset text set list to obtain the target text corresponding to each text line; for each text line, obtain the number attribute value of the corresponding target text; for repeated text lines in the preliminary recognition result, if the number of similarity comparisons of the text line is equal to the number attribute value of the corresponding target text, then add the target text as the target text corresponding to the text line to the target text list; otherwise, do not add it to the target text list; The text correction module is used to correct the preliminary recognition result according to the target text list that meets the requirements to obtain the final text recognition result.

8. A mobile electronic device terminal, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Correction method and apparatus for OCR result

    CN107220639A