Text information extraction method, electronic equipment and storage medium

By obtaining the text information extraction items and areas of the license photo, and combining the optical character recognition model, two extraction methods are combined, the problem of low accuracy of text information extraction in the license photo is solved, and higher extraction accuracy and reliability are achieved sex.

CN119478962APending Publication Date: 2025-02-18ISOFTSTONE SMART DATA TECH (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411550224.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Due to the differences in the quality and layout of different license photos, the accuracy of text information extraction in license photos is not high, which needs to be solved urgently.

Method used

By obtaining the text information extraction items and corresponding extraction areas of the license photo, combined with the preset optical character recognition model, two text information extraction methods are combined to improve accuracy.

Benefits of technology

It realizes the accurate extraction of text information in license photos, and can effectively identify text information on different types of license photos, improving the accuracy and reliability of extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478962A_ABST
    Figure CN119478962A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a text information extraction method, electronic equipment and a storage medium. Comprising the following steps: for a certificate photo to be subjected to text information extraction, obtaining a text information extraction item of the certificate photo and a text information extraction area corresponding to the text information extraction item in the certificate photo; extracting the text information in the text information extraction area to obtain first text information; based on a preset optical character recognition model and the text information extraction item, extracting the text information in the certificate photo to obtain second text information; and obtaining target text information based on the first text information and the second text information. According to the technical scheme provided by the embodiment of the invention, the text information in the certificate photo can be accurately extracted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of image processing, and in particular to a text information extraction method, an electronic device and a storage medium. Background Art

[0002] Certificate photos contain a variety of important text information, which is an important basis for detecting the quality of certificates. Therefore, it is very important to accurately extract text information from certificate photos.

[0003] However, due to the differences in quality and layout of different ID photos, the accuracy of extracting text information from ID photos is low, which needs to be solved urgently. Summary of the invention

[0004] The embodiments of the present invention provide a text information extraction method, an electronic device and a storage medium to achieve accurate extraction of text information from a certificate photo.

[0005] According to one aspect of the present invention, a text information extraction method is provided, which may include:

[0006] For the certificate photo to be subjected to text information extraction, obtaining a text information extraction item of the certificate photo and a text information extraction area in the certificate photo corresponding to the text information extraction item;

[0007] Extracting text information in the text information extraction area to obtain first text information;

[0008] Extracting text information from the certificate photo based on a preset optical character recognition model and text information extraction project to obtain second text information;

[0009] Based on the first text information and the second text information, target text information is obtained.

[0010] According to another aspect of the present invention, there is provided an electronic device, which may include:

[0011] at least one processor; and

[0012] a memory communicatively connected to at least one processor; wherein,

[0013] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor implements the text information extraction method provided by any embodiment of the present invention when executing the computer program.

[0014] According to another aspect of the present invention, a computer-readable storage medium is provided, on which computer instructions are stored. The computer instructions are used to enable a processor to implement the text information extraction method provided by any embodiment of the present invention when executed.

[0015] The technical solution in the embodiment of the present invention obtains the text information extraction items of the certificate photo and the text information extraction area corresponding to the text information extraction items in the certificate photo for the certificate photo to be subjected to text information extraction, so as to extract the text information later; extracts the text information in the text information extraction area to obtain the first text information, and can accurately extract the text information in the text information extraction area; extracts the text information in the certificate photo based on the preset optical character recognition model and the text information extraction items to obtain the second text information, and can directly extract the text information on different types of certificate photos through optical character recognition without the need to be based on the text information extraction area; obtains the target text information based on the first text information and the second text information, and can synthesize the two text information to obtain more accurate target text information. The above technical solution uses two text information extraction methods to extract text information from the certificate photo respectively, and determines the target text information based on the extracted first text information and the second text information, and can comprehensively consider the two text information to obtain more accurate target text information.

[0016] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 is a flowchart of a text information extraction method provided according to an embodiment of the present invention;

[0019] Figure 2 is a flowchart of another text information extraction method provided according to an embodiment of the present invention;

[0020] Figure 3 is a flowchart of another text information extraction method provided according to an embodiment of the present invention;

[0021] Figure 4is a flowchart of text information extraction according to a specific example of another text information extraction method provided in an embodiment of the present invention;

[0022] Figure 5 is a schematic diagram of a text information extraction area according to a specific example of another text information extraction method provided in an embodiment of the present invention;

[0023] Figure 6 is a structural block diagram of a text information extraction device provided according to an embodiment of the present invention;

[0024] Figure 7 It is a schematic diagram of the structure of an electronic device for implementing the text information extraction method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0026] It should be noted that 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 data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. The situations of "target", "original", etc. are similar and will not be repeated here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] Before introducing the embodiment of the present invention, the relevant contents described in the background technology are first exemplarily described to better understand the text information extraction method described in the embodiment of the present invention.

