Text recognition method, apparatus, device, and storage medium

By applying various processing methods to text recognition and entity matching of seal images, the problem of low accuracy in seal text recognition has been solved, achieving higher accuracy in text recognition.

CN116721426BActive Publication Date: 2026-08-04CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2023-06-27
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

In existing technologies, the text in seals is arranged in an arc shape and the covered area is subject to document interference, resulting in low text recognition accuracy.

Method used

Multiple processing methods are used to process the image to be recognized, generating multiple target images to be recognized. Text recognition and entity recognition are performed, and the target entity recognition result is determined by matching with standard entities. This includes rotation and stretching processing. Named entity recognition and word segmentation algorithms are combined to correct the recognition result.

Benefits of technology

It improves the accuracy of seal text recognition, corrects errors in the recognition results, and ensures the accuracy and consistency of the recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116721426B_ABST
    Figure CN116721426B_ABST
Patent Text Reader

Abstract

This disclosure provides a text recognition method, apparatus, device, and storage medium, which can be applied to image processing and fintech fields. The method includes: processing images to be recognized according to N different processing methods to obtain N target images to be recognized, where N is an integer greater than or equal to 2; performing text recognition on each target image to obtain N initial text recognition results; performing entity recognition on each initial text recognition result to obtain M entity recognition result sets, where each entity recognition result set includes N entity recognition results, and M is an integer greater than or equal to 1; matching each entity recognition result in each entity recognition result set with multiple standard entities to obtain matching results; determining target entity recognition results based on the matching results and the entity recognition result sets; and obtaining target recognized text based on the M target entity recognition results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of image processing and financial technology, and in particular to a text recognition method, apparatus, device and storage medium. Background Technology

[0002] Currently, companies frequently need to identify and extract characters from seals. Among related technologies, Optical Character Recognition (OCR) technology can be used to extract character information from seals.

[0003] In realizing the present invention, the inventors discovered at least the following problems in the related technology: because the characters in the seal are usually arranged in an arc shape, and the area covered by the seal is usually interfered with by the text or lines of the document itself, the accuracy of the recognized text is low. Summary of the Invention

[0004] In view of the above problems, this disclosure provides text recognition methods, apparatus, devices, media and program products.

[0005] According to a first aspect of this disclosure, a text recognition method is provided, comprising: processing images to be recognized according to N different processing methods to obtain N target images to be recognized, wherein N is an integer greater than or equal to 2; performing text recognition on each of the target images to be recognized to obtain N initial text recognition results; performing entity recognition on each of the initial text recognition results to obtain M entity recognition result sets, wherein each of the entity recognition result sets includes N entity recognition results, and M is an integer greater than or equal to 1; matching each entity recognition result in each of the entity recognition result sets with multiple standard entities to obtain matching results; determining target entity recognition results based on the matching results and the entity recognition result sets; and obtaining target recognized text based on the M target entity recognition results.

[0006] According to embodiments of this disclosure, the above-mentioned entity recognition for each initial text recognition result to obtain M entity recognition result sets includes: performing word segmentation on each initial text recognition result to obtain word segmentation results, wherein the word segmentation results include multiple word segments and the word segmentation character position of each word segmentation in the initial text recognition result; performing noun part-of-speech entity recognition on each initial text recognition result to obtain M initial entity recognition result sets; determining the entity character position of each initial entity recognition result in the initial text recognition result for each initial entity recognition result in each initial entity recognition result set; and if the character position spacing between the word segmentation character position and the entity character position is determined to be less than a predetermined character spacing threshold, the initial entity recognition result is used as the entity recognition result in the entity recognition result set.

[0007] According to embodiments of this disclosure, determining the target entity recognition result based on the matching result and the entity recognition result set includes: when it is determined that the matching result is used to characterize that there is an entity recognition result in the entity recognition result set that completely matches the standard entity, the entity recognition result is taken as the target entity recognition result; when it is determined that the matching result is used to characterize that there are multiple initial target entity recognition results in the entity recognition result set that match multiple standard entities one by one, the similarity between the multiple initial target entity recognition results is determined to obtain a similarity result; and based on the similarity result, the target entity recognition result is determined from the multiple initial target entity recognition results.

[0008] According to an embodiment of this disclosure, obtaining target identification text based on the identification results of M target entities includes: performing regional hierarchical relationship identification on the M target entity identification results to obtain identification results; and when it is determined that there is an error in the identification results used to characterize the hierarchical relationship between the M target entity identification results, updating the M target entity identification results based on standard regional hierarchical relationship information to obtain the target identification text.

