Method, device and storage medium for extracting certificate information

By text detection and OCR recognition of the license image, it is converted into feature vectors for classification and merging, and solving the problem of structured accuracy of the license image text, achieving higher accuracy and comprehensive text information extraction.

CN114443834BActive Publication Date: 2024-12-10CHINA TELECOM CLOUD TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111580886.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2024-12-10
Estimated Expiration
2041-12-22

Smart Images

  • Figure CN114443834B_ABST
    Figure CN114443834B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of text structuring, and discloses a method, device and storage medium for extracting certificate information. The method is applied to an intelligent terminal, comprising: performing text detection on an image of a certificate to obtain at least one text box, performing OCR recognition on the text box to obtain at least one text segment, converting each text segment into a feature vector, classifying the feature vector, determining the category label corresponding to the text segment, thereby quantifying the classification of the text segment, and, based on a preset text writing order, merging each text segment belonging to the same category label to obtain category content, so that the category content obtained is more comprehensive, and based on a mapping relationship between a preset category label and the category content, matching each category label with each category content respectively to obtain the category content corresponding to each category label. Through the above classification and content extraction, the accuracy of text information structuring on the certificate image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of text structuring, and provides a method, device and storage medium for extracting certificate information. Background Art

[0002] Text classification refers to classifying a text segment consisting of a limited number of characters into one or more of n categories. Common classification methods include traditional machine learning methods (for example, Bayesian models, support vector machines (SVM), etc.) and deep learning methods (for example, fastText models, TextCNN models, etc.).

[0003] A certificate is a common image that includes a limited number of characters. Certificate information extraction refers to the logical relationship analysis of all text information on the certificate and output in a structure similar to "text meaning-text content".

[0004] The existing structured processing process usually involves inputting a certificate image, obtaining each piece of text information on the image through a text detection algorithm and an optical character recognition (OCR) text recognition algorithm, and then outputting each of the above text segment information in a structured manner. The specific structured processing is usually based on keyword matching or text structuring based on text position information. However, these text structuring methods have the following problems:

[0005] 1. When the input certificate image is affected by factors such as the random shooting angle and the non-uniform format of the certificate itself, the text position on the image is often not fixed. In this case, relying on the text position information for text structuring will greatly reduce the accuracy;

[0006] 2. When the image of the certificate is affected by focus or lighting problems, the text in the image will be blurred. In this case, OCR text recognition will have a certain error rate. If you rely on keyword matching for text structuring, structuring may fail because the keywords cannot be found;

[0007] 3. When some text items in the certificate do not have fixed keywords, if the text is structured by relying on keyword matching, the structuring will also fail because the keywords cannot be found.

[0008] In summary, there is currently no effective solution to ensure the accuracy of the text information structure on the certificate image. Summary of the invention

[0009] The embodiments of the present disclosure provide a method, device and storage medium for extracting certificate information, so as to improve the accuracy of structuring text information on a certificate image.

[0010] The specific technical solutions provided by this disclosure are as follows:

[0011] In a first aspect, an embodiment of the present disclosure provides a method for extracting certificate information, the method being applied to a smart terminal, comprising:

[0012] Performing text detection on the image of the certificate to obtain at least one text box, and performing optical character recognition (OCR) on the text box to obtain at least one text segment;

[0013] For each text segment, convert the text segment into a feature vector, classify the feature vector, and determine the category label corresponding to the text segment;

[0014] Based on the preset text writing order, the text segments belonging to the same category label are merged to obtain the category content;

[0015] Based on the preset mapping relationship between the category label and the category content, each category label is matched with each category content to obtain the category content corresponding to each category label.

[0016] Optionally, the feature vector is classified to determine the category label corresponding to the text segment, including:

[0017] Determine a target feature vector based on the vector length of the feature vector and the input dimension of the classifier;

[0018] Inputting the target feature vector into a classifier to classify the text segment corresponding to the target feature vector, wherein the classification standard of the classifier is preset;

[0019] Based on the classification results, the category label corresponding to the text segment is determined.

[0020] Optionally, the target feature vector is determined by:

[0021] If the vector length is less than the input dimension, zeros are added to the head or tail of the feature vector until the target vector length matches the input dimension, and the feature vector corresponding to the target vector length is used as the target feature vector; or