[0028] Traditional text information extraction methods are mainly divided into two categories. One is the plate area scanning method, which requires manual annotation of the text information extraction area in the certificate photo where text information is to be extracted, and then accurately extracts the text information in the text information extraction area. However, since the text area in the certificate photos produced at different times will change, the area annotation may fail. At the same time, when extracting text information, the text information extraction area may be misplaced, which will cause recognition errors or incomplete recognition of text information.

[0029] Another type of text information extraction method is based on large-model optical character recognition (OCR), which can directly extract text information from certificate photos, but has low accuracy when extracting occluded and similar text information. Therefore, how to accurately extract text information from certificate photos is an urgent problem to be solved.

[0030] Figure 1 is a flow chart of a text information extraction method provided in an embodiment of the present invention. This embodiment can be applied to the case of extracting text information from a certificate photo, and in particular, can be applied to the case of accurately extracting text information from a certificate photo. The method can be executed by a text information extraction device provided in an embodiment of the present invention, and the device can be implemented in software and / or hardware, and the device can be integrated in an electronic device, and the electronic device can be various user terminals or servers.

[0031] See also Figure 1 The method of the embodiment of the present invention specifically includes the following steps:

[0032] S110. For the certificate photo to be subjected to text information extraction, obtain text information extraction items of the certificate photo and text information extraction areas in the certificate photo corresponding to the text information extraction items.

[0033] The certificate photo may be understood as a certificate photo from which text information is to be extracted, such as a business license, a permit, an ID card, etc. Optionally, the certificate photo may be an open fixed-layout document (OFD) file.

[0034] The text information can be understood as the text information filled in the certificate photo, such as the validity date, unit name and issuing authority in the license.

[0035] The text information extraction items can be understood as items corresponding to text information, such as unit name, certificate number, and registered address, etc. The text information to be extracted can be determined through the text information extraction items.

[0036] The text information extraction area can be understood as the area in the certificate photo corresponding to the text information extraction item, where the text information is to be extracted, such as the area behind the unit name in the certificate photo. Optionally, the text information extraction area can be obtained by machine recognition or manual annotation.

[0037] Get the text information extraction project and text information extraction area corresponding to the certificate photo to facilitate the subsequent extraction of text information in the certificate photo.

[0038] S120: Extract text information in the text information extraction area to obtain first text information.

[0039] The first text information can be understood as the text information obtained by extracting text from the certificate photo based on the text information extraction area, and can be directly extracted from the underlying data in the text information extraction area without being affected by text obstructions.

[0040] S130: Extract text information from the certificate photo based on a preset optical character recognition model and text information extraction project to obtain second text information.

[0041] The second text information may be understood as text information extracted from the certificate photo through an optical character recognition model.

[0042] The optical character recognition model can be understood as a model that directly extracts text information from a certificate photo using optical scanning and image processing technology. The second text information corresponding to the text information extraction item can be directly extracted from the certificate photo through the optical character recognition model, but in the case where the text information in the certificate photo is blocked or the characters in the text information are similar, such as seal blockage and indistinguishable from "1" and "i", the second text information cannot be accurately extracted.

[0043] S140: Obtain target text information based on the first text information and the second text information.

[0044] The target text information can be understood as the accurate text information on the certificate photo obtained based on the first text information and the second text information. After obtaining the first text information and the second text information, the advantages of the two text information can be combined. For example, when the first text information of a text information extraction project is inaccurate, the second text information of the text information extraction project is used as the project value of the text information extraction project, so that more accurate target text information can be obtained.