[0009] According to an embodiment of this disclosure, obtaining target recognition text based on M target entity recognition results includes: determining initial target recognition text based on M initial target entity recognition results; comparing the number of characters in the initial target recognition text with the number of characters in the standard text to obtain a character count difference; and if the character count difference is less than or equal to the predetermined character count threshold, using the initial target recognition text as the target recognition text.

[0010] According to embodiments of this disclosure, the above-mentioned matching of each entity recognition result in each of the above-mentioned entity recognition result sets with multiple standard entities to obtain a matching result includes: for each entity character in each of the above-mentioned entity recognition results, performing similarity matching between the entity character and the standard entity character in each of the above-mentioned standard entities to obtain a matching sub-result; and obtaining the above-mentioned matching result based on multiple of the above-mentioned matching sub-results.

[0011] According to embodiments of this disclosure, the method further includes: acquiring standard raw data of a predetermined type; determining the data type of the standard raw data; and supplementing a portion of the content in the standard raw data according to a supplementation method matching the data type to obtain the standard entity.

[0012] According to embodiments of this disclosure, the above-described processing of the image to be identified according to N different processing methods to obtain N target images to be identified includes: for each processing method, rotating the image to be identified according to a rotation angle matching the processing method to obtain an initial target image to be identified; and stretching the initial target image to be identified to obtain the target image to be identified.

[0013] A second aspect of this disclosure provides a text recognition apparatus, comprising: an image processing module for processing images to be recognized according to N different processing methods to obtain N target images to be recognized, wherein N is an integer greater than or equal to 2; a text recognition module for performing text recognition on each of the target images to be recognized to obtain N initial text recognition results; an entity recognition module for performing entity recognition on each of the initial text recognition results to obtain M entity recognition result sets, wherein each of the entity recognition result sets includes N entity recognition results, and M is an integer greater than or equal to 1; an entity matching module for matching each entity recognition result in each of the entity recognition result sets with multiple standard entities to obtain a matching result; a result determination module for determining a target entity recognition result based on the matching result and the entity recognition result sets; and a target determination module for obtaining target recognition text based on the M target entity recognition results.

[0014] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the method described above.

[0015] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the methods described above.

[0016] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0017] According to the text recognition method, apparatus, device, medium and program products provided in this disclosure, text recognition is performed on target images processed by N processing methods to obtain N initial text recognition results; entity recognition is performed on each initial text recognition result, and the entity recognition result is matched with standard entities, thereby realizing the correction of recognition results and effectively improving the accuracy of target text recognition. Attached Figure Description

[0018] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0019] Figure 1 The illustrations depict application scenarios of text recognition methods, apparatuses, devices, media, and program products according to embodiments of the present disclosure.

[0020] Figure 2 A flowchart illustrating a text recognition method according to an embodiment of the present disclosure is shown schematically.

[0021] Figure 3 A schematic diagram of a seal image is shown for a text recognition method according to an embodiment of the present disclosure;

[0022] Figure 4 A schematic block diagram of a text recognition device according to an embodiment of the present disclosure is shown; and

[0023] Figure 5 A block diagram schematically illustrates an electronic device suitable for implementing a text recognition method according to an embodiment of the present disclosure. Detailed Implementation

[0024] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0025] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0026] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0027] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).

[0028] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of data (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.

[0029] Because the text on stamps is usually arranged in an arc shape, and the area covered by the stamp is often interfered with by the text or lines of the document itself, OCR recognition models have a high error rate when recognizing single characters. Related technologies involve rotating the image (e.g., 90°, 180°, 270°) to generate multiple OCR recognition results, and then voting on these results to obtain the final recognition outcome. However, multi-channel recognition alone cannot fundamentally solve the problem of high error rates.

[0030] In view of the above, embodiments of this disclosure provide a text recognition method, a text recognition device, an electronic device, a readable storage medium, and a computer program product. The text recognition method includes: processing images to be recognized according to N different processing methods to obtain N target images to be recognized, where N is an integer greater than or equal to 2; performing text recognition on each target image to obtain N initial text recognition results; performing entity recognition on each initial text recognition result to obtain M entity recognition result sets, where each entity recognition result set includes N entity recognition results, and M is an integer greater than or equal to 1; matching each entity recognition result in each entity recognition result set with multiple standard entities to obtain matching results; determining target entity recognition results based on the matching results and the entity recognition result sets; and obtaining target recognized text based on the M target entity recognition results.

[0031] Figure 1 The illustrations depict application scenarios of text recognition methods, apparatuses, devices, media, and program products according to embodiments of the present disclosure.

[0032] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0033] Users can interact with server 105 via network 104 using at least one of the first terminal device 101, second terminal device 102, and third terminal device 103 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, second terminal device 102, and third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0034] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0035] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0036] It should be noted that the text recognition method provided in this embodiment can generally be executed by server 105. Correspondingly, the text recognition device provided in this embodiment can generally be located in server 105. The text recognition method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the text recognition device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0037] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0038] The following will be based on Figure 1 The described scene, through Figure 2 and Figure 3 The text recognition method of the disclosed embodiments will be described in detail.

