Method, device and equipment for processing certification documents
By extracting the features in the proof file from the perspective of text features and using machine learning algorithms, the problem of low file name extraction efficiency and accuracy in the existing technology is solved, automatic file name extraction and multilingual support are realized, and new file type is adapted to need.
Patent Information
- Application Number
- CN202011126293.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-20
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2040-10-20
AI Technical Summary
The prior art is difficult to quickly and accurately extract file names in proof file processing, especially emerging file types that require retraining the model, resulting in low extraction efficiency and accuracy.
By extracting text features in proof files from the perspective of text features and using machine learning algorithms for model training, file names are automatically extracted to improve file name extraction speed and accuracy.
Automatic file name extraction of proof files is realized, the speed and accuracy of file name extraction is improved, the need for model retraining is avoided, and it is adapted to multiple languages and file types.
Smart Images

Figure CN112199337B_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of computer technology, and in particular to a method, device and equipment for processing certification documents. Background Art
[0002] Qualification verification refers to the work of verifying the conditions, qualifications, and abilities that an applicant has to engage in a certain job or activity. For example, in scenarios where merchants apply for mini-programs or merchants enter retail platforms, the platform will generally require merchants to provide qualification certificates, and the merchants will upload documents related to the qualification certificates in the system. Usually, merchants will scan the documents into pictures and upload them. In order to verify the correctness of the certificates uploaded by merchants and prevent merchants from uploading the wrong certificates, such as uploading an ID card where a business license is uploaded, it is necessary to extract the name of the uploaded certificate for inspection. In another scenario, in order to verify the validity of the qualification certificate, such as whether the qualification certificate is within the validity period, it is necessary to extract the information in the qualification certificate. In structured extraction of information, it is also necessary to first know what the certificate is, and then call the corresponding parsing structured algorithm program.
[0003] Therefore, a reliable certification document processing solution needs to be provided. Summary of the invention
[0004] The embodiment of the present specification provides a certification document processing method for improving the extraction speed and accuracy of the file name of the certification document.
[0005] The embodiment of this specification also provides a method for processing a certification document, including:
[0006] Performing coordinate analysis on the certification document after the characters and character coordinates are identified to obtain a set of characters belonging to the same line in the certification document;
[0007] Perform key character annotation and character type annotation on each line of character set to obtain character samples corresponding to each line of character set, wherein the key character annotation is used to indicate whether the character set contains a specified key character, and the character type annotation is used to indicate whether the characters in the character set are of the same type;
[0008] Inputting the text samples corresponding to each line of text set into the machine learning model respectively to obtain the file name labels corresponding to each line of text set, the machine learning model is trained based on the training text samples corresponding to the batch of certification documents and the file name labels corresponding to the training text samples, and the training text samples have the same dimensional features as the text samples;
[0009] Based on the text lines and the corresponding file name tags, the file name of the certification document is determined.
[0010] The embodiment of the present specification also provides a certification document processing device, including:
[0011] An analysis module performs coordinate analysis on the text and the document after the text coordinates are identified to obtain a set of texts belonging to the same line in the document;
[0012] A marking module is used to mark key words and text types for each line of text sets to obtain text samples corresponding to each line of text sets, wherein the key word marking is used to indicate whether the text set contains a specified key word, and the text type marking is used to indicate whether the types of the texts in the text set are the same;
[0013] A processing module, inputting the text samples corresponding to each line of text set into a machine learning model to obtain the file name labels corresponding to each line of text set, wherein the machine learning model is trained based on training text samples corresponding to a batch of certification documents and the file name labels corresponding to the training text samples, and the training text samples have features of the same dimension as the text samples;
[0014] A determination module determines the file name of the certification document based on the text sets and corresponding file name tags.
[0015] The embodiment of the present specification also provides an electronic device, including:
[0016] Processor; and
[0017] a memory arranged to store computer executable instructions which, when executed, cause the processor to:
[0018] Performing coordinate analysis on the certification document after the characters and character coordinates are identified to obtain a set of characters belonging to the same line in the certification document;
[0019] Perform key character annotation and character type annotation on each line of character set to obtain character samples corresponding to each line of character set, wherein the key character annotation is used to indicate whether the character set contains a specified key character, and the character type annotation is used to indicate whether the characters in the character set are of the same type;
[0020] Inputting the text samples corresponding to each line of text set into the machine learning model respectively to obtain the file name labels corresponding to each line of text set, the machine learning model is trained based on the training text samples corresponding to the batch of certification documents and the file name labels corresponding to the training text samples, and the training text samples have the same dimensional features as the text samples;
[0021] Based on the text lines and the corresponding file name tags, the file name of the certification document is determined.
[0022] The embodiment of the present specification also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following operations are implemented:
[0023] Performing coordinate analysis on the certification document after the characters and character coordinates are identified to obtain a set of characters belonging to the same line in the certification document;
[0024] Perform key character annotation and character type annotation on each line of character set to obtain character samples corresponding to each line of character set, wherein the key character annotation is used to indicate whether the character set contains a specified key character, and the character type annotation is used to indicate whether the characters in the character set are of the same type;
[0025] Inputting the text samples corresponding to each line of text set into the machine learning model respectively to obtain the file name labels corresponding to each line of text set, the machine learning model is trained based on the training text samples corresponding to the batch of certification documents and the file name labels corresponding to the training text samples, and the training text samples have the same dimensional features as the text samples;
[0026] Based on the text lines and the corresponding file name tags, the file name of the certification document is determined.
[0027] One embodiment of the present specification starts from the perspective of text features. By extracting the features of each line of text in the certificate text and using a machine learning algorithm to train a model, the machine learning model can automatically extract the file name from the certificate document, thereby achieving the purpose of improving the speed and accuracy of file name extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0029] Figure 1 A schematic diagram of an application scenario provided in this manual;
[0030] Figure 2 A flowchart of a method for processing a certification document provided in one embodiment of this specification;
[0031] Figure 3 A schematic diagram of an environmental management system certification certificate provided for an embodiment of this specification;
[0032] Figure 4 A schematic diagram of the structure of a certification document processing device provided in one embodiment of this specification;
[0033] Figure 5A schematic diagram of the structure of an electronic device provided in one embodiment of this specification. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this document.
[0035] As stated in the background technology section, the current solution for document processing is generally to train an image classification model, use the name of the document as the category label, and directly classify the image of the document to obtain the name of the document. However, for newly emerging documents, the model needs to be retrained. For example, when the model is trained, there is no "Environmental Management System Certification Certificate", see Figure 3 , when the certificate appears, the image classification model cannot correctly extract the name of the certificate, and the model needs to be retrained again.
[0036] Based on this, this specification provides a method for processing certification documents. From the perspective of text features, by extracting the features of each line of text in the certification text and using a machine learning algorithm to train a model, the machine learning model can automatically extract the file name from the certification document, thereby achieving the purpose of improving the speed and accuracy of file name extraction.
[0037] See below Figure 1 The application scenarios of this specification are exemplified.
[0038] The first application scenario includes: a client and a qualification verification server, where:
[0039] The qualification verification server may refer to a server of an authoritative qualification verification party, such as an official appraisal agency, an official certification agency, etc. After the qualification verification server receives the certification document uploaded by the user through the client, it can automatically identify the file name of the certification document and the validity of the certification document, thereby determining whether the user has the relevant qualifications.
[0040] The second application scenario includes: client and platform, the platform includes business server and qualification verification server, among which:
[0041] The business server can be a server that provides business processing services of the service provider, such as a server used by the retail platform to verify the qualifications of merchants to open mini-program services or enter platform services. In the process of users handling business, they may need to provide relevant certification documents. After the business server receives the certification documents uploaded by the user through the client, it sends the certification documents to the qualification verification server, which automatically identifies the file name and validity of the certification documents, thereby determining whether the user has the relevant qualifications and providing them to the business server, which responds accordingly.
[0042] Among them, the client refers to the program corresponding to the server, which provides local services to customers and is generally installed on ordinary PCs, mobile terminals and other clients; the qualification verification server and business server can be integrated into the same server.
[0043] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0044] Figure 2 A flowchart of a method for processing a certification document provided in an embodiment of this specification, the method can be Figure 1 Authentication server implementation in , see Figure 2 , the method may specifically include the following steps:
[0045] Step 202, coordinate analysis is performed on the certification document after the characters and character coordinates are identified, to obtain a set of characters belonging to the same line in the certification document;
[0046] The text and text coordinate recognition is used to recognize the text in the certification document and the coordinates of the text in the certification document, which can be specifically implemented by using optical character recognition (OCR) technology.
[0047] The following is an explanation using the 'Environmental Management System Certification' as an example:
[0048] First, obtain the image of the 'Environmental Management System Certification Certificate' provided by the client, and pass the image of the 'Environmental Management System Certification Certificate' to the OCR service. The OCR service performs text recognition, text extraction, text coordinate recognition and other processing to obtain the text and text coordinate results recognized by OCR.
[0049] Among them, the text coordinate recognition can identify the coordinates of the four corner points of the text border corresponding to a single text, and can also identify the coordinates of the four corner points of the text border corresponding to multiple adjacent texts. Since the text features are extracted from the row dimension, in order to improve the efficiency of feature extraction, the text coordinates here identify the coordinates of the four corner points of the text border corresponding to an adjacent row of text, and the text coordinate results include:
[0050]
[0051] Among them, {'x':241,'y':118},{'x':293,'y':120},{'x':292,'y':133},{'x':240,'y':131} refer to the coordinates of the four corner points of the text border corresponding to 'CCCI', {'x':88,'y':146},{'x':430,'y':145},{'x':430,'y':164},{'x':88,'y':165} refer to the coordinates of the four corner points of the text border corresponding to 'Environmental Management System Certification Certificate', and {'x':88,'y':146},{'x':430,'y':145},{'x':430,'y':164},{'x':88,'y':165} refer to the coordinates of the four corner points of the text border corresponding to 'Environmental Management System Certification Certificate'. ':327,'y':177},{'x':440,'y':177},{'x':440,'y':189},{'x':327,'y':189} refer to the coordinates of the four corner points of the text border corresponding to 'Registration No.: 02109E10521R3L', and {'x':241,'y':201},{'x':280,'y':201},{'x':280,'y':213},{'x':241,'y':213} refer to the coordinates of the four corner points of the text border corresponding to 'This is to certify'.
[0052] Then, merge the coordinates and text belonging to the same line of text, the result is as follows:
[0053]
[0054] That is, 'CCCI' is a text set in one line, 'Environmental Management System Certification Certificate' is a text set in another line, 'Registration Number: 02109E10521R3L' is a text set in another line, and 'This is to certify' is a text set in another line. See Table 1 below:
[0055]
[0056]
[0057] Table 1
[0058] Step 204: perform key text annotation and text type annotation on each line of text set to obtain text samples corresponding to each line of text set, wherein the key text annotation is used to indicate whether the text set contains a specified key text, and the text type annotation is used to indicate whether the types of the texts in the text set are the same; specifically:
[0059] Steps for key text annotation:
[0060] A text search is performed on the text sets corresponding to each line identified in step 202 to determine whether the specified key text is included therein, and a first text set containing the specified key text is marked with 1, and a second text set containing no specified key text is marked with 2. The specified key text refers to the file type of the certification document, such as a certificate, proof, etc.
[0061] Furthermore, considering that there are multiple aliases for key words, such as the aliases of certificates and proofs include certificates of qualification, permits, registration certificates, grade certificates, licenses, etc., therefore, in order to improve the capabilities of the machine learning model and avoid missing legitimate certification documents, the key word annotation in this embodiment is also used to characterize whether the text set contains the alias of the specified key words to cover the range of certificate aliases.
[0062] Steps for text type annotation:
[0063] The character types of the characters in the character sets corresponding to the rows identified in step 202 are identified and compared to determine whether the character types of the characters in the character sets are all the same, and the character sets with the same character types are marked with 1, and the character sets with different character types are marked with 0. For example, if the characters in the third character set are all Chinese or none of them are Chinese, the third character set is marked with 1, and if the characters in the fourth character set are both Chinese and English, the fourth character set is marked with 0.
[0064] Furthermore, considering the impact of globalization trends, qualification verification may recognize not only national languages but also foreign languages, such as the Chinese version and the English version of the same certificate. Therefore, the text type annotation in this embodiment is also used to characterize the text type when the text type in the text set is the same. Thus, the characteristics of the text type can be introduced into the text sample, thereby covering certification documents in multiple language formats.
[0065] Taking 'Environmental Management System Certification Certificate' as an example, after the marking in step 204, the text samples corresponding to each row shown in Table 2 below can be obtained:
[0066] text collection Does it contain key words? Are the text types the same? CCCI 0 1 Environmental Management System Certification 1 1 Registration number: 02109E10521R3L 0 0 This is to certify 0 1
[0067] Table 2
[0068] In addition, this embodiment takes into account that many types of features are introduced. In order to ensure the model effect, a huge number of training text samples may be required during the model training process. Therefore, in order to reduce the difficulty of model training, this embodiment proposes a one-sample-multiple-use solution, specifically:
[0069] The recognized text is translated to obtain at least one translation, that is, the recognized text in the current language format is translated into text in multiple language formats, thereby obtaining text with the same meaning in multiple language formats, and further obtaining multiple training text samples.
[0070] For example, during the training process, the "Environmental Management System Certification Certificate" extracted from the certification document can be translated into the English format of Environmental Management System, as well as text in other language formats. Therefore, the training text samples include not only the text set in the source language format, but also at least one translation of the text in the text set.
[0071] Step 206: Input the text samples corresponding to each line of text sets into the machine learning model respectively to obtain the file name labels corresponding to each line of text sets. The machine learning model is trained based on training text samples corresponding to a batch of certification documents and the file name labels corresponding to the training text samples. The training text samples have features of the same dimension as the text samples.
[0072] The machine learning model is obtained by training based on any one of decision tree, random forest and support vector machine.
[0073] Taking 'Environmental Management System Certification Certificate' as an example, the text sets and annotations corresponding to each row shown in Table 2 can be input into the machine learning model as text samples.
[0074] Step 208: Determine the file name of the certification file based on the text set and the corresponding file name tag. One implementation method may be:
[0075] The file name label includes a name label and a non-name label. During the model training process, the name label corresponding to the training text sample can be recorded as 1, and the non-name label corresponding to the training text sample can be recorded as 0.
[0076] First, determine the target text set corresponding to the name tag; then determine the file name of the certification document based on the target text set. Take "Environmental Management System Certification Certificate" as an example:
[0077] The file name label corresponding to the text set 'CCCI' output by the machine learning model is a non-name label, the file name label corresponding to the text set 'Environmental Management System Certification Certificate' is a name label, the file name label corresponding to the text set 'Registration Number: 02109E10521R3L' is a non-name label, and the file name label corresponding to the text set 'This is to certify' is a non-name label, then the file name of the certification document 'Environmental Management System Certification Certificate' is determined to be Environmental Management System Certification Certificate. This embodiment shows a specific implementation method of step 208. Of course, it should be understood that step 208 can also be implemented in other ways, and this embodiment does not limit this.
[0078] From this, it can be seen that this embodiment starts from the perspective of text features, by extracting the features of each line of text in the certificate text and using a machine learning algorithm to train the model, so that the machine learning model can automatically extract the file name from the certificate document, thereby achieving the purpose of improving the speed and accuracy of file name extraction.
[0079] In another possible embodiment, Figure 2 On the basis of the corresponding embodiment, this embodiment takes into account the positional characteristics of the file name of the certification document, such as the file name is generally located relatively front, and therefore further introduces the line number characteristics of the text set and adds it to the text sample corresponding to the text set. Specifically:
[0080] S11, performing coordinate analysis on the certification document after the characters and character coordinates are identified, to obtain a set of characters belonging to the same line in the certification document;
[0081] S12, marking key characters and character types for each line of the character set, and numbering the lines corresponding to each line of the character set in turn based on the vertical coordinates of the characters in the character set to obtain character samples corresponding to each line of the character set, wherein the key character marking is used to indicate whether the character set contains a specified key character, and the character type marking is used to indicate whether the characters in the character set are of the same type;
[0082] S13, respectively inputting the text samples corresponding to the lines of text sets into the machine learning model to obtain the file name labels corresponding to the lines of text sets, wherein the machine learning model is trained based on the training text samples corresponding to the batch of certification documents and the file name labels corresponding to the training text samples, and the training text samples have the same dimensional features as the text samples;
[0083] S14. Determine the file name of the certification document based on the text sets and corresponding file name tags.
[0084] It should be noted that, for the above S11-S14, since they are respectively related to Figure 2Steps 202 to 208 in the corresponding embodiment are similar, so only the numbered parts in S12 are described below. For implementation methods of other parts, please refer to Figure 2 Corresponding to the relevant description in the embodiment.
[0085] Similarly, taking 'Environmental Management System Certification Certificate' as an example, after marking S11-S14, the text samples corresponding to each row shown in Table 3 below can be obtained:
[0086] Line Number text collection Does it contain key words? Are the text types the same? 0 CCCI 0 1 1 Environmental Management System Certification 1 1 2 Registration number: 02109E10521R3L 0 0 3 This is to certify 0 1
[0087] Table 3
[0088] Based on this, this embodiment can avoid interference caused by non-certificate documents by introducing the feature of the line number corresponding to the text set, thereby effectively improving the extraction accuracy of the file name.
[0089] In another possible embodiment, Figure 2 On the basis of the corresponding embodiment or the previous embodiment, this embodiment takes into account the size characteristics of the file name, such as the fact that the font size of the file name is generally large, and therefore further introduces the size characteristics of the file name and adds it to the text sample corresponding to the text set to improve the extraction accuracy of the file name and avoid interference from other content. Specific examples can be as follows:
[0090] Example 1
[0091] The size characteristics of the file name include: character width, which is used to represent the maximum difference between the vertical coordinates corresponding to the character set;
[0092] In the process of identifying the coordinates of the characters, this embodiment determines the vertical coordinates of the four corner points of the character frame corresponding to the text set, and uses the maximum difference between the vertical coordinates of the four corner points as the character width corresponding to the text set; or
[0093] In the process of identifying the character coordinates, the vertical coordinates of each character in the text set are determined, and the maximum difference between the vertical coordinates of each character is used as the character width of the text set.
[0094] Taking the "Environmental Management System Certification Certificate" as an example, the text samples corresponding to each row shown in Table 4 below can be obtained:
[0095]
[0096] Table 4
[0097] Based on Example 1, this embodiment takes into account that the font size of the file name is usually large, and therefore introduces the feature of the text width into the text sample, thereby effectively improving the extraction accuracy of the file name.
[0098] Example 2
[0099] The size feature of the file name also includes: relative text width, where the relative text width is the relative value of the text width corresponding to the target text set relative to the text width corresponding to other text sets.
[0100] After determining the character width corresponding to each character set, calculate the relative character width between this character set and other character sets. For example, if the character width corresponding to the target character set is x1, and the character widths corresponding to other character sets are x2, x3, and x4, then the relative character widths corresponding to the target character set are x1-x2, x1-x3, and x1-x4.
[0101] Based on Example 2, this embodiment further considers the size relationship between the width of the text name and the width of other text, and introduces the feature of relative text width into the text sample, thereby effectively improving the extraction accuracy of the file name.
[0102] Example 3
[0103] The size feature of the file name also includes: character length, and the character length is used to represent the maximum difference between the horizontal coordinates corresponding to the character set.
[0104] In the process of identifying the coordinates of the characters, this embodiment determines the horizontal coordinates of the four corner points of the character frame corresponding to the text set, and uses the maximum difference between the horizontal coordinates of the four corner points as the character length of the text set; or
[0105] In the process of identifying the character coordinates, the horizontal coordinates of each character in the text set are determined, and the maximum difference between the horizontal coordinates of each character is used as the character length of the text set.
[0106] Taking 'Environmental Management System Certification Certificate' as an example, the text samples corresponding to each row shown in Table 5 below can be obtained:
[0107]
[0108] Table 5
[0109] Based on Example 3, this embodiment takes into account that the number of characters in a file name is neither too many nor too few, and therefore introduces the feature of character length into the character sample, thereby effectively improving the extraction accuracy of the file name.
[0110] Figure 4 This is a schematic diagram of a structure of a certification document processing device provided in an embodiment of this specification, see Figure 4 , the device may specifically include:
[0111] An analysis module 41 performs coordinate analysis on the text and the document after the text coordinates are identified, and obtains a set of texts belonging to the same line in the document;
[0112] The marking module 42 performs key character marking and character type marking on each line of the text set to obtain a text sample corresponding to each line of the text set, wherein the key character marking is used to indicate whether the text set contains a specified key character, and the character type marking is used to indicate whether the types of the characters in the text set are the same;
[0113] The processing module 43 inputs the text samples corresponding to the respective lines of text sets into a machine learning model to obtain the file name labels corresponding to the respective lines of text sets, wherein the machine learning model is trained based on training text samples corresponding to a batch of certification documents and the file name labels corresponding to the training text samples, and the training text samples have features of the same dimension as the text samples;
[0114] The determination module 44 determines the file name of the certification document based on the text lines and the corresponding file name tags.
[0115] Optionally, the file name tag includes a name tag and a non-name tag;
[0116] The determination module 44 includes:
[0117] A first determination unit determines a target text set corresponding to the name tag;
[0118] The second determination module determines the file name of the certification document based on the target text set.
[0119] Optionally, the text sample further includes: a line number;
[0120] The device also includes:
[0121] The numbering module sequentially numbers the lines corresponding to each line of the text set based on the vertical coordinates of the characters in the text set.
[0122] Optionally, the text sample further includes: text width, the text width is used to represent the maximum difference between vertical coordinates corresponding to the text set;
[0123] The device also includes:
[0124] The text width processing module determines the vertical coordinates of the four corner points of the text border corresponding to the text set, and uses the maximum difference between the vertical coordinates of the four corner points as the text width corresponding to the text set; or determines the vertical coordinates of each character in the text set, and uses the maximum difference between the vertical coordinates of each character as the text width of the text set.
[0125] Optionally, the text sample further includes: a relative text width, where the relative text width is a relative value of a text width corresponding to the target text set relative to text widths corresponding to other text sets.
[0126] Optionally, the text sample further includes: a text length, wherein the text length is used to represent the maximum difference between horizontal coordinates corresponding to the text set;
[0127] The device also includes:
[0128] The text length processing module determines the horizontal coordinates of the four corner points of the text border corresponding to the text set, and uses the maximum difference between the horizontal coordinates of the four corner points as the text length of the text set; or determines the horizontal coordinates of each character in the text set, and uses the maximum difference between the horizontal coordinates of each character as the text length of the text set.
[0129] Optionally, the key word annotation is also used to indicate whether the word set contains an alias for the designated key word.
[0130] Optionally, the character type label is also used to characterize the character type when the types of characters in the character set are the same.
[0131] Optionally, the training text sample further includes: at least one translation of the text in the text set;
[0132] The device also includes:
[0133] The translation module translates the text recognized by the text recognition to obtain at least one translation.
[0134] Optionally, the machine learning model is obtained by training based on any one of decision trees, random forests, and support vector machines.
[0135] From this, it can be seen that this embodiment starts from the perspective of text features, by extracting the features of each line of text in the certificate text and using a machine learning algorithm to train the model, so that the machine learning model can automatically extract the file name from the certificate document, thereby achieving the purpose of improving the speed and accuracy of file name extraction.
[0136] In addition, for the above-mentioned device implementation, since it is basically similar to the method implementation, the description is relatively simple, and the relevant parts can refer to the partial description of the method implementation. It should be noted that among the various components of the device in this specification, the components are logically divided according to the functions to be implemented, but this specification is not limited to this, and the various components can be re-divided or combined as needed.
[0137] Figure 5 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this specification, see Figure 5, the electronic device includes a processor, an internal bus, a network interface, a memory and a non-volatile memory, and of course may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a certification document processing device at the logical level. Of course, in addition to the software implementation method, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0138] The network interface, processor and memory can be connected to each other through a bus system. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0139] The memory is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory may include read-only memory and random access memory, and provide instructions and data to the processor. The memory may include high-speed random access memory (RAM), and may also include non-volatile memory (non-volatile memory), such as at least one disk storage.
[0140] The processor is used to execute the program stored in the memory, and specifically perform:
[0141] Performing coordinate analysis on the certification document after the characters and character coordinates are identified to obtain a set of characters belonging to the same line in the certification document;
[0142] Perform key character annotation and character type annotation on each line of character set to obtain character samples corresponding to each line of character set, wherein the key character annotation is used to indicate whether the character set contains a specified key character, and the character type annotation is used to indicate whether the characters in the character set are of the same type;
[0143] Inputting the text samples corresponding to each line of text set into the machine learning model respectively to obtain the file name labels corresponding to each line of text set, the machine learning model is trained based on the training text samples corresponding to the batch of certification documents and the file name labels corresponding to the training text samples, and the training text samples have the same dimensional features as the text samples;
[0144] Based on the text lines and the corresponding file name tags, the file name of the certification document is determined.
[0145] The above is as in this manual Figure 4 The method performed by the certification document processing device or the manager (Master) node disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of this specification can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of this specification can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0146] The document processing device can also perform Figure 2 and implement the method executed by the manager node.
[0147] Based on the same invention, the embodiment of this specification also provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes Figure 2 The corresponding embodiment provides a method for processing certification documents.
[0148] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0149] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0150] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0151] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. 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.
[0152] 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 comprising 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.
[0153] 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.
[0154] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0155] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0156] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0157] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0158] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product 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 code.
[0159] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A method for processing certification documents, comprising: Performing coordinate analysis on the certification document after the characters and character coordinates are identified to obtain a set of characters belonging to the same line in the certification document; Perform key text annotation and text type annotation on each line of text set to obtain text samples corresponding to each line of text set, wherein the key text annotation is used to indicate whether the text set contains a specified key text, the specified key text is a text indicating a file type, and the text type annotation is used to indicate whether the types of the texts in the text set are the same; Inputting the text samples corresponding to each line of text set into the machine learning model respectively, and obtaining the file name labels corresponding to each line of text set, wherein the machine learning model is trained based on the training text samples corresponding to the batch of certification documents and the file name labels corresponding to the training text samples, wherein the training text samples have the same dimensional features as the text samples; the file name labels include name labels and non-name labels; Determine a target text set corresponding to the name tag; and determine the file name of the certification document based on the target text set.
2. The method according to claim 1, wherein the text sample further comprises: Line number; The method further includes: Based on the vertical coordinates of the characters in the character set, the lines corresponding to each line of the character set are numbered in sequence.
3. The method according to claim 1, wherein the text sample further comprises: Character width, where the character width is used to represent the maximum difference between vertical coordinates corresponding to the character set; The method further includes: Determine the vertical coordinates of four corner points of the character border corresponding to the text set, and use the maximum difference between the vertical coordinates of the four corner points as the character width corresponding to the text set; or, The vertical coordinates of each character in the text set are determined, and the maximum difference between the vertical coordinates of each character is used as the character width of the text set.
4. The method according to claim 3, wherein the text sample further comprises: The relative character width is the relative value of the character width corresponding to the target character set relative to the character width corresponding to other character sets.
5. The method according to claim 1, wherein the text sample further comprises: Character length, where the character length is used to represent the maximum difference between horizontal coordinates corresponding to the character set; The method further includes: Determine the horizontal coordinates of four corner points of the character frame corresponding to the text set, and use the maximum difference between the horizontal coordinates of the four corner points as the character length of the text set; or, The horizontal coordinates of each character in the text set are determined, and the maximum difference between the horizontal coordinates of each character is used as the character length of the text set.
6. According to the method of claim 1, the key word annotation is also used to indicate whether the word set contains an alias of the specified key word.
7. According to the method of claim 1, the character type label is also used to characterize the character type when the types of characters in the character set are the same.
8. The method according to claim 1, wherein the training text sample further comprises: at least one translation of a text in the collection; The method further includes: The text recognized by the text is translated to obtain at least one translation.
9. According to the method of claim 1, the machine learning model is obtained by training based on any one of decision tree, random forest and support vector machine.
10. A certification document processing device, comprising: An analysis module performs coordinate analysis on the text and the document after the text coordinates are identified to obtain a set of texts belonging to the same line in the document; A marking module is used to mark key words and text types for each line of text sets, and obtain text samples corresponding to each line of text sets. The key word marking is used to indicate whether the text set contains specified key words, and the specified key words are words indicating the file type. The text type marking is used to indicate whether the types of the words in the text set are the same. The processing module inputs the text samples corresponding to each line of text set into the machine learning model to obtain the file name labels corresponding to each line of text set, wherein the machine learning model is trained based on the training text samples corresponding to the batch of certification documents and the file name labels corresponding to the training text samples, wherein the training text samples have the same dimensional features as the text samples; the file name labels include name labels and non-name labels; A determination module is used to determine a target text set corresponding to the name tag; based on the target text set, a file name of the certification document is determined.
11. An electronic device, comprising: processor; as well as a memory arranged to store computer executable instructions which, when executed, cause the processor to: Performing coordinate analysis on the certification document after the characters and character coordinates are identified to obtain a set of characters belonging to the same line in the certification document; Perform key text annotation and text type annotation on each line of text set to obtain text samples corresponding to each line of text set, wherein the key text annotation is used to indicate whether the text set contains a specified key text, the specified key text is a text indicating a file type, and the text type annotation is used to indicate whether the types of the texts in the text set are the same; Inputting the text samples corresponding to each line of text set into the machine learning model respectively, and obtaining the file name labels corresponding to each line of text set, wherein the machine learning model is trained based on the training text samples corresponding to the batch of certification documents and the file name labels corresponding to the training text samples, wherein the training text samples have the same dimensional features as the text samples; the file name labels include name labels and non-name labels; Determine a target text set corresponding to the name tag; and determine the file name of the certification document based on the target text set.
12. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements the following operations: Performing coordinate analysis on the certification document after the characters and character coordinates are identified to obtain a set of characters belonging to the same line in the certification document; Perform key text annotation and text type annotation on each line of text set to obtain text samples corresponding to each line of text set, wherein the key text annotation is used to indicate whether the text set contains a specified key text, the specified key text is a text indicating a file type, and the text type annotation is used to indicate whether the types of the texts in the text set are the same; Inputting the text samples corresponding to each line of text set into the machine learning model respectively, and obtaining the file name labels corresponding to each line of text set, wherein the machine learning model is trained based on the training text samples corresponding to the batch of certification documents and the file name labels corresponding to the training text samples, wherein the training text samples have the same dimensional features as the text samples; the file name labels include name labels and non-name labels; Determine a target text set corresponding to the name tag; and determine the file name of the certification document based on the target text set.
Citation Information
Patent Citations
Character identification method for certificates
CN102236782A
Business license identification method and device
CN108399405A
Sentiment classification method and system based on bilingual information
CN108536756A
Business object identification method and device
CN111553487A
OCR recognition method and electronic device thereof
WO2020155763A1