[0045] The technical solution in the embodiment of the present invention obtains the text information extraction items of the certificate photo and the text information extraction area corresponding to the text information extraction items in the certificate photo for the certificate photo to be subjected to text information extraction, so as to extract the text information later; extracts the text information in the text information extraction area to obtain the first text information, and can accurately extract the text information in the text information extraction area; extracts the text information in the certificate photo based on the preset optical character recognition model and the text information extraction items to obtain the second text information, and can directly extract the text information on different types of certificate photos through optical character recognition without the need to be based on the text information extraction area; obtains the target text information based on the first text information and the second text information, and can synthesize the two text information to obtain more accurate target text information. The above technical solution uses two text information extraction methods to extract text information from the certificate photo respectively, and determines the target text information based on the extracted first text information and the second text information, and can comprehensively consider the two text information to obtain more accurate target text information.

[0046] An optional technical solution, in which the certificate photo is an open-format electronic certificate, before obtaining the text information extraction items of the certificate photo and the text information extraction areas in the certificate photo corresponding to the text information extraction items for the certificate photo to be subjected to text information extraction, the solution also includes: downloading at least one initial electronic certificate from an electronic certificate library, and determining at least one open-format electronic certificate whose file format is an open-format document from the at least one initial electronic certificate; and using the open-format electronic certificate that has passed the seal verification among the at least one open-format electronic certificate as the certificate photo.

[0047] Among them, the certificate photo can be an open format document electronic certificate. Before processing the text information of the certificate photo, it is necessary to obtain the certificate photo. At least one initial electronic certificate can be downloaded from the electronic certificate library, and at least one open format document electronic certificate with a file format of an open format document is determined from the at least one initial electronic certificate, and the at least one open format document electronic certificate is verified to ensure the integrity and authenticity of the certificate photo, and the open format document electronic certificate that has passed the verification among the at least one open format document electronic certificate is used as the certificate photo.

[0048] The above technical solution can obtain certificate photos that comply with file format regulations and seal verification regulations from the electronic certificate library.

[0049] Another optional technical solution, after obtaining the target text information, further includes: performing quality inspection on the certificate photo based on the target text information, and saving the obtained quality inspection results.

[0050] Among them, after obtaining the target text information, it is also necessary to use the target text information to conduct quality inspection on the certificate photo, such as whether it is a fake certificate, whether it has expired, and whether the production and operation site has been changed, and the obtained quality inspection results are saved to facilitate subsequent processing.

[0051] Figure 2 It is a flowchart of another text information extraction method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, based on the first text information and the second text information, the target text information is obtained, including: based on the certificate specification corresponding to the certificate photo, the first text information and the second text information, the target text information is obtained; wherein the certificate specification is the specification that the certificate represented by the certificate photo should meet. Among them, the explanation of the terms that are the same or corresponding to the above-mentioned embodiments will not be repeated here.

[0052] See also Figure 2 The method of this embodiment may specifically include the following steps:

[0053] S210: Obtain, for a certificate photo from which text information extraction is to be performed, a text information extraction item of the certificate photo and a text information extraction area in the certificate photo corresponding to the text information extraction item.

[0054] S220: Extract text information in the text information extraction area to obtain first text information.

[0055] S230: Extract text information from the certificate photo based on a preset optical character recognition model and text information extraction project to obtain second text information.

[0056] S240. Obtain target text information based on the certificate specification corresponding to the certificate photo, the first text information, and the second text information; wherein the certificate specification is a specification that the certificate represented by the certificate photo should meet.

[0057] The license specification can be understood as the pre-set specification that the text information in the license photo needs to meet. The license specification can be used to determine whether the text information is valid. For example, the license specification requires that the text information length does not exceed 10 characters, and the date of issue contains numbers and Chinese date values. If it does not meet the license specification, it means that the extracted text information is incorrect.

[0058] Optionally, the first text information and the second text information may be selected based on the certificate specification corresponding to the certificate photo to obtain accurate target text information.

[0059] The technical solution of the embodiment of the present invention can obtain accurate target text information through certificate specifications.

[0060] An optional technical solution obtains target text information based on the certificate specifications, first text information and second text information corresponding to the certificate photo, including: obtaining text information verification rules, wherein the text information verification rules are preset based on the certificate specifications; based on the text information verification rules, verifying the first text information to determine first valid information that meets the certificate specifications and first invalid information that does not meet the certificate specifications in the first text information; based on the text information verification rules, verifying the second text information to determine second valid information that meets the certificate specifications in the second text information; and obtaining the target text information based on at least one of the first valid information, the first invalid information and the second valid information.