[0039] Figure 2 A flowchart illustrating a text recognition method according to an embodiment of the present disclosure is shown schematically.

[0040] like Figure 2 As shown, the text recognition method of this embodiment includes operations S210 to S260.

[0041] In operation S210, the images to be recognized are processed according to N different processing methods to obtain N target images to be recognized, where N is an integer greater than or equal to 2.

[0042] In operation S220, text recognition is performed on each target image to be recognized, resulting in N initial text recognition results.

[0043] In operation S230, entity recognition is performed on each initial text recognition result to obtain M sets of entity recognition results, where each set of entity recognition results includes N entity recognition results, and M is an integer greater than or equal to 1.

[0044] In operation S240, each entity recognition result in each set of entity recognition results is matched with multiple standard entities to obtain a matching result.

[0045] In operation S250, based on the matching result and the set of entity recognition results, a target entity recognition result is determined.

[0046] In operation S260, based on the M target entity recognition results, a target recognition text is obtained.

[0047] According to an embodiment of the present disclosure, the to-be-recognized image is processed in different processing manners. The processing manners include flattening the seal in the to-be-recognized image and stretching the seal in the to-be-recognized image, so as to obtain N target to-be-recognized images. Specifically, N is an integer greater than or equal to 2. Generating N target to-be-recognized images makes the recognition process diverse, thereby improving the accuracy of text recognition.

[0048] Figure 3 A schematic diagram of a seal image of a text recognition method according to an embodiment of the present disclosure is schematically shown.

[0049] According to an embodiment of the present disclosure, as Figure 3 shown, the target to-be-recognized image is input into an OCR recognition model, and text recognition is performed on the target to-be-recognized image, and N initial text recognition results are output. For example: Inputting the target to-be-recognized image in Figure 3 into the OCR recognition model, and outputting 3 initial text recognition results of "area 1 food city", "area 2 food city", and "area 3 food city".

[0050] According to an embodiment of the present disclosure, entity recognition is performed on each initial text recognition result. Specifically, by means of named entity recognition, specific categories of entities, usually nouns, such as personal names, place names, organization names, proper nouns, etc., are recognized from the text. After entity recognition is performed on the initial text recognition result, a set of entity recognition results is obtained, where the set of entity recognition results includes N entity recognition results. For example: The set of entity recognition results obtained for "area 1 food city", "area 2 food city", and "area 3 food city" includes set L1 {area 1, area 2, area 3} and set L2 {food city, food city, food city}.

[0051] According to embodiments of this disclosure, each entity recognition result in the entity recognition result set is matched with multiple standard entities in the database to correct the entity recognition results. The matching result includes whether a standard entity in the database is identical to the entity recognition result. A target entity recognition result is determined based on the matching result and the entity recognition result, wherein the target entity result is the entity recognition result that is identical to the standard entities in the database. The M target entity recognition results are combined according to the order in the initial text recognition results to obtain the target recognized text.

[0052] According to embodiments of this disclosure, text recognition is performed on target images processed by N processing methods to obtain N initial text recognition results; entity recognition is performed on each initial text recognition result, and the entity recognition result is matched with a standard entity, thereby correcting the recognition results and effectively improving the accuracy of target text recognition.

[0053] According to embodiments of this disclosure, entity recognition is performed on each initial text recognition result to obtain a set of M entity recognition results, which may include the following operations:

[0054] Each initial text recognition result is segmented into words to obtain segmentation results, which include multiple words and the position of each word in the initial text recognition result. Each initial text recognition result is then subjected to entity recognition for noun part-of-speech tagging to obtain M initial entity recognition result sets. For each initial entity recognition result in each initial entity recognition result set, the position of the entity character in the initial text recognition result is determined. If the character position spacing between the segmented word character position and the entity character position is less than a predetermined character spacing threshold, the initial entity recognition result is used as the entity recognition result in the entity recognition result set.