[0022] If the vector length is greater than the input dimension, the target vector length that is consistent with the input dimension is cut off from the head or tail of the feature vector, and the feature vector corresponding to the target vector length is used as the target feature vector; or

[0023] If the vector length is equal to the input dimension, the feature vector is used as the target feature vector.

[0024] Optionally, based on a preset text writing order, text segments belonging to the same category label are merged to obtain category content, including:

[0025] Based on the preset text writing order, determine the up-down relationship of each text segment belonging to the same category label;

[0026] Each text segment is merged according to the upper and lower line relationships to obtain the category content.

[0027] Optionally, before merging the text segments according to the upstream and downstream relationships, the process further includes:

[0028] Determine whether there is noise text in each text segment;

[0029] If so, the noise text is deleted from each text segment.

[0030] Optionally, if the same category tag includes multiple subcategory tags, based on a preset text writing order, the text segments belonging to the same category tag are merged to obtain category content, including:

[0031] Merge text segments belonging to the same subcategory tag based on a preset text writing order to obtain multiple subcategory contents;

[0032] Based on the association relationship between each subcategory label, each subcategory content belonging to the same category label is merged to obtain the category content.

[0033] Optionally, the mapping relationship between the category label and the category content is preset based on historical certificate information of the same type of certificates.

[0034] In a second aspect, the present disclosure also provides a device for extracting certificate information, including:

[0035] A detection unit, used to perform text detection on the image of the certificate to obtain at least one text box, and perform optical character recognition (OCR) on the text box to obtain at least one text segment;

[0036] A classification unit is used to convert the text segment into a feature vector for each text segment, classify the feature vector, and determine a category label corresponding to the text segment;

[0037] A merging unit, used to merge text segments belonging to the same category label based on a preset text writing order to obtain category content;

[0038] The matching unit is used to match each category label with each category content based on a preset mapping relationship between the category label and the category content, so as to obtain the category content corresponding to each category label.

[0039] Optionally, the feature vector is classified to determine the category label corresponding to the text segment, and the classification unit is used to:

[0040] Determine a target feature vector based on the vector length of the feature vector and the input dimension of the classifier;

[0041] Inputting the target feature vector into a classifier to classify the text segment corresponding to the target feature vector, wherein the classification standard of the classifier is preset;

[0042] Based on the classification results, the category label corresponding to the text segment is determined.

[0043] Optionally, the target feature vector is determined by:

[0044] If the vector length is less than the input dimension, zeros are added to the head or tail of the feature vector until the target vector length matches the input dimension, and the feature vector corresponding to the target vector length is used as the target feature vector; or

[0045] If the vector length is greater than the input dimension, the target vector length that is consistent with the input dimension is cut off from the head or tail of the feature vector, and the feature vector corresponding to the target vector length is used as the target feature vector; or

[0046] If the vector length is equal to the input dimension, the feature vector is used as the target feature vector.

[0047] Optionally, based on a preset text writing order, text segments belonging to the same category tag are merged to obtain category content, and the merging unit is used to:

[0048] Based on the preset text writing order, determine the up-down relationship of each text segment belonging to the same category label;

[0049] Each text segment is merged according to the upper and lower line relationships to obtain the category content.

[0050] Optionally, before merging the text segments according to the upstream and downstream relationships, the process further includes:

[0051] Determine whether there is noise text in each text segment;

[0052] If so, the noise text is deleted from each text segment.

[0053] Optionally, if the same category tag includes multiple subcategory tags, based on a preset text writing order, the text segments belonging to the same category tag are merged to obtain category content, and the merging unit is used to:

[0054] Merge text segments belonging to the same subcategory tag based on a preset text writing order to obtain multiple subcategory contents;

[0055] Based on the association relationship between each subcategory label, each subcategory content belonging to the same category label is merged to obtain the category content.

[0056] Optionally, the mapping relationship between the category label and the category content is preset based on historical certificate information of the same type of certificates.

[0057] In a third aspect, a smart terminal includes:

[0058] A memory for storing executable instructions;

[0059] A processor is used to read and execute executable instructions stored in a memory to implement any method as described in the first aspect.