[0061] The text information verification rule can be understood as a rule for verifying the first text information and the second text information to determine whether the first text information and the second text information are valid. Optionally, the code can be written in advance using the license specification to obtain the text information verification rule.

[0062] After obtaining the text information verification rule, the first text information can be verified to determine the first valid information that meets the license specification and the first invalid information that does not meet the license specification in the first text information; and the second text information can be verified to determine the second valid information that meets the license specification in the second text information; finally, the target text information is obtained through the first valid information, the first invalid information and the second valid information.

[0063] The above technical solution verifies the first text information and the second text information by using a preset text information verification rule, and can accurately determine the valid information and invalid information in the text information.

[0064] On this basis, optionally, based on at least one of the first valid information, the first invalid information and the second valid information, the target text information is obtained, including: when there is first target valid information corresponding to the text information extraction item in the first valid information, the first target valid information is used as the item value of the text information extraction item; when there is no first target valid information in the first valid information and there is second target valid information corresponding to the text information extraction item in the second valid information, the second target valid information is used as the item value; when there is no first target valid information in the first valid information and there is no second target valid information in the second valid information, the first target invalid information corresponding to the text information extraction item in the first invalid information is used as the item value; based on the obtained item value, the target text information is obtained.

[0065] Among them, for the text information extraction project, first determine whether there is the first target valid information corresponding to the text information extraction project in the first valid information. Since the first text information is more accurate, if it exists, the first target valid information is directly used as the project value of the text information extraction project; if it does not exist, it means that the first text information does not meet the license specifications on the text information extraction project, then determine whether there is the second target valid information corresponding to the text information extraction project in the second valid information. If it exists, it means that the second text information meets the license specifications on the text information extraction project, and the second target valid information is used as the project value; if the first target valid information does not exist in the first valid information and the second target valid information does not exist in the second valid information, it means that both text information do not meet the license specifications on the text information extraction project. At this time, the first target invalid information corresponding to the text information extraction project in the first invalid information that is closer to the accurate value can be used as the project value. In this way, accurate target text information can be obtained based on the obtained project value.

[0066] The above technical solution can obtain more accurate target text information by comprehensively utilizing the first text information and the second text information through the determination rule of the item value.

[0067] On this basis, optionally, the number of text information extraction items is at least one, and based on the obtained item values, the target text information is obtained, including: when the item values ​​corresponding to at least one text information extraction item are obtained, the item values ​​are merged to obtain the target text information.

[0068] The number of the text information extraction item is at least one, and the item values ​​corresponding to the at least one text information extraction item can be merged to obtain the final target text information.

[0069] Figure 3 It is a flowchart of another text information extraction method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, based on the first text information and the second text information, the target text information is obtained, including: obtaining a large language model and a prompt word, wherein the prompt word is preset according to the certificate specification corresponding to the certificate photo, and the certificate specification is the specification that the certificate represented by the certificate photo should meet; the prompt word, the first text information and the second text information are input into the large language model, so that the large language model uses the prompt word to obtain the target text information based on the first text information and the second text information. Among them, the explanation of the terms that are the same or corresponding to the above-mentioned embodiments will not be repeated here.

[0070] See also Figure 3 The method of this embodiment may specifically include the following steps:

[0071] S310: For the certificate photo to be subjected to text information extraction, obtain text information extraction items of the certificate photo and text information extraction areas in the certificate photo corresponding to the text information extraction items.

[0072] S320: Extract text information in the text information extraction area to obtain first text information.

[0073] S330: Extract text information from the certificate photo based on a preset optical character recognition model and text information extraction project to obtain second text information.

[0074] S340, obtaining a large language model and a prompt word, wherein the prompt word is preset according to a certificate specification corresponding to the certificate photo, and the certificate specification is a specification that the certificate represented by the certificate photo should meet.

[0075] S350: Input the prompt word, the first text information, and the second text information into the large language model, so that the large language model obtains the target text information based on the prompt word and the first text information and the second text information.