[0055] According to an embodiment of the present disclosure, the named entity recognition and word segmentation algorithms in the Jieba tool can be utilized. By establishing a large database of proper nouns, address names, and organization names, each initial text recognition result can be processed to obtain a word segmentation result. The word segmentation result includes multiple segmented words and the word segmentation character positions of each segmented word in the initial text recognition result. For example: By segmenting the initial text recognition result "le diqu1 meishicheng", the word segmentation result is "diqu1" and "meishicheng", where the word segmentation character position of "diqu1" is 1 and the word segmentation character position of "meishicheng" is 4. By segmenting "diqu2 meicheng", the word segmentation result is "diqu2" and "meicheng", where the word segmentation character position of "diqu2" is 0 and the word segmentation character position of "meicheng" is 3. By segmenting "le diqu3 meishicheng", the word segmentation result is "diqu3" and "meishicheng", where the word segmentation character position of "diqu3" is 1 and the word segmentation character position of "meishicheng" is 4.

[0056] According to an embodiment of the present disclosure, entity recognition of the noun词性 is performed on each initial text recognition result. Among them, the noun词性 includes multiple types, such as: region type and organization type, etc. For example: Entity recognition of the noun词性 is performed on 3 initial text recognition results of "le diqu1 meishicheng", "diqu2 meicheng", and "le diqu3 meishicheng", and the initial entity recognition result set L1 of the region type {diqu1, diqu2, diqu3} and the initial entity recognition result set L2 of the organization type {meishicheng, meicheng, meishicheng} are obtained.

[0057] According to an embodiment of the present disclosure, the font character positions of each initial entity recognition result in the initial entity recognition result set are determined. For example: The font character position of "diqu1" in the initial entity recognition result set L1 is 1, the font character position of "diqu2" is 0, and the font character position of "diqu3" is 1. The minimum and maximum values of the font character positions in the initial entity recognition result set are determined, and the difference between the two is calculated to obtain the character position spacing. It is judged whether the character position spacing is less than a predetermined character spacing threshold to reduce the problem that the initial entity recognition result characters become longer due to errors in character recognition by the OCR recognition model. Specifically, the predetermined character spacing threshold can be set to 2 characters. For example: For the initial entity recognition result set L1, the minimum font character position is 0 and the maximum is 1, so the character position spacing is 1, which is less than the predetermined character spacing threshold. Therefore, it is determined that this initial entity recognition result is in a normal recognition state.

[0058] According to an embodiment of the present disclosure, based on the matching result and the entity recognition result set, the target entity recognition result can be determined, which may include the following operations:

[0059] It should be noted that the "词性" in the original text seems to be an incorrect or incomplete expression. It might be better to check and correct it in the original content for a more accurate translation. Here, it is translated as "词性" as it is, but it may need to be adjusted according to the actual correct term.If the matching result is determined to represent an entity recognition result that completely matches a standard entity in the entity recognition result set, the entity recognition result is taken as the target entity recognition result. If the matching result is determined to represent multiple initial target entity recognition results that match multiple standard entities one-to-one in the entity recognition result set, the similarity between the multiple initial target entity recognition results is determined to obtain the similarity result. Based on the similarity result, the target entity recognition result is determined from the multiple initial target entity recognition results.

[0060] According to embodiments of this disclosure, the entity recognition result is matched with multiple standard entities in a database. If it is determined that the matching result represents an entity recognition result in the entity recognition result set that completely matches a standard entity, then the entity recognition result is taken as the target entity recognition result. For example, if "Region 1" is matched with standard entities in the database, and it is determined that there is a standard entity in the database that is exactly the same as "Region 1", then "Region 1" is determined as the target entity recognition result.

[0061] According to embodiments of this disclosure, if multiple entity recognition results are matched with standard entities in a database, and it is found that the entity recognition result set contains multiple initial target entity recognition results that match multiple standard entities one-to-one. For example, matching "Region 1", "Region 2", and "Region 3" with multiple standard entities in the database determines that there are standard entities in the database that are completely identical to "Region 1" and "Region 2". Further, the similarity between the multiple initial target entity recognition results is determined. Specifically, the similarity between "Region 1" and "Region 2" and "Region 3" is determined separately, and the similarity between "Region 2" and "Region 1" and "Region 3" is determined separately to obtain similarity results.

[0062] According to embodiments of this disclosure, in determining the similarity between initial target entity recognition results, an open-source Chinese character similarity algorithm from natural language processing can be used. The initial target entity recognition result with the highest similarity among the similarity results is determined as the target entity recognition result. Specifically, if the similarity in the similarity results for "Region 1" is greater than the similarity in the similarity results for "Region 2", then "Region 1" is determined as the target entity recognition result. By determining the similarity, the initial target entity recognition results are corrected, making the target entity recognition results more accurate and reasonable.