[0060] In a fourth aspect, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor, the processor is enabled to execute any method described in the first aspect.

[0061] The beneficial effects of the present disclosure are as follows:

[0062] In summary, in the embodiments of the present disclosure, a method, device and storage medium for extracting certificate information are provided, the method comprising: performing text detection on an image of a certificate to obtain at least one text box, and performing OCR recognition on the text box to obtain at least one text segment, on this basis, converting each text segment into a feature vector, classifying the feature vector, determining the category label corresponding to the text segment, thereby making the classification of the text segment more accurate, and, based on a preset text writing order, merging each text segment belonging to the same category label to obtain category content, so that the category content obtained is more comprehensive, based on a mapping relationship between a preset category label and category content, matching each category label with each category content respectively, and obtaining the category content corresponding to each category label, through the above classification and content extraction, eliminating the influence of keywords and the location of text segments on the certificate information, thereby improving the accuracy of the structuring of text information on the certificate image.

[0063] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or be understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:

[0065] Figure 1 A schematic diagram of extracting license information in the prior art;

[0066] Figure 2 A schematic diagram of the process of extracting license information in an embodiment of the present disclosure;

[0067] Figure 3 A schematic diagram of a process for determining a category label corresponding to a text segment in an embodiment of the present disclosure;

[0068] Figure 4 A schematic diagram of a process for determining the category content corresponding to a text segment in an embodiment of the present disclosure;

[0069] Figure 5 A schematic diagram of extracting license information in an embodiment of the present disclosure;

[0070] Figure 6 A schematic diagram of the logical architecture of a device for extracting license information according to an embodiment of the present disclosure;

[0071] Figure 7 Schematic diagram of the physical architecture of the smart terminal in the embodiment of the present disclosure. DETAILED DESCRIPTION

[0072] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the technical solution of the present disclosure, rather than all the embodiments. Based on the embodiments recorded in the present disclosure document, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present disclosure.

[0073] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented using sequences other than those illustrated or described herein.

[0074] The preferred embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0075] See also Figure 1 As shown, in the prior art, the extraction of certificate information is mainly achieved through three steps. The first step is Figure 1 1 in which text detection is performed on the certificate image to obtain multiple text boxes, such as Figure 1 , each text box includes a text box that represents the category and content of structured information. After that, after the second step, that is Figure 1 2, perform OCR recognition on the text box after text detection to obtain the specific content in the text box. Finally, after the third step, Figure 1 3, through keyword matching and location search, etc., the final structured recognition output information is achieved, that is, "Registration number: 000000000000000, Name: XXXXX Company, Type: Limited Liability Company, Address: No. XX, XX District, XX City, Legal Representative: XXX, Registered capital: XXX million yuan, Date of establishment: 0000-00-00".

[0076] In the embodiment of the present disclosure, the system includes at least one smart terminal, that is, the implementation of the method for extracting certificate information in the embodiment of the present disclosure is mainly executed on the smart terminal side, which is described in detail below.

[0077] See also Figure 2 As shown, in the embodiment of the present disclosure, the specific process of extracting certificate information is as follows:

[0078] Step 201: Perform text detection on the image of the certificate to obtain at least one text box, and perform optical character recognition (OCR) on the text box to obtain at least one text segment.

[0079] Typically, different types of certificates (including documents and licenses, etc.) include different numbers of text segments, and considering that the number of text segments screened by text boxes of different sizes will also be different, in an embodiment of the present application, text detection is performed on the image of the certificate to obtain at least one text box. Typically, there are several text boxes, and here, the number and size of the text boxes are not specifically limited.

[0080] On the basis of obtaining at least one text box, the OCR recognition technology is used to recognize the text box to obtain at least one text segment. Usually, the number of text segments is several.

[0081] Step 202: for each text segment, convert the text segment into a feature vector, classify the feature vector, and determine the category label corresponding to the text segment.

[0082] During the implementation, each text segment obtained in step 201 is converted into a feature vector. The process of converting into a feature vector is not repeated here. On this basis, the feature vector is classified to determine the category label corresponding to the text segment.

[0083] Specifically, classify the feature vectors and determine the category labels corresponding to the text segments. Figure 3 As shown, including:

[0084] Step 2021: Determine the target feature vector based on the vector length of the feature vector and the input dimension of the classifier.

[0085] Different from the prior art, in the embodiment of the present application, a classifier is introduced to classify the feature vector. Taking into account that the input dimensions of the classifiers are different, in order to obtain more accurate classification results, after selecting the classifier, the target feature vector must be determined based on the vector length of the feature vector and the input dimension of the classifier.

[0086] In the embodiment of the present application, the target feature vector is determined by the following method:

[0087] The first case: If the vector length is less than the input dimension, zeros are added to the head or tail of the feature vector until the target vector length is consistent with the input dimension, and the feature vector corresponding to the target vector length is used as the target feature vector. Or

[0088] When the input dimension of the classifier is smaller than the vector length of the feature vector, the feature vector is padded to a feature vector with the same length as the input dimension. The specific padding method can be set according to the actual situation. For example, zeros can be padded at the head or tail of the feature vector, so that the feature vector corresponding to the target vector length is used as the target feature vector.

[0089] The second case: If the vector length is greater than the input dimension, take the head or tail of the feature vector as the starting point, cut out the target vector length that is consistent with the input dimension, and use the feature vector corresponding to the target vector length as the target feature vector. Or

[0090] When the input dimension of the classifier is larger than the vector length of the feature vector, the feature vector is truncated into a feature vector with the same length as the input dimension. The specific truncation method can be set according to the actual situation. For example, the head or tail of the feature vector is used as the starting point, and the target vector length with the same length as the input dimension is used for truncation. In this way, the feature vector corresponding to the target vector length is used as the target feature vector.

[0091] The third case: If the vector length is equal to the input dimension, the feature vector is used as the target feature vector.

[0092] When the input dimension of the classifier is longer than the vector length of the feature vector, the feature vector is directly used as the target feature vector.

[0093] Step 2022: Input the target feature vector into a classifier to classify the text segment corresponding to the target feature vector, wherein the classification standard of the classifier is preset.

[0094] During the implementation, after the target feature vector is obtained, the target feature vector can be input into the classifier for classification. It should be noted that the classification standard of the above classifier is pre-set, for example, the above classification standard can be customized according to actual needs. The specific process of using the classifier to classify the text segment corresponding to the target feature vector is not repeated here.

[0095] Step 2023: Based on the classification result, determine the category label corresponding to the text segment.

[0096] After using the classifier to classify the text segment corresponding to the target feature vector, the classification result is obtained. The specific number of results here corresponds one-to-one to the above classification standard. In the implementation process, the category label corresponding to each text segment is determined separately according to the classification result.

[0097] In order to ensure the integrity of information structuring, after determining the category label corresponding to the text segment, it is necessary to further determine the category content corresponding to each category label.

[0098] Step 203: Based on a preset text writing order, the text segments belonging to the same category tag are merged to obtain category content.

[0099] See also Figure 4 As shown, the steps for obtaining category content mainly include:

[0100] Step 2031: Based on a preset text writing order, determine the up-and-down relationship of each text segment belonging to the same category label.

[0101] Taking into account that the text segments on some certificates are relatively long, a line of text often cannot fully express the content of the text segment. In addition, given the limited length of the certificates, the content of the text segment is often processed in lines. In summary, in the implementation process, the up-and-down relationship of each text segment belonging to the same category label is determined based on the preset text writing order, including the text writing order from left to right and the text writing order from top to bottom.

[0102] Step 2032: Merge each text segment according to the upper and lower line relationships to obtain category content.

[0103] It should be noted here that, since the license information includes other contents besides text segments, such as some strings that can be ignored when the text is structured (for example, explanatory text), before merging the text segments according to the upstream and downstream relationships, it also includes:

[0104] (1) Determine whether there is noise text in each text segment.

[0105] During the implementation, after obtaining multiple text segments, it is necessary to determine whether there is a noise character in each of the above text segments. Specifically, the noise character can be used as an object to traverse multiple text segments to determine whether the noise character exists.

[0106] (2) If yes, delete the noise text from each text segment.

[0107] That is, after the noise characters are screened out in each text segment, the screened noise characters are deleted from each text segment, so that each text segment after the deletion operation is a valid text segment that needs to be merged.