[0076] Among them, the large language model can be understood as a deep learning model trained with a large amount of text data, which can understand natural language text and perform corresponding operations. The prompt words preset according to the certificate specifications corresponding to the certificate photo can be input into the large language model, so that the large language model directly obtains the target text information from the first text information and the second text information. For example, the prompt word is "Below are the certificate specifications and text information extraction items of the electronic certificate. There are two item values ​​after each text information extraction item. Please help me choose one of them, and the selected value is required to meet the certificate specifications.

[0077] The certificate specifications are as follows: Certificate code: the value is not empty, and takes the value with a longer string length;

[0078] Validity start and validity end: the date format is generally xxxx year xx month xx day;

[0079] When both field values ​​meet the specification, the first value is preferred.

[0080] Text information extraction project list:

[0081] Certificate number: XXX, XXX;

[0082] Unit name: XXX, XXX;

[0083] Valid from: XXX, XXX;

[0084] Valid until: XXX, XXX;

[0085] Be sure to return data in JSON format according to the certificate fields. "

[0086] The technical solution of the embodiment of the present invention can directly obtain the target text information conveniently and quickly by using the large language model by inputting prompt words into the large language model.

[0087] In order to better understand the above-mentioned technical solutions, the following is an exemplary description in conjunction with a specific example. The flowchart of this specific example is as follows: Figure 4 As shown, the specific steps are as follows:

[0088] 1. Read the electronic certificate directory information from the electronic certificate library and download the certificate file (i.e. the initial electronic certificate)

[0089] Read the certificate directory information from the existing electronic certificate library. The directory generally contains basic information such as the name, source, and ID of the certificate, and call the interface to download the certificate file.

[0090] 2. Determine whether it is an OFD file

[0091] Check whether the file format is OFD format, and select the electronic certificate with OFD format to proceed to the next step.

[0092] 3. OFD document stamp verification

[0093] Verify the electronic signature of the electronic certificate in OFD format. If the verification fails, select the electronic certificate in OFD format that has been successfully verified to proceed to the next step.

[0094] 4. Read the electronic certificate recognition configuration information

[0095] The identification configuration information is read from the configuration library, including the text information extraction items of each type of electronic certificate, the attribute area information (ie, the text information extraction area), the attribute verification rules (ie, the certificate specification), and other information.

[0096] 5. Area scanning method to identify the face attributes (i.e. the first text information)

[0097] like Figure 5 As shown, the text information in the area of ​​the OFD file (ie, the certificate photo) can be parsed and scanned according to each attribute area information, and extracted as the first text information.

[0098] 6. Convert OFD files to images

[0099] 7. Large model OCR recognition of face attributes

[0100] Use the preset optical character recognition model to recognize the second text information in the certificate image.

[0101] The prompt words for the large model can be obtained through the text information extraction project. This avoids configuring specific prompt words for different types of certificates and reduces the workload.

[0102] 8. Integrate the attributes of certificates and licenses

[0103] The first text information and the second text information identified by the two methods are fused to obtain the target text information. There are two fusion methods: rule method and large model method.

[0104] (1) Rule Fusion Method

[0105] Reference license specification design integration, such as:

[0106] Non-null values: extract non-null values;

[0107] Valid Value: Extracts valid attribute values ​​that meet format requirements.

[0108] Range: extract the value within the range;

[0109] Length: extract the value of the length in the range content;

[0110] Priority: If all rules are passed or not passed, the result of "Area scanning method to identify face attributes" is used first.

[0111] (2) Large model fusion method

[0112] The first text information and the second text information extracted by the two recognition methods are given to the large model, which automatically determines which value to take based on the input prompt word.

[0113] 9. Quality inspection

[0114] Use traditional data quality detection systems or data middle-end software to detect target text information based on defined quality rules.

[0115] 10. Save quality information

[0116] Save the quality information after quality verification.

[0117] In this specific example, more accurate target text information is obtained by comprehensively considering the two text information obtained by the two text information extraction methods.

[0118] Figure 6 This is a structural block diagram of a text information extraction device provided in an embodiment of the present invention, and the device is used to execute the text information extraction method provided in any of the above embodiments. The device and the text information extraction method of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the text information extraction device, please refer to the embodiments of the above text information extraction method. Figure 6The device may specifically include: a text information extraction area acquisition module 410, a first text information acquisition module 420, a second text information acquisition module 430 and a target text information acquisition module 440.