[0063] According to embodiments of this disclosure, obtaining target-identified text based on M target entity recognition results may include the following operations:

[0064] The geographic hierarchy relationship of the M target entity identification results is identified to obtain the identification results. If it is determined that the identification results are incorrect in representing the hierarchical relationship between the M target entity identification results, the M target entity identification results are updated based on the standard geographic hierarchy relationship information to obtain the target identification text.

[0065] According to embodiments of this disclosure, after arranging the M target entity recognition results in the order of the initial text recognition results, the geographic hierarchy relationship of the multiple target entity recognition results is identified. For example, if the target entity recognition results include "×× Province" and "×× City", the geographic hierarchy relationship of "×× Province" and "×× City" is identified to determine whether "×× City" belongs to "×× Province". If they do, the geographic hierarchy relationship is determined to be correct; if they do not, the geographic hierarchy relationship is determined to be incorrect.

[0066] According to embodiments of this disclosure, when the geographical hierarchy is incorrect, the target entity recognition results are updated. Based on the geographical hierarchy, after determining the target entity recognition results corresponding to the first level, the target entity recognition results corresponding to the second level are determined based on the target entity recognition results corresponding to the first level. For example, after "×× Province" is determined in the target entity recognition results, the subsequent target entity recognition results include "City 1" and "City 2". By searching the database for the city corresponding to "×× Province", it is determined that "City 1" belongs to "×× Province", and therefore the target entity recognition results are updated. The updated target entity recognition results are combined in the order of the initial text recognition results to obtain the target recognition text.

[0067] According to embodiments of this disclosure, obtaining target-identified text based on M target entity recognition results may include the following operations:

[0068] Based on the initial target entity recognition results of M, the initial target recognition text is determined; the number of characters in the initial target recognition text is compared with the number of characters in the standard text to obtain the character count difference; if the character count difference is less than or equal to a predetermined character count threshold, the initial target recognition text is used as the target recognition text.

[0069] According to embodiments of this disclosure, the initial target entity recognition results are combined in the order of the initial text recognition results to obtain the initial target recognition text. The initial target recognition text is matched with standard text in the database to determine the number of characters in the initial target recognition text and the number of characters in the matching standard text, and the difference between the two is obtained as the character count difference. For example, the initial target recognition text 1 has 6 characters, the initial target recognition text 2 has 8 characters, and the standard text corresponding to both initial target recognition text 1 and initial target recognition text 2 has 5 characters. Therefore, the character count difference with the initial target recognition text 1 is determined to be 1, and the character count difference with the initial target recognition text 2 is determined to be 3.

[0070] According to embodiments of this disclosure, if the difference in the number of characters is less than or equal to a predetermined character count threshold, it indicates that the current initial target recognition text is relatively accurate. Therefore, the initial target recognition text is used as the target recognition text. The predetermined character count threshold can be set to 1 character. As the predetermined character count threshold decreases, the target recognition text becomes more accurate.

[0071] According to embodiments of this disclosure, matching each entity recognition result in each entity recognition result set with multiple standard entities to obtain matching results may include the following operations:

[0072] For each entity character in each entity recognition result, the entity character is matched with the standard entity character in each standard entity to obtain a matching sub-result; based on multiple matching sub-results, the matching result is obtained.

[0073] According to embodiments of this disclosure, entity characters are matched with standard entity characters in each standard entity based on similarity. A matching result is obtained based on multiple matching sub-results. Specifically, similarity matching can be implemented using an open-source Chinese character similarity algorithm from natural language processing. For example, if the similarity between "region 1" and the standard entity "region X" is determined to be 90%, the similarity between "region 2" and the standard entity "region X" is determined to be 70%, and the similarity between "region 3" and the standard entity "region X" is determined to be 50%, then "region 1" is determined to have the highest similarity. Performing similarity matching makes the final matching result more accurate.

[0074] According to embodiments of this disclosure, the text recognition method may further include the following operations:

[0075] Obtain standard raw data of a predetermined type; determine the data type of the standard raw data; supplement part of the content in the standard raw data according to the supplementation method that matches the data type to obtain the standard entity.

[0076] According to embodiments of this disclosure, standard raw data is obtained through methods such as web crawling or downloading from a national basic geographic database. Different types of standard raw data are categorized, for example, by province, city, and district. Supplementation is performed on portions of the standard raw data according to a method matching the data type. For example, for standard raw data of geographic administrative regions, such as provinces, autonomous regions (autonomous prefectures, autonomous counties), special administrative regions, municipalities, cities, counties, and districts, supplementation is performed. Specifically, for "province, city, district, county, municipality, special administrative region," the ending can be removed, for example: "Province A" is supplemented with "A," "City B" with "B," "District C" with "C," "County D" with "D," "E" with "E," and "Special Administrative Region F" with "F."