[0108] In some embodiments, if the same category tag includes multiple subcategory tags, based on a preset text writing order, the text segments belonging to the same category tag are merged to obtain category content, including:

[0109] For example, the Personal Information category tag in the license includes multiple sub-category tags, such as name, gender, registered residence, ID number, etc. In order to make the content of the Personal Information category tag complete, the following steps should be performed:

[0110] 1) The text segments belonging to the same subcategory tag are merged based on a preset text writing order to obtain multiple subcategory contents.

[0111] During the implementation process, each subcategory label is first executed, and each text segment belonging to the same subcategory label is merged based on the preset text writing order. The specific merging method is the same as the acquisition of the above-mentioned category content, including determining the upper and lower line relationships, deleting noise text, etc., which will not be repeated here one by one, so as to obtain the subcategory content corresponding to each subcategory label.

[0112] 2) Based on the association relationship between each sub-category label, each sub-category content belonging to the same category label is merged to obtain the category content.

[0113] During the implementation process, after obtaining multiple subcategory contents, in order to integrate each subcategory content into the same category label, it is necessary to determine the association relationship between the above-mentioned subcategory labels. The association relationship here can be understood as the relationship between the display order, display position, etc. of each subcategory label in the same category label.

[0114] According to the above-mentioned association relationship, the sub-category contents of the same category label will be merged, that is, according to relationships such as display order and display position, the sub-category contents that have been merged according to the preset text writing order will be integrated under the same category label to obtain the category content.

[0115] Step 204: Based on the preset mapping relationship between the category label and the category content, each category label is matched with each category content to obtain the category content corresponding to each category label.

[0116] During the implementation process, after obtaining multiple category tags through step 202 and multiple category contents through step 203, it is necessary to match the category tags and category contents one by one to obtain structured certificate information.

[0117] The specific matching principle is the mapping relationship between the preset category labels and category contents. For example, category label 1 matches category content 1, category label 2 matches category content 2, and so on. By matching each category label with each category content, the category content corresponding to each category label is obtained, that is, structured information with the theme of "category label: category content" is obtained.

[0118] It should be noted that, since there are many types of certificates and licenses, the corresponding relationship between category labels and category contents is different in different certificates and licenses. In the embodiment of the present application, the mapping relationship between category labels and category contents is preset based on the historical certificate information of the same type of certificates and licenses. For example, the mapping relationship between category labels and category contents in a business license is preset based on the historical certificate information of the same type of business licenses. Such a setting can ensure the accuracy and standardization of the acquisition of certificate information.

[0119] Application Scenario

[0120] See also Figure 5 As shown, the intelligent terminal performs text detection on the image of the business license shown in the figure, and obtains multiple text boxes as shown in the figure, and performs OCR recognition on the above multiple text boxes respectively to obtain multiple text segments as shown in the figure, for example, "Business License", "Registration Number", "000000000000000000", etc.

[0121] For each text segment, in the process of converting the text segment into a feature vector: in order to enable each of the above text segments to be converted into a target feature vector of the same length, a classifier with an input dimension of 20 is selected to classify the above text segments. However, since the vector length of "business license", "registration number", etc. is less than 20, during the implementation process, the tail of the feature vector with a vector length of less than 20 is padded with zeros until the vector length reaches 20, and the feature vector with a vector length of 20 is determined as the target feature vector.

[0122] The above target feature vector is input into the classifier to classify the text segment corresponding to the target feature vector. Here, the classification standard of the classifier can be set in advance according to the number of category labels of the same type of business license, and further determined according to the classification result, the category label corresponding to the text segment is determined, for example, Title, Title1, Title2, Title3, Title4, Title5, Title6, Title7, Title8, Title9 as shown in the figure.

[0123] After obtaining the above-mentioned category labels, the category contents are obtained based on the preset text writing order, such as Content1, Content2, Content3, Content4, Content5, Content6, Content7, Content8, and Content9 as shown in the figure. Specifically, taking Content9 as an example, based on the preset text writing order, i.e., the order from top to bottom, the up-down relationship of each text segment in Content9 belonging to the same category label, i.e., Title9, is determined, and each text segment is merged according to the up-down relationship to obtain the category contents.