[0119] The text information extraction area acquisition module 410 is used to acquire, for the certificate photo to be subjected to text information extraction, text information extraction items of the certificate photo and text information extraction areas in the certificate photo corresponding to the text information extraction items.

[0120] The first text information obtaining module 420 is used to extract the text information in the text information extraction area to obtain the first text information.

[0121] The second text information obtaining module 430 is used to extract the text information in the certificate photo based on a preset optical character recognition model and text information extraction project to obtain the second text information.

[0122] The target text information obtaining module 440 is used to obtain the target text information based on the first text information and the second text information.

[0123] Optionally, the target text information obtaining module 440 includes:

[0124] The first target text information obtaining submodule is used to obtain target text information based on the certificate specification corresponding to the certificate photo, the first text information and the second text information; wherein the certificate specification is the specification that the certificate represented by the certificate photo should meet.

[0125] On this basis, optionally, the first target text information obtaining submodule includes:

[0126] A text information verification rule acquisition unit, used to acquire text information verification rules, wherein the text information verification rules are preset based on the license specification;

[0127] A first invalid information determination unit, configured to verify the first text information based on the text information verification rule, and determine first valid information that complies with the license specification and first invalid information that does not comply with the license specification in the first text information;

[0128] A second valid information determination unit, configured to verify the second text information based on the text information verification rule, and determine the second valid information in the second text information that meets the license specification;

[0129] The target text information obtaining unit is used to obtain the target text information based on at least one of the first valid information, the first invalid information and the second valid information.

[0130] On this basis, optionally, the target text information obtains the unit, including:

[0131] A first item value determination subunit is used to use the first target valid information as the item value of the text information extraction item when the first target valid information corresponding to the text information extraction item exists in the first valid information;

[0132] A second item value determination subunit is used to use the second target valid information as the item value when there is no first target valid information in the first valid information and there is second target valid information corresponding to the text information extraction item in the second valid information;

[0133] A third item value determination subunit is used to use the first target invalid information corresponding to the text information extraction item in the first invalid information as the item value when there is no first target valid information in the first valid information and there is no second target valid information in the second valid information;

[0134] The target text information obtaining subunit is used to obtain the target text information based on the obtained item value.

[0135] On this basis, optionally, the number of the text information extraction items is at least one, and the target text information obtains a sub-unit, including:

[0136] The item value merging subunit is used to merge the item values ​​respectively corresponding to at least one text information extraction item to obtain the target text information.

[0137] Alternatively, the target text information obtaining module 440 includes:

[0138] A prompt word acquisition submodule is used to acquire a large language model and prompt words, wherein the prompt words are preset according to the certificate specification corresponding to the certificate photo, and the certificate specification is the specification that the certificate represented by the certificate photo should meet;

[0139] The second target text information obtaining submodule is used to input the prompt word, the first text information and the second text information into the large language model, so that the large language model uses the prompt word to obtain the target text information based on the first text information and the second text information.

[0140] In another alternative, the certificate photo is an open-format electronic certificate. Before obtaining the text information extraction items of the certificate photo and the text information extraction areas corresponding to the text information extraction items in the certificate photo for the certificate photo to be subjected to text information extraction, the text information extraction device further includes:

[0141] An open-format document electronic certificate determination module, used to download at least one initial electronic certificate from an electronic certificate library, and determine at least one open-format document electronic certificate whose file format is an open-format document from the at least one initial electronic certificate;

[0142] The certificate photo determination module is used to use the open format document electronic certificate that has passed the seal verification among at least one open format document electronic certificate as the certificate photo.

[0143] In another alternative, after obtaining the target text information, the text information extraction device further includes:

[0144] The quality inspection result obtaining module is used to perform quality inspection on the certificate photo based on the target text information and save the obtained quality inspection results.

[0145] The text information extraction device in the embodiment of the present invention obtains the text information extraction items of the certificate photo and the text information extraction area corresponding to the text information extraction items in the certificate photo for the certificate photo to be subjected to text information extraction through the text information extraction area acquisition module, so as to be used for extracting text information later; extracts the text information in the text information extraction area through the first text information acquisition module to obtain the first text information, and can accurately extract the text information in the text information extraction area; extracts the text information in the certificate photo based on the preset optical character recognition model and the text information extraction item through the second text information acquisition module to obtain the second text information, and can directly extract text information on different types of certificate photos through optical character recognition without the need to be based on the text information extraction area; obtains the target text information based on the first text information and the second text information through the target text information acquisition module, and can synthesize the two text information to obtain more accurate target text information. The above-mentioned text information extraction device uses two text information extraction methods to extract text information from the certificate photo respectively, and determines the target text information based on the extracted first text information and the second text information, and can comprehensively consider the two text information to obtain more accurate target text information.

