System and method for automatically drawing approval process based on OCR
Through an automated system based on OCR, the historical approval flowchart is identified and analyzed, and a new approval flowchart is generated, which solves the problem of time-consuming and laborious drawing of traditional approval flowcharts and is difficult to update quickly, and realizes efficient and accurate approval flowchart management.
Patent Information
- Application Number
- CN202411805181.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-10
AI Technical Summary
The traditional way of drawing approval flowcharts relies on manual operations, is time-consuming and labor-intensive, and is prone to errors. As the company scales and business processes become more complicated, it becomes more difficult to update and maintain approval flowcharts.
Using an automated system based on OCR, the historical approval flowchart is identified and analyzed through the OCR identification module, a new approval flowchart is generated, and relevant configurations are completed to achieve rapid update of the historical approval process.
It improves the degree of automation of drawing approval processes, reduces the workload of manual drawing and possible errors, realizes rapid update and maintenance of approval flow charts, and improves office efficiency and accuracy.
Smart Images

Figure CN119887079A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automated office technology, and in particular to a system and method for automatically drawing an approval process based on OCR. Background Art
[0002] OCR, or optical character recognition, refers to the technology of scanning and recognizing characters through optical devices and converting them into editable text. In the current office environment, the approval process is an indispensable part of daily work. However, the traditional method of drawing approval flowcharts mostly relies on manual operations, which is not only time-consuming and labor-intensive, but also prone to errors. In addition, with the expansion of enterprise scale and the complexity of business processes, the update and maintenance of approval flowcharts have become more difficult. How to quickly update and maintain approval flowcharts and reduce manual participation has become an urgent problem that needs to be solved.
[0003] Therefore, there is an urgent need for a system and method for automatically drawing approval processes based on OCR to solve the above technical problems. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems in the above-mentioned technologies to a certain extent. To this end, the first aspect of the present invention aims to propose a system for automatically drawing approval processes based on OCR, which can automatically identify and parse historical approval process diagrams through intelligent means, quickly generate new approval process diagrams, and complete related configurations to achieve rapid updates of historical approval processes and improve office efficiency and accuracy.
[0005] A second aspect of the present invention aims to provide a method for automatically drawing an approval process based on OCR.
[0006] To achieve the above-mentioned purpose, the first embodiment of the present invention proposes a system for automatically drawing an approval process based on OCR, comprising:
[0007] OCR recognition module, used to recognize the historical approval flowchart based on OCR technology and obtain the recognition result;
[0008] The flowchart analysis module is used to analyze the recognition results and obtain the approval process information;
[0009] A flowchart generation module, used for inputting approval process information into a pre-trained approval process generation model to generate a first approval flowchart;
[0010] The configuration module is used to obtain approval process configuration requirement information, configure the first approval process diagram based on the approval process configuration requirement information, and obtain the second approval process diagram.
[0011] Preferably, the OCR recognition module includes:
[0012] A denoising submodule is used to denoise the historical approval flowchart to obtain an enhanced historical approval flowchart;
[0013] OCR recognition submodule, used for:
[0014] Perform text detection on the noise-reduced historical approval flowchart based on OCR technology to obtain several text areas corresponding to the noise-reduced historical approval flowchart;
[0015] Take any text area as the target text area;
[0016] Extracting text mask information from the target text area to obtain a character mask corresponding to the target text area, and determining position information corresponding to each character in the target text area;
[0017] Extracting features from the character mask and mapping it to a multidimensional vector space to obtain a character vector corresponding to each character;
[0018] Take any character as the target character; the character vector corresponding to the target character is taken as the target character vector;
[0019] Calculate the similarity between the target character vector and other character vectors except the target character vector to obtain several similarities;
[0020] The sum of several similarities is taken as the target similarity corresponding to the target character;
[0021] Compare the target similarity with a preset similarity threshold;
[0022] If the target similarity is greater than or equal to a preset similarity threshold, the target character is identified with a first preset character database to determine a first character recognition result;
[0023] If the target similarity is less than a preset similarity threshold, the target character is identified with a second preset character database to determine a second character recognition result;
[0024] Traversing all characters in the target text area to obtain a first character recognition result set and a second character recognition result set;
[0025] The first determination submodule is used to:
[0026] The first character matching result set, the second character matching result set and the position information corresponding to each character are used as the recognition result corresponding to the target text area;
[0027] Traverse all text areas and obtain the recognition results corresponding to all text areas;
[0028] The recognition results corresponding to all text areas are used as the recognition results of the historical approval flowchart after noise reduction.
[0029] Preferably, the noise reduction submodule includes:
[0030] The first screening unit is used to:
[0031] Take any historical approval flowchart, perform grayscale processing on the historical approval flowchart, and obtain a grayscale image;
[0032] Get the gray value of each pixel in the gray image;
[0033] Determine the clarity value corresponding to the grayscale image based on a preset algorithm according to the grayscale value of each pixel in the grayscale image;
[0034] Comparing the clarity value with a preset clarity threshold, and when it is determined that the clarity value is less than the preset clarity threshold, taking the grayscale image as an image to be processed;
[0035] The second screening unit is used for:
[0036] Calculate the grayscale mean in the image to be processed;
[0037] Compare the grayscale value of each pixel in the image to be processed with the grayscale mean;
[0038] The pixel points whose grayscale values are greater than or equal to the grayscale mean are taken as the pixel points to be denoised;
[0039] Traverse all the pixels in the image to be processed to obtain a number of pixels to be denoised;
[0040] A third screening unit is used to screen a number of pixels to be denoised to obtain a number of target pixels to be denoised;
[0041] Noise reduction unit for:
[0042] Denoising the plurality of target pixels to be de-noised based on a preset filter to obtain a de-noised historical approval flow chart;
[0043] Traverse all historical approval flowcharts to obtain all denoised historical approval flowcharts.
[0044] Preferably, the preset algorithm includes:
[0045]
[0046] Among them, F represents the clarity value of the grayscale image; L i Represents the gray value corresponding to the i-th pixel in the gray image; represents the grayscale mean of the pixels in the grayscale image; n represents the total number of pixels in the grayscale image; L max Indicates the maximum gray value of the pixel in the gray image; L min Indicates the minimum grayscale value of a pixel in a grayscale image.
[0047] Preferably, the third screening unit comprises:
[0048] Screening subunit for:
[0049] Take any pixel to be denoised;
[0050] Determine the target area of size M×N with the pixel to be denoised as the center;
[0051] Calculate the noise intensity value in the target area as the first noise intensity value corresponding to the pixel to be denoised;
[0052] Get the number of all pixels to be denoised in the target area;
[0053] The ratio of the number of all pixels to be denoised in the target area to the total number of pixels in the target area is used as the second noise intensity value corresponding to the pixel to be denoised;
[0054] Get the preset weight value;
[0055] Determine the noise intensity value corresponding to the pixel to be denoised based on the first noise intensity value, the second noise intensity value and the preset weight value;
[0056] Identify subunits for:
[0057] Comparing the noise intensity value with a preset noise intensity threshold, and when it is determined that the noise intensity value is greater than or equal to the preset noise intensity threshold, taking the pixel point to be denoised as the target pixel point to be denoised;
[0058] Traverse all pixels to be denoised to obtain several target pixels to be denoised.
[0059] Preferably, the flowchart parsing module includes:
[0060] The input submodule is used to input the recognition results into the BiLSTM+CRF model for parsing to obtain the parsing results;
[0061] The second determination submodule is used to use the parsing result as approval process information.
[0062] Preferably, the BiLSTM+CRF model includes:
[0063] The input layer is used to receive the recognition result data and use the recognition result data as input data;
[0064] The embedding layer is used to embed the input data to obtain the embedded data;
[0065] Bidirectional long short-term memory network layer, used to process the embedded data and generate emission scores;
[0066] The linear layer is used to linearly transform the emission scores;
[0067] The conditional random field layer is used to process the emission scores after linear transformation to obtain the prediction results;
[0068] The decoding layer is used to decode the prediction results to obtain the parsing results.
[0069] Preferably, the training method of the approval process generation model includes:
[0070] Get the approval process training set;
[0071] Iteratively training the neural network model based on the approval process training set to obtain an initial approval process generation model;
[0072] Get the approval process test data set;
[0073] The initial approval process generation model is tested based on the approval process test data set to obtain the test result of the initial approval process generation model;
[0074] Compare the test results of the initial approval process generation model with the manually drawn approval process diagram to determine the accuracy of the test results;
[0075] When it is determined that the accuracy is greater than or equal to the preset accuracy threshold, the test result is determined to be qualified, and a trained approval process generation model is obtained.
[0076] Preferably, the configuration module includes:
[0077] A visual display submodule, used for visually displaying the first approval flowchart;
[0078] Get submodule, used to obtain approval process configuration requirement information;
[0079] The configuration submodule is used to configure the first approval flowchart for visual display based on the approval process configuration requirement information to obtain the second approval flowchart.
[0080] To achieve the above object, a second embodiment of the present invention proposes a method for automatically drawing an approval process based on OCR, comprising:
[0081] Recognize the historical approval flowchart based on OCR technology and obtain the recognition result;
[0082] Analyze the recognition results to obtain approval process information;
[0083] Inputting the approval process information into a pre-trained approval process generation model to generate a first approval process diagram;
[0084] Acquire approval process configuration requirement information, configure the first approval process diagram based on the approval process configuration requirement information, and obtain a second approval process diagram.
[0085] The present invention proposes a system and method for automatically drawing an approval process based on OCR. By identifying historical flowcharts through OCR, the existing historical approval process resources can be fully utilized to quickly obtain basic information of the historical approval process. The approval process information is input into a pre-trained approval process generation model to generate a first approval process diagram. A preliminary approval process diagram can be efficiently generated, and approval process configuration requirement information can be obtained. The first approval process diagram is configured based on the approval process configuration requirement information. It can be flexibly adjusted and customized according to specific needs to better meet the requirements of different scenarios and users, improve the degree of automation of approval process drawing, and reduce the workload of manual drawing and possible errors.
[0086] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0087] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0089] Figure 1 is a block diagram of a system for automatically drawing an approval process based on OCR according to an embodiment of the present invention;
[0090] Figure 2 is a block diagram of an OCR recognition module according to an embodiment of the present invention;
[0091] Figure 3 is a schematic diagram of a BiLSTM+CRF model according to an embodiment of the present invention;
[0092] Figure 4 The present invention is a flowchart of a method for automatically drawing an approval process based on OCR according to an embodiment of the present invention. DETAILED DESCRIPTION
[0093] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0094] Example 1
[0095] like Figure 1 As shown, a system for automatically drawing an approval process based on OCR includes:
[0096] OCR recognition module, used to recognize the historical approval flowchart based on OCR technology and obtain the recognition result;
[0097] The flowchart analysis module is used to analyze the recognition results and obtain the approval process information;
[0098] A flowchart generation module, used to input the approval process information into a pre-trained approval process generation model to generate a first approval flowchart;
[0099] The configuration module is used to obtain approval process configuration requirement information, configure the first approval process diagram based on the approval process configuration requirement information, and obtain the second approval process diagram.
[0100] In this embodiment, OCR, or optical character recognition, refers to a technology that scans and recognizes characters through an optical device and converts them into editable text.
[0101] In this embodiment, the recognition result includes but is not limited to text information and graphic information.
[0102] In this embodiment, the approval process information includes basic information, key nodes, paths, conditions and other information of the approval process.
[0103] In this embodiment, the approval process configuration requirement information includes information such as the approval personnel, approval authority, and approval time limit.
[0104] In this embodiment, the first approval flowchart is a new approval flowchart generated by a pre-trained approval process generation model based on the approval process information identified and parsed in the historical approval flowchart, and is an update of the historical approval flowchart; the update includes the form, framework and basic information of the historical approval flowchart, and the elimination of erroneous basic information.
[0105] In this embodiment, the second approval flowchart is configured based on the approval process configuration requirement information of the first approval flowchart, such as the second approval flowchart obtained by reconfiguring the approval personnel, approval authority, approval time limit and other information of the first approval flowchart, that is, the target approval flowchart.
[0106] The beneficial effects of the above technical solution are: by identifying historical flowcharts through OCR, it is possible to make full use of existing historical approval process resources and quickly obtain basic information of historical approval processes. By inputting the approval process information into a pre-trained approval process generation model to generate a first approval flowchart, a preliminary approval flowchart can be efficiently generated, and approval process configuration requirement information can be obtained. The first approval flowchart is configured based on the approval process configuration requirement information, and can be flexibly adjusted and customized according to specific needs to better meet the requirements of different scenarios and users, thereby improving the degree of automation of approval process drawing and reducing the workload and possible errors of manual drawing.
[0107] Example 2
[0108] like Figure 2 As shown, the OCR recognition module includes:
[0109] A denoising submodule is used to denoise the historical approval flowchart to obtain an enhanced historical approval flowchart;
[0110] OCR recognition submodule, used for:
[0111] Perform text detection on the noise-reduced historical approval flowchart based on OCR technology to obtain several text areas corresponding to the noise-reduced historical approval flowchart;
[0112] Take any text area as the target text area;
[0113] Extracting text mask information from the target text area to obtain a character mask corresponding to the target text area, and determining position information corresponding to each character in the target text area;
[0114] Extracting features from the character mask and mapping it to a multidimensional vector space to obtain a character vector corresponding to each character;
[0115] Take any character as the target character; the character vector corresponding to the target character is taken as the target character vector;
[0116] Calculate the similarity between the target character vector and other character vectors except the target character vector to obtain several similarities;
[0117] The sum of several similarities is taken as the target similarity corresponding to the target character;
[0118] Compare the target similarity with a preset similarity threshold;
[0119] If the target similarity is greater than or equal to a preset similarity threshold, the target character is identified with a first preset character database to determine a first character recognition result;
[0120] If the target similarity is less than a preset similarity threshold, the target character is identified with a second preset character database to determine a second character recognition result;
[0121] Traversing all characters in the target text area to obtain a first character recognition result set and a second character recognition result set;
[0122] The first determination submodule is used to:
[0123] The first character matching result set, the second character matching result set and the position information corresponding to each character are used as the recognition result corresponding to the target text area;
[0124] Traverse all text areas and obtain the recognition results corresponding to all text areas;
[0125] The recognition results corresponding to all text areas are used as the recognition results of the historical approval flowchart after noise reduction.
[0126] In this embodiment, text mask information is extracted from the target text area, and the extraction methods include pixel-based extraction: determining the text mask information according to the characteristics of the pixels in the target text area, such as color, brightness and other differences; edge detection extraction: finding the boundary of the text area through an edge detection algorithm to extract the mask information; morphological operation extraction: using morphological operations such as opening and closing operations to extract; feature point extraction: extracting representative feature points in the text area to construct mask information; deep learning algorithm extraction: using a specially trained neural network model to automatically extract text mask information.
[0127] In this embodiment, the position information corresponding to each character in the target text area includes the position coordinates of the character in the horizontal direction and the vertical direction.
[0128] In this embodiment, feature extraction is performed on the character mask, and the extraction methods include but are not limited to shape feature extraction, such as the outline, aspect ratio, etc. of the character; texture feature extraction, analyzing the texture characteristics of the character area; statistical feature extraction, such as the grayscale mean and variance of the character area; structural feature extraction, focusing on features such as the stroke structure of the character; local feature extraction, extracting specific patterns or feature points of the local character; feature extraction based on deep learning, using a deep neural network to automatically extract representative features.
[0129] In this embodiment, the preset similarity threshold is set based on industry experience and is used to classify characters into characters that are easy to recognize and characters that are easy to recognize errors.
[0130] In this embodiment, the characters included in the first preset character database have a similarity between each other that is greater than or equal to a preset similarity threshold, and are used to accurately identify characters that are easily misidentified.
[0131] In this embodiment, the characters included in the second preset character database have a similarity with each other that is less than a preset similarity threshold, and are used to accurately identify easily recognizable characters.
[0132] The beneficial effects of the above technical solution are: the quality of the historical approval flowchart is improved through the denoising sub-module, laying the foundation for subsequent accurate recognition; the use of OCR technology for text detection can accurately obtain the text area; the careful processing and feature extraction of the character mask helps to understand and recognize the characters more accurately; by calculating the similarity and recognizing with different databases according to different situations, the accuracy and adaptability of character recognition are improved; the text area and characters are fully traversed to ensure the complete recognition of the entire historical approval flowchart; the final recognition result combines the character matching results and position information, providing more comprehensive and valuable information, which is convenient for the subsequent analysis and application of the approval flowchart.
[0133] Example 3
[0134] Noise reduction submodule, including:
[0135] The first screening unit is used to:
[0136] Take any historical approval flowchart, perform grayscale processing on the historical approval flowchart, and obtain a grayscale image;
[0137] Get the gray value of each pixel in the gray image;
[0138] Determine the clarity value corresponding to the grayscale image based on a preset algorithm according to the grayscale value of each pixel in the grayscale image;
[0139] Comparing the clarity value with a preset clarity threshold, and when it is determined that the clarity value is less than the preset clarity threshold, taking the grayscale image as an image to be processed;
[0140] The second screening unit is used for:
[0141] Calculate the grayscale mean in the image to be processed;
[0142] Compare the grayscale value of each pixel in the image to be processed with the grayscale mean;
[0143] The pixel points whose grayscale values are greater than or equal to the grayscale mean are taken as the pixel points to be denoised;
[0144] Traverse all the pixels in the image to be processed to obtain a number of pixels to be denoised;
[0145] A third screening unit is used to screen a number of pixels to be denoised to obtain a number of target pixels to be denoised;
[0146] Noise reduction unit for:
[0147] Denoising the plurality of target pixels to be de-noised based on a preset filter to obtain a de-noised historical approval flow chart;
[0148] Traverse all historical approval flowcharts to obtain all denoised historical approval flowcharts.
[0149] The working principle of the above technical solution is: first, the clarity of the historical approval flowchart as a whole is judged by the first screening unit to determine whether the clarity meets the requirements. If the clarity is relatively low, the historical approval flowchart with relatively low clarity is screened for pixels to be denoised by the second screening unit. This is a preliminary screening, and the preliminary screening range is relatively wide to avoid omissions; after obtaining a number of pixels to be denoised, the third screening unit is used to screen a number of pixels to be denoised to obtain a number of target pixels to be denoised. This is a precise screening, and the target pixels to be denoised obtained by three screenings are more accurate. In the prior art, the image is usually segmented to calculate the possibility that each pixel in the segmented image is a noise point, which increases the amount of calculation and is relatively inefficient. In this embodiment, only the screened pixels to be denoised are accurately calculated, which greatly reduces the amount of calculation and improves the efficiency of noise reduction.
[0150] The beneficial effects of the above technical solution are: by performing grayscale processing and clarity judgment on the historical approval flowchart, images that need noise reduction can be effectively screened out, thereby improving the pertinence and efficiency of noise reduction; the grayscale mean is calculated and used as a standard to screen the pixels to be denoised, making the noise reduction target more accurate and avoiding excessive processing of unnecessary pixels; the screened pixels to be denoised are further screened to ensure the accuracy and effectiveness of the noise reduction operation; noise reduction is performed using a preset filter, which can better remove noise and improve the quality and readability of the historical approval flowchart; all historical approval flowcharts are traversed to ensure the consistency of the noise reduction effect of the overall data.
[0151] Example 4
[0152] Preset algorithms, including:
[0153]
[0154] Among them, F represents the clarity value of the grayscale image; L i Represents the gray value corresponding to the i-th pixel in the gray image; represents the grayscale mean of the pixels in the grayscale image; n represents the total number of pixels in the grayscale image; L max Indicates the maximum gray value of the pixel in the gray image; L minIndicates the minimum grayscale value of a pixel in a grayscale image.
[0155] The beneficial effects of the above technical solution are: by comprehensively considering the difference between the grayscale value of each pixel and the mean value and factors such as the maximum and minimum grayscale values, it can more comprehensively reflect the clarity of the image; it helps to accurately determine whether the image needs to be denoised, and improve the accuracy and pertinence of subsequent processing.
[0156] Example 5
[0157] The third screening unit includes:
[0158] Screening subunit for:
[0159] Take any pixel to be denoised;
[0160] Determine the target area of size M×N with the pixel to be denoised as the center;
[0161] Calculate the noise intensity value in the target area as the first noise intensity value corresponding to the pixel to be denoised;
[0162] Get the number of all pixels to be denoised in the target area;
[0163] The ratio of the number of all pixels to be denoised in the target area to the total number of pixels in the target area is used as the second noise intensity value corresponding to the pixel to be denoised;
[0164] Get the preset weight value;
[0165] Determine the noise intensity value corresponding to the pixel to be denoised based on the first noise intensity value, the second noise intensity value and the preset weight value;
[0166] Identify subunits for:
[0167] Comparing the noise intensity value with a preset noise intensity threshold, and when it is determined that the noise intensity value is greater than or equal to the preset noise intensity threshold, taking the pixel point to be denoised as the target pixel point to be denoised;
[0168] Traverse all pixels to be denoised to obtain several target pixels to be denoised.
[0169] In this embodiment, the noise intensity value in the target area is calculated, and the specific calculation method is:
[0170]
[0171] Where T represents the noise intensity value in the target area; X n Represents the gray value of the nth pixel in the target area; represents the grayscale mean of the pixels in the target area; n represents the total number of pixels in the target area.
[0172] In this embodiment, the ratio of the number of all pixels to be denoised in the target area to the total number of pixels in the target area is used as the second noise intensity value corresponding to the pixel to be denoised. For example, assuming that the pixel to be denoised is A, and there are other pixels B and C to be denoised in the target area of 3×3 size with the pixel A to be denoised as the center, then the second noise intensity value is Among them, 3 represents the pixels A, B, and C to be denoised; and 9 represents the total number of pixels in the target area.
[0173] In this embodiment, the preset weight value is set in advance based on industry experience, α+β=1, where α represents the weight value corresponding to the first noise intensity value, and β represents the weight value corresponding to the second noise intensity value. For example, α is 0.5 and β is 0.5.
[0174] The beneficial effects of the above technical solution are: by determining the target area and calculating multiple noise intensity values, the noise situation of the pixels to be denoised can be evaluated more comprehensively and accurately, thereby improving the accuracy of screening; different types of noise intensity values and preset weight values are combined to determine the final noise intensity, making the evaluation more reasonable and scientific; the target pixels to be denoised are determined based on the comparison with the preset noise intensity threshold, ensuring that the pixels screened out are indeed the pixels that need to be focused on, thereby improving the pertinence and effect of noise reduction; all pixels to be denoised are traversed, thereby ensuring the comprehensiveness and systematicness of the screening, and avoiding missing important pixels to be denoised.
[0175] Example 6
[0176] Flowchart parsing module, including:
[0177] The input submodule is used to input the recognition results into the BiLSTM+CRF model for parsing to obtain the parsing results;
[0178] The second determination submodule is used to use the parsing result as approval process information.
[0179] The beneficial effects of the above technical solution are: using the BiLSTM+CRF model for analysis improves the accuracy and reliability of the analysis; it can efficiently convert the recognition results into approval process information, which helps to improve the degree of automation of the workflow; it provides accurate basic data for subsequent approval work, reducing the errors and tediousness of manual processing; it makes the entire process more intelligent and efficient, saving time and labor costs.
[0180] Example 7
[0181] like Figure 3 As shown, the BiLSTM+CRF model includes:
[0182] The input layer is used to receive the recognition result data and use the recognition result data as input data;
[0183] The embedding layer is used to embed the input data to obtain the embedded data;
[0184] Bidirectional long short-term memory network layer, used to process the embedded data and generate emission scores;
[0185] The linear layer is used to linearly transform the emission scores;
[0186] The conditional random field layer is used to process the emission scores after linear transformation to obtain the prediction results;
[0187] The decoding layer is used to decode the prediction results to obtain the parsing results.
[0188] In this embodiment, if Figure 3 As shown: Input Layer: Input layer, receiving input data x0,x1,...,x n .
[0189] Embedding Layer: Embedding layer embeds the input data to obtain e0, e1, ..., e n .
[0190] BiLSTM Layer: Bidirectional long short-term memory network layer, which processes the embedded data and generates emission scores. There are multiple BiLSTM modules in the figure, which process different data respectively.
[0191] Linear Layer: Linear layer, which performs linear transformation on the output of BiLSTM.
[0192] Emission Score: Emission score layer, showing the emission scores of different entity types (B-Person, I-Person, B-Organization, I-Organization, O).
[0193] CRF Layer: Conditional random field layer, used to process the emission scores to obtain the final prediction results.
[0194] Decoding Process: The decoding process shows how to get the final entity recognition result from the output of the CRF layer.
[0195] In this embodiment, the BiLSTM+CRF model workflow is as follows: After the input data passes through the embedding layer, it enters the BiLSTM layer. The BiLSTM layer generates emission scores, which are displayed in the emission score layer. After the emission scores are processed by the linear layer, they enter the CRF layer. The CRF layer obtains the final entity recognition result through the decoding process.
[0196] In this embodiment, Figure 3 The weights and scores of different entity types at each layer are shown in Figure 2. For example, the value of B-Person at the emission score layer is 2.09, the value of I-Person is 0.26, and so on.
[0197] The beneficial effects of the above technical solution are that BiLSTM can effectively process the information of the previous and next sequences, and further improve the modeling and prediction capabilities of the sequence in combination with CRF; preprocessing the data through the embedding layer and the synergy of each layer can help improve the accuracy of the final parsing result; it can adapt to recognition result data of different types and lengths, and has good versatility and flexibility; the reasonable design and combination of each layer can optimize the performance of the model and improve the processing speed and efficiency; it helps to have a deeper understanding of the semantics and structure of the input data, thereby obtaining a more accurate parsing.
[0198] Example 8
[0199] The training method for the approval process generation model includes:
[0200] Get the approval process training set;
[0201] Iteratively training the neural network model based on the approval process training set to obtain an initial approval process generation model;
[0202] Get the approval process test data set;
[0203] The initial approval process generation model is tested based on the approval process test data set to obtain the test result of the initial approval process generation model;
[0204] Compare the test results of the initial approval process generation model with the manually drawn approval process diagram to determine the accuracy of the test results;
[0205] When it is determined that the accuracy is greater than or equal to the preset accuracy threshold, the test result is determined to be qualified, and a trained approval process generation model is obtained.
[0206] In this embodiment, the neural network model can identify the characteristics of basic information, key nodes, paths and conditions in the approval flowchart by learning a large number of approval flowcharts in the approval process training set; match the characteristics of the basic information, key nodes, paths and conditions in the approval flowchart with the preset approval process information feature database, query the approval process feature-template data table based on the matching result, and determine the approval process template corresponding to the approval process information; query the preset approval process information knowledge graph based on the basic information in the approval flowchart, verify the approval process information, eliminate erroneous information in the approval process information, and obtain the verified approval process information when it is determined that the verification result is qualified; generate a first approval flowchart based on the approval process information and the approval process template.
[0207] The beneficial effects of the above technical solution are: through iterative training of a large number of training sets, verification of test data sets and comparison with manual drawing, the model is continuously optimized to ensure that the generated approval process has high accuracy; strict testing and accuracy requirements ensure that the final approval process generation model is reliable and can play a stable role in practical applications; the generation of the approval process can be automatically completed through the model, reducing dependence on manual drawing and improving work efficiency.
[0208] Example 9
[0209] Configuration modules, including:
[0210] A visual display submodule, used for visually displaying the first approval flowchart;
[0211] Get submodule, used to obtain approval process configuration requirement information;
[0212] The configuration submodule is used to configure the first approval flowchart for visual display based on the approval process configuration requirement information to obtain the second approval flowchart.
[0213] The beneficial effects of the above technical solution are: the visual display makes it easy for users to intuitively view the approval flowchart and improves interactivity; targeted configuration is performed based on the specific demand information obtained to meet personalized needs; the configuration of the approval flowchart is completed quickly, saving time and energy; and it can flexibly adapt to the needs of different scenarios and business changes.
[0214] The second aspect of the present invention aims to propose a method for automatically drawing an approval process based on OCR, comprising steps S1-S4:
[0215] S1: Recognize the historical approval flowchart based on OCR technology to obtain the recognition result;
[0216] S2: Analyze the recognition results to obtain approval process information;
[0217] S3: input the approval process information into a pre-trained approval process generation model to generate a first approval process diagram;
[0218] S4: Acquire approval process configuration requirement information, configure the first approval process diagram based on the approval process configuration requirement information, and obtain a second approval process diagram.
[0219] The beneficial effects of the above technical solution are: by identifying historical flowcharts through OCR, it is possible to make full use of existing historical approval process resources and quickly obtain basic information of historical approval processes. By inputting the approval process information into a pre-trained approval process generation model to generate a first approval flowchart, a preliminary approval flowchart can be efficiently generated, and approval process configuration requirement information can be obtained. The first approval flowchart is configured based on the approval process configuration requirement information, and can be flexibly adjusted and customized according to specific needs to better meet the requirements of different scenarios and users, thereby improving the degree of automation of approval process drawing and reducing the workload and possible errors of manual drawing.
[0220] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A system for automatically drawing approval processes based on OCR, characterized in that: include: OCR recognition module, used to recognize the historical approval flowchart based on OCR technology and obtain the recognition result; The flowchart analysis module is used to analyze the recognition results and obtain the approval process information; A flowchart generation module, used for inputting approval process information into a pre-trained approval process generation model to generate a first approval flowchart; The configuration module is used to obtain approval process configuration requirement information, configure the first approval process diagram based on the approval process configuration requirement information, and obtain the second approval process diagram.
2. The system for automatically drawing approval process based on OCR as claimed in claim 1, characterized in that: OCR recognition module, including: A denoising submodule is used to denoise the historical approval flowchart to obtain an enhanced historical approval flowchart; OCR recognition submodule, used for: Perform text detection on the noise-reduced historical approval flowchart based on OCR technology to obtain several text areas corresponding to the noise-reduced historical approval flowchart; Take any text area as the target text area; Extracting text mask information from the target text area to obtain a character mask corresponding to the target text area, and determining position information corresponding to each character in the target text area; Extracting features from the character mask and mapping it to a multidimensional vector space to obtain a character vector corresponding to each character; Take any character as the target character; the character vector corresponding to the target character is taken as the target character vector; Calculate the similarity between the target character vector and other character vectors except the target character vector to obtain several similarities; The sum of several similarities is taken as the target similarity corresponding to the target character; Compare the target similarity with a preset similarity threshold; If the target similarity is greater than or equal to a preset similarity threshold, the target character is identified with a first preset character database to determine a first character recognition result; If the target similarity is less than a preset similarity threshold, the target character is identified with a second preset character database to determine a second character recognition result; Traversing all characters in the target text area to obtain a first character recognition result set and a second character recognition result set; The first determination submodule is used to: The first character matching result set, the second character matching result set and the position information corresponding to each character are used as the recognition result corresponding to the target text area; Traverse all text areas and obtain the recognition results corresponding to all text areas; The recognition results corresponding to all text areas are used as the recognition results of the historical approval flowchart after noise reduction.
3. The system for automatically drawing approval process based on OCR as claimed in claim 2, characterized in that: Noise reduction submodule, including: The first screening unit is used to: Take any historical approval flowchart, perform grayscale processing on the historical approval flowchart, and obtain a grayscale image; Get the gray value of each pixel in the gray image; Determine the clarity value corresponding to the grayscale image based on a preset algorithm according to the grayscale value of each pixel in the grayscale image; Comparing the clarity value with a preset clarity threshold, and when it is determined that the clarity value is less than the preset clarity threshold, taking the grayscale image as an image to be processed; The second screening unit is used for: Calculate the grayscale mean in the image to be processed; Compare the grayscale value of each pixel in the image to be processed with the grayscale mean; The pixel points whose grayscale values are greater than or equal to the grayscale mean are taken as the pixel points to be denoised; Traverse all the pixels in the image to be processed to obtain a number of pixels to be denoised; A third screening unit is used to screen a number of pixels to be denoised to obtain a number of target pixels to be denoised; Noise reduction unit for: Denoising the plurality of target pixels to be de-noised based on a preset filter to obtain a de-noised historical approval flow chart; Traverse all historical approval flowcharts to obtain all denoised historical approval flowcharts.
4. The system for automatically drawing approval process based on OCR as claimed in claim 3, characterized in that: Preset algorithms, including: Among them, F represents the clarity value of the grayscale image; L i Represents the gray value corresponding to the i-th pixel in the gray image; represents the grayscale mean of the pixels in the grayscale image; n represents the total number of pixels in the grayscale image; L max Indicates the maximum gray value of the pixel in the gray image; L min Indicates the minimum grayscale value of a pixel in a grayscale image.
5. The system for automatically drawing approval process based on OCR as claimed in claim 3, characterized in that: The third screening unit includes: Screening subunit for: Take any pixel to be denoised; Determine the target area of size M×N with the pixel to be denoised as the center; Calculate the noise intensity value in the target area as the first noise intensity value corresponding to the pixel to be denoised; Get the number of all pixels to be denoised in the target area; The ratio of the number of all pixels to be denoised in the target area to the total number of pixels in the target area is used as the second noise intensity value corresponding to the pixel to be denoised; Get the preset weight value; Determine the noise intensity value corresponding to the pixel to be denoised based on the first noise intensity value, the second noise intensity value and the preset weight value; Identify subunits for: Comparing the noise intensity value with a preset noise intensity threshold, and when it is determined that the noise intensity value is greater than or equal to the preset noise intensity threshold, taking the pixel point to be denoised as the target pixel point to be denoised; Traverse all pixels to be denoised to obtain several target pixels to be denoised.
6. The system for automatically drawing approval process based on OCR as claimed in claim 1, characterized in that: Flowchart parsing module, including: The input submodule is used to input the recognition results into the BiLSTM+CRF model for parsing to obtain the parsing results; The second determination submodule is used to use the parsing result as approval process information.
7. The system for automatically drawing approval process based on OCR as claimed in claim 6, characterized in that: BiLSTM+CRF model, including: The input layer is used to receive the recognition result data and use the recognition result data as input data; The embedding layer is used to embed the input data to obtain the embedded data; Bidirectional long short-term memory network layer, used to process the embedded data and generate emission scores; The linear layer is used to linearly transform the emission scores; The conditional random field layer is used to process the emission scores after linear transformation to obtain the prediction results; The decoding layer is used to decode the prediction results to obtain the parsing results.
8. The system for automatically drawing approval process based on OCR as claimed in claim 1, characterized in that: The training method for the approval process generation model includes: Get the approval process training set; Iteratively training the neural network model based on the approval process training set to obtain an initial approval process generation model; Get the approval process test data set; The initial approval process generation model is tested based on the approval process test data set to obtain the test result of the initial approval process generation model; Compare the test results of the initial approval process generation model with the manually drawn approval process diagram to determine the accuracy of the test results; When it is determined that the accuracy is greater than or equal to the preset accuracy threshold, the test result is determined to be qualified, and a trained approval process generation model is obtained.
9. The system for automatically drawing approval process based on OCR as claimed in claim 1, characterized in that: Configuration modules, including: A visual display submodule, used for visually displaying the first approval flowchart; Get submodule, used to obtain approval process configuration requirement information; The configuration submodule is used to configure the first approval flowchart for visual display based on the approval process configuration requirement information to obtain the second approval flowchart.
10. A method for automatically drawing an approval process based on OCR, characterized in that: include: Recognize the historical approval flowchart based on OCR technology and obtain the recognition result; Analyze the recognition results to obtain approval process information; Inputting the approval process information into a pre-trained approval process generation model to generate a first approval process diagram; Acquire approval process configuration requirement information, configure the first approval process diagram based on the approval process configuration requirement information, and obtain a second approval process diagram.
Citation Information
Patent Citations
Method and platform for configuring enterprise workflow based on business component and process engine
CN114926143A
Rapid flow modeling method, system and equipment based on OCR (optical character recognition) and storage medium
CN115062876A
Examination and approval risk screening method, device and equipment and storage medium thereof
CN117151857A
System, control method, and recording medium
US20160269586A1