[0124] Here, it is assumed that the mapping relationship between the preset category labels and category contents is consistent with the serial number. Then, each category label (for example, Title, Title1, Title2, Title3, Title4, Title5, Title6, Title7, Title8, Title9) and each category content (for example, Content1, Content2, Content3, Content4, Content5, Content6, Content7, Content8, Content9) are matched to obtain the category content corresponding to each category label, that is, the structured certificate information is Title1:Con tent1, Title2: Content2, Title3: Content3, Title4: Content4, Title5: Content5, Title6: Content6, Title7: Content7, Title8: Content8, Title9: Content9, that is, "Registration Number: 000000000000000000", "Name: XXXXXX Company", "Type: Limited Liability Company", "Address: No. XX, XX District, XX City", "Legal representative: XXX", "Registered capital: XXX million yuan", and "Date of establishment: 00 / 00 / 0000".

[0125] Based on the same inventive concept, refer to Figure 6As shown, in an embodiment of the present disclosure, a device for extracting certificate information is provided, comprising:

[0126] The detection unit 601 is used to perform text detection on the image of the certificate to obtain at least one text box, and perform optical character recognition (OCR) on the text box to obtain at least one text segment;

[0127] The classification unit 602 is used to convert the text segment into a feature vector for each text segment, classify the feature vector, and determine a category label corresponding to the text segment;

[0128] A merging unit 603 is used to merge text segments belonging to the same category tag based on a preset text writing order to obtain category content;

[0129] The matching unit 604 is used to match each category label with each category content based on the preset mapping relationship between the category label and the category content, so as to obtain the category content corresponding to each category label.

[0130] Optionally, the feature vector is classified to determine the category label corresponding to the text segment, and the classification unit 602 is used to:

[0131] Determine a target feature vector based on the vector length of the feature vector and the input dimension of the classifier;

[0132] Inputting the target feature vector into a classifier to classify the text segment corresponding to the target feature vector, wherein the classification standard of the classifier is preset;

[0133] Based on the classification results, the category label corresponding to the text segment is determined.

[0134] Optionally, the target feature vector is determined by:

[0135] If the vector length is less than the input dimension, zeros are added to the head or tail of the feature vector until the target vector length matches the input dimension, and the feature vector corresponding to the target vector length is used as the target feature vector; or

[0136] If the vector length is greater than the input dimension, the target vector length that is consistent with the input dimension is cut off from the head or tail of the feature vector, and the feature vector corresponding to the target vector length is used as the target feature vector; or

[0137] If the vector length is equal to the input dimension, the feature vector is used as the target feature vector.

[0138] Optionally, based on a preset text writing order, text segments belonging to the same category tag are merged to obtain category content, and the merging unit 603 is used to:

[0139] Based on the preset text writing order, determine the up-down relationship of each text segment belonging to the same category label;

[0140] Each text segment is merged according to the upper and lower line relationships to obtain the category content.

[0141] Optionally, before merging the text segments according to the upstream and downstream relationships, the process further includes:

[0142] Determine whether there is noise text in each text segment;

[0143] If so, the noise text is deleted from each text segment.

[0144] Optionally, if the same category tag includes multiple subcategory tags, based on a preset text writing order, the text segments belonging to the same category tag are merged to obtain category content, and the merging unit 603 is used to:

[0145] Merge text segments belonging to the same subcategory tag based on a preset text writing order to obtain multiple subcategory contents;

[0146] Based on the association relationship between each subcategory label, each subcategory content belonging to the same category label is merged to obtain the category content.

[0147] Optionally, the mapping relationship between the category label and the category content is preset based on historical certificate information of the same type of certificates.

[0148] Based on the same inventive concept, refer to Figure 7 As shown, an embodiment of the present disclosure provides a server, including: a memory 701, used to store executable instructions; a processor 702, used to read and execute the executable instructions stored in the memory, and execute any one of the methods of the first aspect above.

[0149] Based on the same inventive concept, an embodiment of the present disclosure provides a computer-readable storage medium. When instructions in the storage medium are executed by a processor, the processor is enabled to execute any method described in the first aspect above.