[0146] The text information extraction device provided in the embodiment of the present invention can execute the text information extraction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0147] It is worth noting that in the embodiment of the above-mentioned text information extraction device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0148] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0149] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0150] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0151] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a text information extraction method.

[0152] In some embodiments, the text information extraction method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the text information extraction method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the text information extraction method in any other appropriate manner (e.g., by means of firmware).

[0153] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0154] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0155] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0156] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0157] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0158] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0159] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0160] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A text information extraction method, characterized in that: include: For the certificate photo to be subjected to text information extraction, obtaining a text information extraction item of the certificate photo and a text information extraction area in the certificate photo corresponding to the text information extraction item; Extracting text information in the text information extraction area to obtain first text information; Extracting text information from the certificate photo based on a preset optical character recognition model and the text information extraction project to obtain second text information; Target text information is obtained based on the first text information and the second text information.

2. The method according to claim 1, characterized in that The obtaining target text information based on the first text information and the second text information includes: Obtaining target text information based on the certificate specification corresponding to the certificate photo, the first text information, and the second text information; The certificate specifications are specifications that the certificate represented by the certificate photo should meet.

3. The method according to claim 2, characterized in that The obtaining of target text information based on the certificate specification corresponding to the certificate photo, the first text information and the second text information includes: Obtaining text information verification rules, wherein the text information verification rules are preset based on the certificate specification; Based on the text information verification rule, verify the first text information to determine first valid information that meets the license specification and first invalid information that does not meet the license specification in the first text information; Verify the second text information based on the text information verification rule to determine second valid information in the second text information that meets the license specification; Target text information is obtained based on at least one of the first valid information, the first invalid information, and the second valid information.

4. The method according to claim 3, characterized in that The obtaining target text information based on at least one of the first valid information, the first invalid information, and the second valid information includes: When there is first target valid information corresponding to the text information extraction item in the first valid information, using the first target valid information as the item value of the text information extraction item; In a case where the first target valid information does not exist in the first valid information and the second target valid information corresponding to the text information extraction item exists in the second valid information, using the second target valid information as the item value; In the case that the first target valid information does not exist in the first valid information and the second target valid information does not exist in the second valid information, taking the first target invalid information corresponding to the text information extraction item in the first invalid information as the item value; Based on the obtained item value, target text information is obtained.

5. The method according to claim 4, characterized in that The number of the text information extraction items is at least one, and obtaining the target text information based on the obtained item value includes: When the item values ​​corresponding to at least one of the text information extraction items are obtained, the item values ​​are merged to obtain the target text information.

6. The method according to claim 1, characterized in that The obtaining target text information based on the first text information and the second text information includes: Acquire a large language model and a prompt word, wherein the prompt word is preset according to a certificate specification corresponding to the certificate photo, and the certificate specification is a specification that the certificate represented by the certificate photo should meet; The prompt word, the first text information, and the second text information are input into the large language model, so that the large language model obtains target text information based on the prompt word and the first text information and the second text information.

7. The method according to claim 1, characterized in that The certificate photo is an open-format electronic certificate. Before obtaining the text information extraction items of the certificate photo and the text information extraction area corresponding to the text information extraction items in the certificate photo for the certificate photo to be subjected to text information extraction, the method further includes: Downloading at least one initial electronic certificate from an electronic certificate library, and determining at least one open-format document electronic certificate whose file format is an open-format document from the at least one initial electronic certificate; At least one of the open-format document electronic certificates that has passed the seal verification is used as the certificate photo.

8. The method according to claim 1, characterized in that: After obtaining the target text information, the method further includes: Based on the target text information, the quality of the certificate photo is checked, and the obtained quality check result is saved.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor performs the text information extraction method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the text information extraction method as described in any one of claims 1-8 when executed.

Citation Information

Cited By

  • Electronic certificate file detection method

    CN121787395A