[0077] According to embodiments of this disclosure, standard raw data for organizational data can be categorized into administrative / institutional and commercial types based on their nature. Administrative / institutional data remains unchanged, such as "XX County Transportation Bureau". For commercial data, if the data terminology ends with "Limited Liability Company" or "Joint-Stock Company", the suffix is ​​removed and replaced with "Name 1" instead of "Name 1 Limited Liability Company", and "Name 2 Joint-Stock Company" is replaced with "Name 2". By creating a large database of proper nouns, address names, and organizational data, the accuracy of OCR recognition models in recognizing proper nouns, address names, and organizational names can be improved.

[0078] According to embodiments of this disclosure, the images to be identified are processed according to N different processing methods to obtain N target images to be identified, which may include the following operations:

[0079] For each processing method, the image to be recognized is rotated according to the rotation angle that matches the processing method to obtain the initial target image to be recognized; the initial target image to be recognized is then stretched to obtain the target image to be recognized.

[0080] According to embodiments of this disclosure, the image to be recognized is rotated according to a rotation angle matching the processing method, such as 90°, 180°, or 270°, to obtain an initial target image to be recognized. The initial target image to be recognized is then stretched; specifically, horizontal and vertical stretching can be selected based on the text direction in the seal to obtain the target image to be recognized. This processing of the image to be recognized facilitates the OCR recognition model's recognition of the text.

[0081] Based on the above-described text recognition method, this disclosure also provides a text recognition apparatus. The following will be combined with... Figure 4 The device is described in detail.

[0082] Figure 4A schematic block diagram of a text recognition method apparatus according to an embodiment of the present disclosure is shown.

[0083] like Figure 4 As shown, the text recognition method apparatus 400 of this embodiment includes an image processing module 410, a text recognition module 420, an entity recognition module 430, an entity matching module 440, a result determination module 450, and a target determination module 460.

[0084] The image processing module 410 is used to process the image to be recognized according to N different processing methods to obtain N target images to be recognized, where N is an integer greater than or equal to 2. In one embodiment, the image processing module 410 can be used to perform the operation S210 described above, which will not be repeated here.

[0085] The text recognition module 420 is used to perform text recognition on each target image to obtain N initial text recognition results. In one embodiment, the text recognition module 420 can be used to perform the operation S220 described above, which will not be repeated here.

[0086] The entity recognition module 430 is used to perform entity recognition on each initial text recognition result to obtain M entity recognition result sets, where each entity recognition result set includes N entity recognition results, and M is an integer greater than or equal to 1. In one embodiment, the entity recognition module 430 can be used to perform the operation S230 described above, which will not be repeated here.

[0087] The entity matching module 440 is used to match each entity recognition result in each entity recognition result set with multiple standard entities to obtain a matching result. In one embodiment, the entity matching module 440 can be used to perform the operation S240 described above, which will not be repeated here.

[0088] The result determination module 450 is used to determine the target entity recognition result based on the matching result and the entity recognition result set. In one embodiment, the result determination module 450 can be used to perform the operation S250 described above, which will not be repeated here.

[0089] The target determination module 460 is used to obtain target recognition text based on the recognition results of M target entities. In one embodiment, the target determination module 460 can be used to perform the operation S260 described above, which will not be repeated here.

[0090] According to embodiments of this disclosure, text recognition is performed on target images processed by N processing methods to obtain N initial text recognition results; entity recognition is performed on each initial text recognition result, and the entity recognition result is matched with a standard entity, thereby correcting the recognition results and effectively improving the accuracy of target text recognition.

[0091] According to embodiments of this disclosure, the entity recognition module 430 includes a word segmentation submodule, a part-of-speech recognition submodule, a position determination submodule, and a result determination submodule.

[0092] The word segmentation submodule is used to segment each initial text recognition result into words to obtain the word segmentation result. The word segmentation result includes multiple words and the word segmentation character position of each word in the initial text recognition result.

[0093] The part-of-speech tagging submodule is used to perform noun part-of-speech entity recognition on each initial text recognition result, resulting in a set of M initial entity recognition results.

[0094] The position determination submodule is used to determine the position of the entity character in the initial text recognition result for each initial entity recognition result in each initial entity recognition result set.

[0095] The result determination submodule is used to take the initial entity recognition result as the entity recognition result in the entity recognition result set when the character position spacing between the determined word segmentation character position and the entity character position is less than a predetermined character spacing threshold.

