A method, device, equipment and storage medium for reviewing red-headed documents
Through optical character recognition and seal detection models, combined with business models, the problem of inaccurate information extraction from red-headed documents has been solved, accurate and controllable review of red-headed documents has been achieved, and review efficiency and accuracy have been improved.
Patent Information
- Application Number
- CN202310915729.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-07-25
AI Technical Summary
The existing OCR recognition model is unable to accurately extract all the information of official documents, resulting in low efficiency in the review of official documents.
Utilizing the preset optical character recognition technology model and seal detection model, combined with the business model, the text box, document number, company name, font color and seal information of official documents can be identified to achieve accurate review.
It achieves accurate and controllable extraction of official document information, improving audit efficiency and accuracy.
Smart Images

Figure CN116863479B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of government affairs technology, and in particular to a method, device, equipment and storage medium for reviewing official documents. Background Art
[0002] Government affairs assisted approval refers to the use of information technology to optimize and improve the approval process of official documents, thereby improving approval efficiency and service quality. Official document approval exists in a variety of business processes, and requires approval of whether the official document is official, whether the company name matches, whether the official document number exists and is correct, etc. Therefore, it is necessary to extract the above information and implement the document approval process in combination with the business model. In addition, since the original document may be an image or scanned document that cannot be edited, it is necessary to extract the document text from the uploaded original document. In addition, based on the extracted document text, the key information of the official document is extracted. At present, there are OCR (Optical Character Recognition) recognition models that can recognize document text, and there are some deep learning models for layout analysis that are used to extract document layout information. However, the above models cannot extract all the information of the official document, so how to accurately extract the official document information and review it needs to be solved. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for reviewing red-headed documents, which can achieve accurate and controllable extraction of red-headed document information. The specific solution is as follows:
[0004] In a first aspect, the present application discloses a method for reviewing official documents, comprising:
[0005] Using a preset optical character recognition technology model to perform data recognition on the red-headed document to be reviewed to determine a first text box of the red-headed document to be reviewed, and determining the official document number information of the red-headed document to be reviewed based on the first text box;
[0006] Determine the company name and document title of the red-headed document to be reviewed from the first text box based on the official document number information, and determine the font color of the company name;
[0007] Using a preset seal detection model to detect the red-headed document to be reviewed, so as to obtain seal information corresponding to the red-headed document to be reviewed;
[0008] The official document number information, the company name, the document title, the font color and the seal information are reviewed through a preset business model to obtain a corresponding red-headed document review result.
[0009] Optionally, the step of using a preset optical character recognition technology model to perform data recognition on the red-headed document to be reviewed to determine the first text box of the red-headed document to be reviewed includes:
[0010] Using a preset optical character recognition technology model to perform data recognition on the red-headed document to be reviewed to determine an initial text box and corresponding initial text box coordinates of the red-headed document to be reviewed; the initial text box coordinates include a left horizontal coordinate, a right horizontal coordinate, an upper vertical coordinate, and a lower vertical coordinate;
[0011] The initial text boxes are sorted and merged based on the initial text box coordinates to obtain a first text box of the red-headed document to be reviewed.
[0012] Optionally, the arranging and merging the initial text boxes based on the upper vertical coordinate to obtain the first text box of the red-headed document to be reviewed includes:
[0013] The initial text boxes whose upper vertical coordinates have a distance difference less than a preset threshold and the corresponding initial text box coordinates are merged to obtain the first text box of the red-headed document to be reviewed.
[0014] Optionally, determining the official document number information of the red-headed document to be reviewed based on the first text box includes:
[0015] The first text box is matched and extracted using a preset regular expression to obtain the official document number of the red-headed document to be reviewed and the second text box corresponding to the official document number.
[0016] Optionally, determining the company name and document title of the red-headed document to be reviewed from the first text box using the official document number information includes:
[0017] Determining a third text box corresponding to the company name of the red-headed document to be reviewed from the first text box based on the second text box, and determining the company name of the red-headed document to be reviewed based on the third text box;
[0018] A fourth text box corresponding to the file title of the red-headed document to be reviewed is determined from the first text box based on the second text box, and the file title of the red-headed document to be reviewed is determined based on the fourth text box.
[0019] Optionally, determining the font color of the company name includes:
[0020] The third text box is scanned, and the font color of the company name is determined based on a ratio of red pixels in the third text box to all pixels in the third text box.
[0021] Optionally, determining a fourth text box corresponding to the title of the red-headed document to be reviewed from the first text box based on the second text box includes:
[0022] Determine the next text box of the second text box in the first text box as the title text box;
[0023] Determine the next text box of the title text box as the current text box, and determine whether the coordinates of the current text box meet the preset coordinate conditions;
[0024] If so, the current text box is determined as the title text box, and the process jumps to the step of determining the next text box after the title text box as the current text box, until the coordinates of the current text box do not meet the preset coordinate conditions;
[0025] A fourth text box corresponding to the file title of the red-headed document to be reviewed is determined based on the title text box.
[0026] In a second aspect, the present application discloses a red-headed document review device, comprising:
[0027] a data recognition module, configured to perform data recognition on the red-headed document to be reviewed using a preset optical character recognition technology model to determine a first text box of the red-headed document to be reviewed, and determine the official document number information of the red-headed document to be reviewed based on the first text box;
[0028] An information determination module, configured to determine the company name and document title of the red-headed document to be reviewed from the first text box using the official document number information, and to determine the font color of the company name;
[0029] A seal determination module is used to detect the red-headed document to be reviewed using a preset seal detection model to obtain seal information corresponding to the red-headed document to be reviewed;
[0030] The information review module is used to review the official document number information, the company name, the document title, the font color and the seal information through a preset business model to obtain the corresponding red-headed document review result.
[0031] In a third aspect, the present application discloses an electronic device, comprising:
[0032] Memory, used to store computer programs;
[0033] A processor is used to execute the computer program to implement the aforementioned red-headed document review method.
[0034] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, which implements the aforementioned red-headed document review method when executed by a processor.
[0035] It can be seen that in this application, a preset optical character recognition technology model is used to perform data recognition on the red-headed document to be reviewed to determine the first text box of the red-headed document to be reviewed, and the official document number information of the red-headed document to be reviewed is determined based on the first text box; the company name and document title of the red-headed document to be reviewed are determined from the first text box through the official document number information, and the font color of the company name is determined; the red-headed document to be reviewed is detected using a preset seal detection model to obtain the seal information corresponding to the red-headed document to be reviewed; the official document number information, the company name, the document title, the font color and the seal information are reviewed through a preset business model to obtain the corresponding red-headed document review result. In this way, based on the text box information recognized by the OCR recognition model, key information such as the red-headed document title, official document number, company name, seal, etc. is customized to be extracted; accurate and controllable extraction of red-headed document information can be achieved, which has high practical value and innovative value. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0037] Figure 1 A flow chart of a red-headed document review method disclosed in this application;
[0038] Figure 2 A flowchart of a specific red-headed document review method disclosed in this application;
[0039] Figure 3 This is a schematic diagram of the structure of a red-headed document review device disclosed in this application;
[0040] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0042] Currently, there are existing OCR recognition models that can recognize document text, but cannot extract all the information of official documents. This embodiment will specifically introduce a method for reviewing official documents, which can achieve accurate and controllable extraction of official document information.
[0043] See also Figure 1 As shown, the embodiment of the present application discloses a method for reviewing red-headed documents, including:
[0044] Step S11: using a preset optical character recognition technology model to perform data recognition on the red-headed document to be reviewed to determine a first text box of the red-headed document to be reviewed, and determining the official document number information of the red-headed document to be reviewed based on the first text box.
[0045] In this embodiment, using a preset optical character recognition technology model to perform data recognition on a red-headed document to be reviewed to determine a first text box of the red-headed document to be reviewed includes: using a preset optical character recognition technology model to perform data recognition on the red-headed document to be reviewed to determine an initial text box of the red-headed document to be reviewed and corresponding initial text box coordinates; the initial text box coordinates include a left horizontal coordinate, a right horizontal coordinate, an upper vertical coordinate, and a lower vertical coordinate; and merging the initial text boxes based on the initial text box coordinates to obtain the first text box of the red-headed document to be reviewed. Specifically, an OCR model is used to infer scanned document data to obtain an OCR recognition result, including text box content and text box location information. "text" represents the text box content, and "x_min", "x_max", "y_min", and "y_max" represent the left horizontal coordinate, right horizontal coordinate, upper vertical coordinate, and lower vertical coordinate of the text box. Then, initial text boxes whose upper vertical coordinates have a distance difference less than a preset threshold are merged with the corresponding initial text box coordinates to obtain the first text box of the red-headed document to be reviewed. Specifically, the OCR recognition result is post-processed. The texts that belong to the same row but are identified as different boxes are merged, and the text boxes in the same row are merged by matching the y_min coordinates. The text boxes with a y_min distance difference less than a certain threshold are considered to be text boxes in the same row, and the text and coordinate information of the text boxes belonging to the same row are merged. It should be noted that the present application uses the distance difference between the upper vertical coordinates as the standard to judge whether the text boxes are in the same row. In actual applications, the corresponding coordinates can be selected as the judgment standard according to the actual situation. The official document number information of the red-headed document to be reviewed based on the first text box is determined, including: using a preset regular expression to match and extract the first text box to obtain the official document number of the red-headed document to be reviewed and the second text box corresponding to the official document number. Since the writing of the official document number of the red-headed document is relatively fixed, it can be matched and extracted by regular expressions, that is, the first text box is matched using a preset regular expression, and then the official document number and the second text box corresponding to the official document number are determined from the first text box.
[0046] Step S12: Determine the company name and document title of the red-headed document to be reviewed from the first text box using the official document number information, and determine the font color of the company name.
[0047] In this embodiment, determining the company name and document title of the red-headed document to be reviewed from the first text box using the official document number information includes: determining a third text box corresponding to the company name of the red-headed document to be reviewed from the first text box based on the second text box, and determining the company name of the red-headed document to be reviewed based on the third text box; determining a fourth text box corresponding to the document title of the red-headed document to be reviewed from the first text box based on the second text box, and determining the document title of the red-headed document to be reviewed based on the fourth text box. Due to the particularity of red-headed documents' writing style, the text box preceding the second text box can be determined as the third text box corresponding to the company name, and the fourth text box corresponding to the document title is located after the second text box. Determining the font color of the company name includes: scanning the third text box and determining the font color of the company name based on the ratio of red pixels within the third text box to all pixels within the third text box. That is, determining whether the font color of the company name is red is determined by the ratio of red pixels to the total pixels within the third text box.
[0048] Step S13: Detecting the red-headed document to be reviewed using a preset seal detection model to obtain seal information corresponding to the red-headed document to be reviewed.
[0049] In this embodiment, the preset seal detection model is used to detect the red-headed document to be reviewed to obtain the seal information corresponding to the red-headed document to be reviewed, that is, the seal detection model is used to determine whether the red-headed document has corresponding seal information.
[0050] Step S14: reviewing the official document number information, the company name, the document title, the font color and the seal information through a preset business model to obtain a corresponding red-headed document review result.
[0051] In this embodiment, after obtaining the above information, combined with business information, the official document number information, the company name, the document title, the font color and the seal information are input into the preset business model to realize the review of the red-headed document.
[0052] It can be seen that in this embodiment, the preset optical character recognition technology model is used to perform data recognition on the red-headed document to be reviewed to determine the first text box of the red-headed document to be reviewed, and the official document number information of the red-headed document to be reviewed is determined based on the first text box; the company name and document title of the red-headed document to be reviewed are determined from the first text box through the official document number information, and the font color of the company name is determined; the preset seal detection model is used to detect the red-headed document to be reviewed to obtain the seal information corresponding to the red-headed document to be reviewed; the official document number information, the company name, the document title, the font color and the seal information are reviewed through the preset business model to obtain the corresponding red-headed document review result. In this way, based on the text box information recognized by the OCR recognition model, key information such as the red-headed document title, official document number, company name, seal, etc. is customized to be extracted; the accurate and controllable extraction of red-headed document information can be achieved, which has high practical value and innovative value.
[0053] The above embodiment specifically introduces a method for reviewing red-headed documents, which can achieve accurate and controllable extraction of red-headed document information. This embodiment will specifically introduce the process of identifying the title of a red-headed document.
[0054] See also Figure 2 As shown, the embodiment of the present application discloses a specific method for reviewing red-headed documents, including:
[0055] Step S21: Determine the next text box of the second text box in the first text box as the title text box.
[0056] In this embodiment, due to the particularity of the red-headed document format, the text box immediately following the second text box corresponding to the document number is the title text box. Therefore, the next text box of the second text box in the first text box can be determined as the title text box.
[0057] Step S22: determining the next text box of the title text box as the current text box, and determining whether the coordinates of the current text box meet preset coordinate conditions.
[0058] In this embodiment, since the number of words in the title of the red-headed document is uncertain, there is a situation where a title occupies multiple lines of the red-headed document page. Therefore, it is necessary to make judgments in sequence. Therefore, the next text box of the title text box is determined as the current text box, and it is judged whether the coordinates of the current text box meet the preset coordinate conditions. The process of judging whether the coordinates of the current text box meet the preset coordinate conditions is to judge whether the current text box is centered by the coordinate information. If it is centered, the difference between the midpoint of the horizontal coordinate of the current text box and the midpoint of the text box in the previous row is calculated. If the difference is less than the preset difference threshold, the current text box is a title text box; if the current text box is not centered, it is judged whether it is left-aligned and indented on the right. If so, the current text box is a title text box, otherwise, it is not a title text box.
[0059] Step S23: If the conditions are met, the current text box is determined as the title text box, and the process jumps to the step of determining the next text box of the title text box as the current text box, until the coordinates of the current text box do not meet the preset coordinate conditions.
[0060] In this embodiment, if the coordinates of the current text box meet the preset coordinate conditions, the current text box is determined as the title text box, and the process jumps to the step of determining the next text box of the title text box as the current text box, and continues to determine whether the next current text box is the title text box. If not, it means that the determination of the title box is completed.
[0061] Step S24: determining a fourth text box corresponding to the file title of the red-headed document to be reviewed based on the title text box.
[0062] In this embodiment, the title text boxes determined in steps S21 to S23 are integrated to obtain a fourth text box corresponding to the file title of the red-headed document to be reviewed. Then, the file title of the red-headed document to be reviewed is determined based on the fourth text box.
[0063] As can be seen, in this embodiment, the first title text box is determined by the second text box corresponding to the official document number, and then the subsequent text boxes are judged in sequence, and finally the final title text box is determined by integration, thereby obtaining the title of the official document. In this way, accurate and controllable information extraction of official documents can be achieved, and the information obtained from official documents is more accurate, which facilitates subsequent review work.
[0064] refer to Figure 3 The embodiment of the present application further discloses a red-headed document review device, including:
[0065] A data recognition module 11 is configured to perform data recognition on the red-headed document to be reviewed using a preset optical character recognition technology model to determine a first text box of the red-headed document to be reviewed, and determine the official document number information of the red-headed document to be reviewed based on the first text box;
[0066] An information determination module 12 is configured to determine the company name and document title of the red-headed document to be reviewed from the first text box using the official document number information, and to determine the font color of the company name;
[0067] The seal determination module 13 is used to detect the red-headed document to be reviewed using a preset seal detection model to obtain seal information corresponding to the red-headed document to be reviewed;
[0068] The information review module 14 is used to review the official document number information, the company name, the document title, the font color and the seal information through a preset business model to obtain a corresponding red-headed document review result.
[0069] It can be seen that in this embodiment, the preset optical character recognition technology model is used to perform data recognition on the red-headed document to be reviewed to determine the first text box of the red-headed document to be reviewed, and the official document number information of the red-headed document to be reviewed is determined based on the first text box; the company name and document title of the red-headed document to be reviewed are determined from the first text box through the official document number information, and the font color of the company name is determined; the preset seal detection model is used to detect the red-headed document to be reviewed to obtain the seal information corresponding to the red-headed document to be reviewed; the official document number information, the company name, the document title, the font color and the seal information are reviewed through the preset business model to obtain the corresponding red-headed document review result. In this way, based on the text box information recognized by the OCR recognition model, key information such as the red-headed document title, official document number, company name, seal, etc. is customized to be extracted; the accurate and controllable extraction of red-headed document information can be achieved, which has high practical value and innovative value.
[0070] In some specific embodiments, the data identification module 11 may specifically include:
[0071] A document scanning unit, configured to use a preset optical character recognition technology model to perform data recognition on the red-headed document to be reviewed to determine an initial text box and corresponding initial text box coordinates of the red-headed document to be reviewed; the initial text box coordinates include a left horizontal coordinate, a right horizontal coordinate, an upper vertical coordinate, and a lower vertical coordinate;
[0072] The text box sorting submodule is used to sort and merge the initial text boxes based on the initial text box coordinates to obtain the first text box of the red-headed document to be reviewed.
[0073] In some specific embodiments, the text box sorting submodule may be specifically configured to merge the initial text boxes whose upper vertical coordinates have a distance difference less than a preset threshold with the corresponding initial text box coordinates to obtain the first text box of the red-headed document to be reviewed;
[0074] In some specific embodiments, the data identification module 11 may specifically include:
[0075] The information extraction unit is used to match and extract the first text box using a preset regular expression to obtain the official document number of the red-headed document to be reviewed and the second text box corresponding to the official document number.
[0076] In some specific embodiments, the information determination module 12 may specifically include:
[0077] a company name determining unit, configured to determine a third text box corresponding to the company name of the red-headed document to be reviewed from the first text box based on the second text box, and determine the company name of the red-headed document to be reviewed based on the third text box;
[0078] The file title determining unit is configured to determine a fourth text box corresponding to the file title of the red-headed document to be reviewed from the first text box based on the second text box, and determine the file title of the red-headed document to be reviewed based on the fourth text box.
[0079] In some specific embodiments, the information determination module 12 may specifically include:
[0080] The font color determining unit is configured to scan the third text box and determine the font color of the company name based on a ratio of red pixels in the third text box to all pixels in the third text box.
[0081] In some specific embodiments, the information review module 14 may specifically include:
[0082] a title text box determining unit, configured to determine the next text box of the second text box within the first text box as the title text box;
[0083] a conditional judgment unit, configured to determine the next text box of the title text box as the current text box, and to judge whether the coordinates of the current text box meet a preset coordinate condition;
[0084] a step jump unit, configured to determine the current text box as the title text box if the condition is satisfied, and jump to the step of determining the next text box after the title text box as the current text box, until the coordinates of the current text box do not satisfy the preset coordinate condition;
[0085] The text box determining unit is used to determine a fourth text box corresponding to the file title of the red-headed document to be reviewed based on the title text box.
[0086] Furthermore, the embodiment of the present application also discloses an electronic device, Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram should not be considered as any limitation to the scope of application of the present application.
[0087] Figure 4 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the red-headed document review method disclosed in any of the aforementioned embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0088] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0089] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0090] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222. The operating system 221 can be Windows Server, NetWare, Unix, Linux, etc. In addition to including computer programs capable of implementing the red-headed document review method performed by the electronic device 20 as disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs capable of completing other specific tasks.
[0091] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when executed by a processor, the computer program implements the aforementioned red-headed document review method. The specific steps of this method can be referred to the corresponding contents disclosed in the aforementioned embodiments and will not be repeated here.
[0092] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0093] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0094] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0095] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0096] The above is a detailed introduction to the technical solution provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for reviewing official documents, characterized in that: include: Using a preset optical character recognition technology model to perform data recognition on the red-headed document to be reviewed to determine a first text box of the red-headed document to be reviewed, and determining the official document number information of the red-headed document to be reviewed based on the first text box; wherein, determining the official document number information of the red-headed document to be reviewed based on the first text box includes: using a preset regular expression to match and extract the first text box to obtain the official document number of the red-headed document to be reviewed and a second text box corresponding to the official document number; Determine the company name and document title of the red-headed document to be reviewed from the first text box based on the official document number information, and determine the font color of the company name; Wherein, determining the company name and document title of the red-headed document to be reviewed from the first text box using the official document number information includes: determining a third text box corresponding to the company name of the red-headed document to be reviewed from the first text box based on the second text box, and determining the company name of the red-headed document to be reviewed based on the third text box; determining a fourth text box corresponding to the document title of the red-headed document to be reviewed from the first text box based on the second text box, and determining the document title of the red-headed document to be reviewed based on the fourth text box; The determining of a third text box corresponding to the company name of the red-headed document to be reviewed from the first text box based on the second text box includes: Determine the text box in front of the second text box in the first text box as the third text box; The fourth text box corresponding to the file title of the red-headed document to be reviewed is determined from the first text box based on the second text box, including Determine the next text box of the second text box in the first text box as the title text box; Determine the next text box of the title text box as the current text box, and determine whether the coordinates of the current text box meet the preset coordinate conditions; If so, the current text box is determined as the title text box, and the process jumps to the step of determining the next text box after the title text box as the current text box, until the coordinates of the current text box do not meet the preset coordinate conditions; Determine, based on the title text box, a fourth text box corresponding to the file title of the red-headed document to be reviewed; Determining the font color of the company name includes: Scanning the third text box, and determining the font color of the company name based on a ratio of red pixels in the third text box to all pixels in the third text box; Using a preset seal detection model to detect the red-headed document to be reviewed, so as to obtain seal information corresponding to the red-headed document to be reviewed; The official document number information, the company name, the document title, the font color and the seal information are reviewed through a preset business model to obtain a corresponding red-headed document review result.
2. The red-headed document review method according to claim 1, characterized in that: The method of using a preset optical character recognition technology model to perform data recognition on the red-headed document to be reviewed to determine the first text box of the red-headed document to be reviewed includes: Using a preset optical character recognition technology model to perform data recognition on the red-headed document to be reviewed to determine an initial text box and corresponding initial text box coordinates of the red-headed document to be reviewed; the initial text box coordinates include a left horizontal coordinate, a right horizontal coordinate, an upper vertical coordinate, and a lower vertical coordinate; The initial text boxes are sorted and merged based on the initial text box coordinates to obtain a first text box of the red-headed document to be reviewed.
3. The red-headed document review method according to claim 2, characterized in that: The step of arranging and merging the initial text boxes based on the upper vertical coordinate to obtain the first text box of the red-headed document to be reviewed includes: The initial text boxes whose upper vertical coordinates have a distance difference less than a preset threshold and the corresponding initial text box coordinates are merged to obtain the first text box of the red-headed document to be reviewed.
4. A red-headed document review device, characterized in that: include: a data recognition module configured to use a preset optical character recognition technology model to perform data recognition on the red-headed document to be reviewed to determine a first text box of the red-headed document to be reviewed, and determine the official document number information of the red-headed document to be reviewed based on the first text box; wherein, determining the official document number information of the red-headed document to be reviewed based on the first text box includes: using a preset regular expression to match and extract the first text box to obtain the official document number of the red-headed document to be reviewed and a second text box corresponding to the official document number; an information determination module, configured to determine the company name and document title of the red-headed document to be reviewed from the first text box using the official document number information, and determine the font color of the company name; wherein, determining the company name and document title of the red-headed document to be reviewed from the first text box using the official document number information comprises: determining a third text box corresponding to the company name of the red-headed document to be reviewed from the first text box based on the second text box, and determining the company name of the red-headed document to be reviewed based on the third text box; determining a fourth text box corresponding to the document title of the red-headed document to be reviewed from the first text box based on the second text box, and determining the document title of the red-headed document to be reviewed based on the fourth text box; The determining of a third text box corresponding to the company name of the red-headed document to be reviewed from the first text box based on the second text box includes: Determine the text box in front of the second text box in the first text box as the third text box; The fourth text box corresponding to the file title of the red-headed document to be reviewed is determined from the first text box based on the second text box, including Determine the next text box of the second text box in the first text box as the title text box; Determine the next text box of the title text box as the current text box, and determine whether the coordinates of the current text box meet the preset coordinate conditions; If so, the current text box is determined as the title text box, and the process jumps to the step of determining the next text box after the title text box as the current text box, until the coordinates of the current text box do not meet the preset coordinate conditions; Determine, based on the title text box, a fourth text box corresponding to the file title of the red-headed document to be reviewed; Determining the font color of the company name includes: Scanning the third text box, and determining the font color of the company name based on a ratio of red pixels in the third text box to all pixels in the third text box; A seal determination module is used to detect the red-headed document to be reviewed using a preset seal detection model to obtain seal information corresponding to the red-headed document to be reviewed; The information review module is used to review the official document number information, the company name, the document title, the font color and the seal information through a preset business model to obtain the corresponding red-headed document review result.
5. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the red-headed document review method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that Used to store a computer program, which, when executed by a processor, implements the red-headed document review method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Email processing method and device
CN106549853A
File content extraction method and device, electronic equipment and storage medium
CN111209865A