[0150] In summary, in the embodiments of the present disclosure, a method, device and storage medium for extracting certificate information are provided, the method comprising: performing text detection on an image of a certificate to obtain at least one text box, and performing OCR recognition on the text box to obtain at least one text segment, on this basis, converting each text segment into a feature vector, classifying the feature vector, determining the category label corresponding to the text segment, thereby making the classification of the text segment more accurate, and, based on a preset text writing order, merging each text segment belonging to the same category label to obtain category content, so that the category content obtained is more comprehensive, based on a mapping relationship between a preset category label and category content, matching each category label with each category content respectively, and obtaining the category content corresponding to each category label, through the above classification and content extraction, eliminating the influence of keywords and the location of text segments on the certificate information, thereby improving the accuracy of the structuring of text information on the certificate image.

[0151] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program product systems. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product system implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0152] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program product systems according to the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0153] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0155] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.

Claims

1. A method for extracting certificate information, characterized in that: The method is applied to a smart terminal, comprising: Performing text detection on the image of the certificate to obtain at least one text box, and performing optical character recognition (OCR) on the text box to obtain at least one text segment; For each of the text segments, convert the text segment into a feature vector, classify the feature vector, and determine a category label corresponding to the text segment; If the same category tag includes multiple subcategory tags, the text segments belonging to the same subcategory tag are merged based on a preset text writing order to obtain multiple subcategory contents, and based on the association relationship between the subcategory tags, the subcategory contents belonging to the same category tag are merged to obtain category content; Based on the preset mapping relationship between the category label and the category content, each category label is matched with each category content to obtain the category content corresponding to each category label.

2. The method according to claim 1, characterized in that The classifying the feature vector to determine the category label corresponding to the text segment includes: Determining a target feature vector based on the vector length of the feature vector and the input dimension of the classifier; Inputting the target feature vector into a classifier to classify the text segment corresponding to the target feature vector, wherein the classification standard of the classifier is preset; Based on the classification result, a category label corresponding to the text segment is determined.

3. The method according to claim 2, characterized in that The target feature vector is determined by: If the vector length is smaller than the input dimension, zeros are added to the head or tail of the feature vector until the target vector length is consistent with the input dimension, and the feature vector corresponding to the target vector length is used as the target feature vector; or If the vector length is greater than the input dimension, taking the head or tail of the feature vector as the starting point, cutting out the target vector length consistent with the input dimension, and taking the feature vector corresponding to the target vector length as the target feature vector; or If the length of the vector is equal to the input dimension, the feature vector is used as the target feature vector.

4. The method according to claim 1, characterized in that Based on the preset text writing order, the text segments belonging to the same category tag are merged to obtain category content, including: Based on a preset text writing order, determining the up-down and down-down relationship of each of the text segments belonging to the same category label; Each of the text segments is merged according to the up-down and down-down relationships to obtain category content.

5. The method according to claim 4, characterized in that Before merging the text segments according to the uplink and downlink relationships, the method further includes: Determine whether there is noise text in each of the text segments; If so, the noise text is deleted from each of the text segments.

6. The method according to claim 1, characterized in that The mapping relationship between the category label and the category content is preset based on the historical certificate information of the same type of certificates.

7. A device for extracting certificate information, characterized in that: include: A detection unit, configured to perform text detection on the image of the certificate to obtain at least one text box, and perform optical character recognition (OCR) on the text box to obtain at least one text segment; A classification unit, for each of the text segments, converting the text segment into a feature vector, classifying the feature vector, and determining a category label corresponding to the text segment; a merging unit, configured to merge the text segments belonging to the same subcategory tag based on a preset text writing order to obtain multiple subcategory contents if the same category tag includes multiple subcategory tags, and to merge the subcategory contents belonging to the same category tag based on the association relationship between the subcategory tags to obtain category contents; The matching unit is used to match each category label with each category content based on a preset mapping relationship between the category label and the category content, so as to obtain the category content corresponding to each category label.

8. An intelligent terminal, characterized in that: include: A memory for storing executable instructions; A processor, configured to read and execute the executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor, the processor is enabled to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device controlling electronic equipment

    CN105528078A

  • Mixed-pasting bill image processing method, device, computer equipment and storage medium

    CN111931664A

  • Character recognition method and device, electronic equipment and storage medium

    CN113780098A