[0096] According to embodiments of this disclosure, the result determination module 450 includes a first result determination submodule, a similarity determination submodule, and a second result determination submodule.

[0097] The first result determination submodule is used to take the entity recognition result as the target entity recognition result when the determination result is used to characterize the entity recognition result set as an entity recognition result that completely matches the standard entity.

[0098] The similarity determination submodule is used to determine the similarity between multiple initial target entity recognition results when the matching result is used to characterize the entity recognition result set, and multiple initial target entity recognition results that match multiple standard entities one by one exist, and obtain the similarity result.

[0099] The second result determination submodule is used to determine the target entity recognition result from multiple initial target entity recognition results based on the similarity result.

[0100] According to embodiments of this disclosure, the target determination module 460 includes a region identification submodule and a result update submodule.

[0101] The region identification submodule is used to identify the region hierarchy relationship of the identification results of M target entities to obtain the identification result.

[0102] The result update submodule is used to update the M target entity recognition results based on standard regional hierarchical relationship information when it is determined that there is an error in the recognition results used to characterize the hierarchical relationship between the M target entity recognition results, so as to obtain the target recognition text.

[0103] According to embodiments of this disclosure, the target determination module 460 further includes a text determination submodule, a difference determination submodule, and a target determination submodule.

[0104] The text determination submodule is used to determine the initial target recognition text based on the recognition results of M initial target entities.

[0105] The difference determination submodule is used to compare the number of characters in the initial target recognition text with the number of characters in the standard text to obtain the difference in the number of characters.

[0106] The target determination submodule is used to identify the initial target text as the target text when the difference in the number of characters is less than or equal to a predetermined threshold.

[0107] According to embodiments of this disclosure, the entity matching module 440 includes a matching submodule and a matching determination submodule.

[0108] The matching submodule is used to perform similarity matching between each entity character in each entity recognition result and the standard entity character in each standard entity to obtain a matching sub-result.

[0109] The matching determination submodule is used to obtain the matching result based on multiple matching sub-results.

[0110] According to embodiments of this disclosure, the text recognition method apparatus 400 further includes a data acquisition module, a type determination module, and a data supplementation module.

[0111] The data acquisition module is used to acquire standard raw data of a predetermined type.

[0112] The type determination module is used to determine the data type of the standard raw data.

[0113] The data supplementation module is used to supplement parts of the standard original data according to the supplementation method that matches the data type, so as to obtain standard entities.

[0114] According to embodiments of this disclosure, the image processing module 410 includes a rotation submodule and a stretching submodule.

[0115] The rotation submodule is used to rotate the image to be recognized according to a rotation angle that matches the processing method for each processing method, so as to obtain the initial target image to be recognized.

[0116] The stretching submodule is used to stretch the initial target image to obtain the target image to be identified.

[0117] According to embodiments of this disclosure, any multiple modules among the image processing module 410, text recognition module 420, entity recognition module 430, entity matching module 440, result determination module 450, and target determination module 460 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the image processing module 410, text recognition module 420, entity recognition module 430, entity matching module 440, result determination module 450, and target determination module 460 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the image processing module 410, text recognition module 420, entity recognition module 430, entity matching module 440, result determination module 450, and target determination module 460 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.

[0118] Figure 5 A block diagram schematically illustrates an electronic device suitable for implementing a text recognition method according to an embodiment of the present disclosure.

[0119] like Figure 5As shown, an electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage portion 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0120] RAM 503 stores various programs and data required for the operation of electronic device 500. Processor 501, ROM 502, and RAM 503 are interconnected via bus 504. Processor 501 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 502 and / or RAM 503. It should be noted that the programs may also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.

[0121] According to embodiments of this disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the input / output (I / O) interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.

[0122] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0123] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 502 and / or RAM 503 and / or one or more memories other than ROM 502 and RAM 503 described above.

[0124] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the item recommendation method provided in the embodiments of this disclosure.

[0125] When the computer program is executed by the processor 501, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0126] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0127] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0128] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0130] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0131] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A text recognition method, comprising: The images to be identified are processed according to N different processing methods to obtain N target images to be identified, where N is an integer greater than or equal to 2; The step of processing the image to be identified according to N different processing methods to obtain N target images to be identified includes: for each processing method, rotating the image to be identified according to a rotation angle that matches the processing method to obtain an initial target image to be identified; and stretching the initial target image to be identified to obtain the target image to be identified. Optical character recognition is performed on each of the target images to be recognized to obtain N initial text recognition results; Each initial text recognition result is segmented into words to obtain a segmentation result, wherein the segmentation result includes multiple words and the segmentation character position of each word in the initial text recognition result; For each of the initial text recognition results, entity recognition of noun parts of speech is performed to obtain M initial entity recognition result sets; for each initial entity recognition result in each initial entity recognition result set, the entity character position of the initial entity recognition result in the initial text recognition result is determined; and if the character position spacing between the segmented character position and the entity character position is determined to be less than a predetermined character spacing threshold, the initial entity recognition result is used as the entity recognition result in the entity recognition result set to obtain M entity recognition result sets, wherein each entity recognition result set includes N entity recognition results, and M is an integer greater than or equal to 1; Each entity recognition result in each entity recognition result set is matched with multiple standard entities to obtain matching results; Based on the matching result, a target entity recognition result matching the standard entity is determined from the entity recognition result set; and The M target entity recognition results are combined according to the order in the initial text recognition results to obtain the target recognition text.

2. The method according to claim 1, wherein, The step of determining the target entity recognition result that matches the standard entity from the entity recognition result set based on the matching result includes: If it is determined that the matching result is used to characterize an entity recognition result in the entity recognition result set that completely matches the standard entity, the entity recognition result shall be used as the target entity recognition result; If the matching result is determined to characterize the existence of multiple initial target entity recognition results in the entity recognition result set that match multiple standard entities one-to-one, then the similarity between the multiple initial target entity recognition results is determined to obtain a similarity result; and Based on the similarity results, the target entity recognition result is determined from the plurality of initial target entity recognition results.

3. The method according to claim 1, wherein, The method further includes: The geographic hierarchy relationship of the M target entity identification results is then analyzed to obtain the identification results; and If it is determined that the recognition result is incorrect in representing the hierarchical relationship between the M target entity recognition results, the M target entity recognition results are updated based on standard regional hierarchical relationship information. The updated M target entity recognition results are then combined in the order of the initial text recognition results to obtain the target recognition text.

4. The method according to claim 1 or 3, wherein, The step of combining the M target entity recognition results according to the order in the initial text recognition results to obtain the target recognition text includes: The M target entity recognition results are combined according to the order in the initial text recognition results to determine the initial target recognition text; and The number of characters in the initial target recognition text is compared with the number of characters in the standard text to obtain the character count difference; and If the difference in the number of characters is less than or equal to a predetermined threshold for the number of characters, the initial target recognition text is used as the target recognition text.

5. The method according to claim 1, wherein, The step of matching each entity recognition result in each entity recognition result set with multiple standard entities to obtain a matching result includes: For each entity character in each entity recognition result, the entity character is matched with the standard entity character in each of the standard entities to obtain a matching sub-result; and The matching result is obtained based on multiple matching sub-results.

6. The method according to claim 1, further comprising: Obtain the standard raw data for the pre-defined type; Determine the data type of the standard raw data; as well as The standard entity is obtained by supplementing a portion of the original standard data according to a supplementation method that matches the data type.

7. A text recognition device, comprising: The image processing module is used to process the image to be recognized according to N different processing methods to obtain N target images to be recognized, where N is an integer greater than or equal to 2; wherein, processing the image to be recognized according to N different processing methods to obtain N target images to be recognized includes: for each processing method, rotating the image to be recognized according to a rotation angle matching the processing method to obtain an initial target image to be recognized; and stretching the initial target image to be recognized to obtain the target image to be recognized. The text recognition module is used to perform optical character recognition on each of the target images to be recognized, and obtain N initial text recognition results; An entity recognition module is configured to perform word segmentation on each initial text recognition result to obtain a word segmentation result, wherein the word segmentation result includes multiple words and the word segmentation character position of each word in the initial text recognition result; perform entity recognition for noun parts of speech on each initial text recognition result to obtain M initial entity recognition result sets; for each initial entity recognition result in each initial entity recognition result set, determine the entity character position of the initial entity recognition result in the initial text recognition result; and if the character position spacing between the word segmentation character position and the entity character position is less than a predetermined character spacing threshold, use the initial entity recognition result as an entity recognition result in the entity recognition result set to obtain M entity recognition result sets, wherein each entity recognition result set includes N entity recognition results, and M is an integer greater than or equal to 1; The entity matching module is used to match each entity recognition result in each entity recognition result set with multiple standard entities to obtain a matching result; The result determination module is used to determine, based on the matching result, the target entity recognition result that matches the standard entity from the entity recognition result set; and The target determination module is used to combine the M target entity recognition results according to the arrangement order in the initial text recognition results to obtain the target recognition text.

8. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 6.