System and method for automatically drawing an approval process based on OCR
By automatically recognizing and parsing historical approval flowcharts using OCR technology, and combining them with pre-trained generation models and configuration modules, the problem of time-consuming and labor-intensive traditional approval flowchart drawing is solved, enabling rapid updates and efficient automated drawing, and reducing human error.
Patent Information
- Application Number
- CN202411805181.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-12-10
AI Technical Summary
Traditional approval process flowcharts rely on manual operation, which is time-consuming, labor-intensive, and difficult to update and maintain quickly. Especially as companies grow and business processes become more complex, how to achieve rapid updates and reduce manual intervention has become an urgent problem to be solved.
OCR technology is used to automatically identify and parse historical approval flowcharts. New flowcharts are generated through a pre-trained approval process generation model and configured based on configuration requirements, reducing the workload of manual drawing.
It improves the automation of approval process drawing, reduces human error, meets the flexible needs of different scenarios and users, and improves office efficiency and accuracy.
Smart Images

Figure CN119887079B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automation office, and particularly relates to a system and method for automatically drawing an approval process based on OCR. BACKGROUND
[0002] OCR, which stands for Optical Character Recognition, is a technology that converts characters scanned by optical devices into editable text. In the current office environment, the approval process is an indispensable part of daily work. However, the traditional method of drawing an approval process diagram mostly relies on manual operation, which is not only time-consuming and laborious, but also prone to errors. In addition, as the scale of enterprises expands and the business process becomes more complex, the updating and maintenance of the approval process diagram become more difficult. How to quickly update and maintain the approval process diagram and reduce manual intervention has become a pressing problem to be solved.
[0003] Therefore, there is an urgent need for a system and method for automatically drawing an approval process based on OCR to solve the above technical problems. SUMMARY
[0004] The present application aims to at least partially solve one of the above technical problems. To this end, the first aspect of the present application aims to provide a system for automatically drawing an approval process based on OCR, which automatically identifies and analyzes historical approval process diagrams through intelligent means, quickly generates new approval process diagrams, and completes related configurations to realize the quick updating of historical approval processes and improve office efficiency and accuracy.
[0005] The second aspect of the present application aims to provide a method for automatically drawing an approval process based on OCR.
[0006] To achieve the above-mentioned purpose, the first aspect of the present application provides a system for automatically drawing an approval process based on OCR, comprising:
[0007] An OCR recognition module for recognizing historical approval process diagrams based on OCR technology to obtain recognition results;
[0008] A process diagram analysis module for analyzing the recognition results to obtain approval process information;
[0009] A process diagram generation module for inputting the approval process information into a pre-trained approval process generation model to generate a first approval process diagram;
[0010] A configuration module for obtaining approval process configuration requirement information, configuring the first approval process diagram based on the approval process configuration requirement information, and obtaining a second approval process diagram.
[0011] Preferably, the OCR recognition module comprises:
[0012] a noise reduction submodule, configured to reduce noise of a historical approval process diagram to obtain an enhanced historical approval process diagram;
[0013] an OCR recognition submodule, configured to:
[0014] perform text detection on the noise-reduced historical approval process diagram based on an OCR technique to obtain a plurality of text regions corresponding to the noise-reduced historical approval process diagram;
[0015] select one of the text regions as a target text region;
[0016] extract text mask information from the target text region to obtain a character mask corresponding to the target text region and determine position information corresponding to each character in the target text region;
[0017] extract features from the character mask and map the features to a multi-dimensional vector space to obtain a character vector corresponding to each character;
[0018] select one of the characters as a target character, and the character vector corresponding to the target character as a target character vector;
[0019] calculate similarities between the target character vector and other character vectors except the target character vector to obtain a plurality of similarities;
[0020] sum the plurality of similarities to obtain a 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 the preset similarity threshold, identify the target character with a first preset character database to determine a first character recognition result;
[0023] if the target similarity is less than the preset similarity threshold, identify the target character with a second preset character database to determine a second character recognition result;
[0024] iterate through all the characters in the target text region to obtain a first character recognition result set and a second character recognition result set;
[0025] a first determination submodule, configured to:
[0026] use the first character matching result set, the second character matching result set, and the position information corresponding to each character as an identification result corresponding to the target text region;
[0027] iterate through all the text regions to obtain identification results corresponding to all the text regions;
[0028] The recognition results of all the text areas are taken as the recognition results of the denoised historical approval process diagram.
[0029] Preferably, the denoising sub-module comprises:
[0030] The first screening unit is configured to:
[0031] Any historical approval process diagram is subjected to grayscale processing to obtain a grayscale image;
[0032] The grayscale values of the pixel points in the grayscale image are obtained;
[0033] The clarity value corresponding to the grayscale image is determined based on a preset algorithm according to the grayscale values of the pixel points in the grayscale image;
[0034] The clarity value is compared with a preset clarity threshold value, and when it is determined that the clarity value is less than the preset clarity threshold value, the grayscale image is taken as a to-be-processed image;
[0035] The second screening unit is configured to:
[0036] The grayscale mean value in the to-be-processed image is calculated;
[0037] The grayscale values of the pixel points in the to-be-processed image are compared with the grayscale mean value;
[0038] The pixel points whose grayscale values are greater than or equal to the grayscale mean value are taken as to-be-denoised pixel points;
[0039] All the pixel points in the to-be-processed image are traversed to obtain a plurality of to-be-denoised pixel points;
[0040] The third screening unit is configured to screen the plurality of to-be-denoised pixel points to obtain a plurality of target to-be-denoised pixel points;
[0041] The denoising unit is configured to:
[0042] The plurality of target to-be-denoised pixel points are denoised based on a preset filter to obtain a denoised historical approval process diagram;
[0043] All the historical approval process diagrams are traversed to obtain all the denoised historical approval process diagrams.
[0044] Preferably, the preset algorithm comprises:
[0045]
[0046] wherein F represents the clarity value of the grayscale image; L i represents the grayscale value corresponding to the i-th pixel point in the grayscale image; represents the average gray value of the pixel points in the gray image; n represents the total number of the pixel points in the gray image; L max represents the maximum gray value of the pixel points in the gray image; L min represents the minimum gray value of the pixel points in the gray image.
[0047] Preferably, the third screening unit comprises:
[0048] The screening subunit is configured to:
[0049] Any to-be-noise-reduced pixel point is taken;
[0050] A target region of MxN size is determined with the to-be-noise-reduced pixel point as the center;
[0051] The noise intensity value in the target region is calculated as the first noise intensity value corresponding to the to-be-noise-reduced pixel point;
[0052] The number of all to-be-noise-reduced pixel points in the target region is obtained;
[0053] The ratio of the number of all to-be-noise-reduced pixel points in the target region to the total number of pixel points in the target region is taken as the second noise intensity value corresponding to the to-be-noise-reduced pixel point;
[0054] A preset weight value is obtained;
[0055] The noise intensity value corresponding to the to-be-noise-reduced pixel point is determined based on the first noise intensity value, the second noise intensity value and the preset weight value;
[0056] The determining subunit is configured to:
[0057] The noise intensity value is compared with a preset noise intensity threshold value, and when it is determined that the noise intensity value is greater than or equal to the preset noise intensity threshold value, the to-be-noise-reduced pixel point is taken as a target to-be-noise-reduced pixel point;
[0058] All to-be-noise-reduced pixel points are traversed to obtain a plurality of target to-be-noise-reduced pixel points.
[0059] Preferably, the flowchart analysis module comprises:
[0060] The input sub-module is configured to input the recognition result into the BiLSTM+CRF model for analysis to obtain an analysis result;
[0061] The second determining sub-module is configured to take the analysis result as the approval process information.
[0062] Preferably, the BiLSTM+CRF model comprises:
[0063] The input layer is configured to receive the recognition result data and take the recognition result data as input data;
[0064] An embedding layer is configured to perform embedding processing on the input data to obtain embedded data.
[0065] A bidirectional long short-term memory network layer is configured to process the embedded data to generate emission scores.
[0066] A linear layer is configured to perform linear transformation on the emission scores.
[0067] A conditional random field layer is configured to process the linearly transformed emission scores to obtain a prediction result.
[0068] A decoding layer is configured to decode the prediction result to obtain an analysis result.
[0069] Preferably, the training method of the approval process generation model comprises the following steps:
[0070] An approval process training set is obtained.
[0071] The neural network model is iteratively trained based on the approval process training set to obtain an initial approval process generation model.
[0072] An approval process test data set is obtained.
[0073] The initial approval process generation model is tested based on the approval process test data set to obtain a test result of the initial approval process generation model.
[0074] The test result of the initial approval process generation model is compared with a manually drawn approval process diagram to determine the accuracy of the test result.
[0075] When the accuracy is greater than or equal to a preset accuracy threshold, it is determined that the test result is qualified, and a trained approval process generation model is obtained.
[0076] Preferably, the configuration module comprises the following:
[0077] A visual display submodule is configured to visually display the first approval process diagram.
[0078] An obtaining submodule is configured to obtain approval process configuration requirement information.
[0079] A configuration submodule is configured to configure the visually displayed first approval process diagram based on the approval process configuration requirement information to obtain a second approval process diagram.
[0080] To achieve the above-mentioned purposes, a second aspect embodiment of the present application provides a method for automatically drawing an approval process based on OCR, comprising the following steps:
[0081] An historical approval process diagram is recognized based on OCR technology to obtain a recognition result.
[0082] The recognition result is analyzed to obtain the approval process information;
[0083] The approval process information is input into a pre-trained approval process generation model to generate a first approval process graph;
[0084] Obtain approval process configuration requirement information, and configure the first approval process graph based on the approval process configuration requirement information to obtain a second approval process graph.
[0085] The present application provides a system and method for automatically drawing an approval process based on OCR. By recognizing historical process graphs through OCR, the existing historical approval process resources can be fully utilized to quickly obtain the basic information of the historical approval process. By inputting the approval process information into a pre-trained approval process generation model, a first approval process graph can be generated efficiently. By obtaining the approval process configuration requirement information and configuring the first approval process graph based on the approval process configuration requirement information, the approval process can be flexibly adjusted and customized according to specific requirements, better meeting the requirements of different scenarios and users, improving the automation of the approval process drawing, and reducing the workload and possible errors of manual drawing.
[0086] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the present application. The objects and other advantages of the present application can be achieved and obtained by the structure particularly pointed out in the written description and the accompanying drawings.
[0087] The technical solutions of the present application will be further described in detail below with the help of the accompanying drawings and examples. BRIEF DESCRIPTION OF DRAWINGS
[0088] The accompanying drawings are used to provide a further understanding of the present application, and constitute a part of the specification, together with the embodiments of the present application, to explain the present application, and do not constitute a limitation on the present application. In the 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 application;
[0090] Figure 2 is a block diagram of an OCR recognition module according to an embodiment of the present application;
[0091] Figure 3 is a schematic diagram of a BiLSTM+CRF model according to an embodiment of the present application;
[0092] Figure 4 is a flowchart of a method for automatically drawing an approval process based on OCR according to an embodiment of the present application. DETAILED DESCRIPTION
[0093] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings, in which it is understood that the preferred embodiments described below are merely intended to illustrate and explain the present application, and are not intended to limit the present application.
[0094] Embodiment 1
[0095] As shown in the figure, a system for automatically drawing an approval process based on OCR includes: Figure 1
[0096] An OCR recognition module is configured to recognize a historical approval process diagram based on an OCR technology to obtain a recognition result.
[0097] A process diagram analysis module is configured to analyze the recognition result to obtain approval process information.
[0098] A process diagram generation module is configured to input the approval process information into a pre-trained approval process generation model to generate a first approval process diagram.
[0099] A configuration module is configured to obtain approval process configuration requirement information, and configure the first approval process diagram based on the approval process configuration requirement information to obtain a second approval process diagram.
[0100] In this embodiment, OCR, i.e., optical character recognition, refers to a technology for scanning and recognizing characters by optical equipment and converting 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, and conditions of the approval process.
[0103] In this embodiment, the approval process configuration requirement information includes approval personnel, approval authority, and approval time limit.
[0104] In this embodiment, the first approval process diagram is a new approval process diagram generated by a pre-trained approval process generation model based on the approval process information recognized and analyzed from the historical approval process diagram, which is an update of the historical approval process diagram; the update includes the form, framework, and basic information of the historical approval process diagram, and the removal of incorrect basic information.
[0105] In this embodiment, the second approval process diagram is a second approval process diagram obtained after the first approval process diagram is configured, such as being reconfigured with approval personnel, approval authority, and approval time limit, i.e., a target approval process diagram.
[0106] The beneficial effects of the above technical solutions are: by recognizing the historical flowchart through OCR, the existing historical approval process resources can be fully utilized, the basic information of the historical approval process can be quickly obtained, by inputting the approval process information into the pre-trained approval process generation model, the first approval flowchart can be generated, the preliminary approval flowchart can be efficiently generated, the approval process configuration requirement information can be obtained, the first approval flowchart is configured based on the approval process configuration requirement information, the approval flowchart can be flexibly adjusted and customized according to specific requirements, the requirements of different scenes and users can be better met, the automation degree of the approval process drawing is improved, and the workload and possible errors of manual drawing are reduced.
[0107] Embodiment 2
[0108] As shown in Figure 2 The OCR recognition module comprises:
[0109] The noise reduction sub-module is configured to perform noise reduction on the historical approval flowchart to obtain an enhanced historical approval flowchart.
[0110] The OCR recognition sub-module is configured to:
[0111] perform text detection on the noise-reduced historical approval flowchart based on the OCR technology to obtain a plurality of text regions corresponding to the noise-reduced historical approval flowchart.
[0112] Any one of the text regions is taken as a target text region.
[0113] The target text region is subjected to text mask information extraction to obtain a character mask corresponding to the target text region and determine position information corresponding to each character in the target text region.
[0114] The character mask is subjected to feature extraction and mapping to a multi-dimensional vector space to obtain a character vector corresponding to each character.
[0115] Any one of the characters is taken as a target character, and the character vector corresponding to the target character is taken as a target character vector.
[0116] The similarity between the target character vector and the character vectors other than the target character vector is calculated to obtain a plurality of similarities.
[0117] The sum of the plurality of similarities is taken as a target similarity corresponding to the target character.
[0118] The target similarity is compared with a preset similarity threshold.
[0119] If the target similarity is greater than or equal to the 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 the preset similarity threshold, the target character is identified with the second preset character database to determine a second character recognition result;
[0121] All characters in the target text region are traversed to obtain the first character recognition result set and the second character recognition result set;
[0122] The first determination sub-module is configured to:
[0123] The first character matching result set, the second character matching result set, and the position information corresponding to each character are taken as the recognition result corresponding to the target text region;
[0124] All text regions are traversed to obtain the recognition result corresponding to all text regions;
[0125] The recognition result corresponding to all text regions is taken as the recognition result of the denoised historical approval process diagram.
[0126] In this embodiment, the target text region is subjected to text mask information extraction, and the extraction methods include pixel-based extraction: determining the text mask information according to the characteristics of the pixels of the target text region, such as color, brightness, and the like; edge detection extraction: finding the boundary of the text region by an edge detection algorithm to extract the mask information; morphological operation extraction: using morphological opening operation, closing operation, and the like to extract; feature point extraction: extracting representative feature points in the text region to construct the mask information; deep learning algorithm extraction: using a specially trained neural network model to automatically extract the text mask information.
[0127] In this embodiment, the position information corresponding to each character in the target text region includes the position coordinates of the character in the horizontal direction and the vertical direction.
[0128] In this embodiment, the character mask is subjected to feature extraction, and the extraction methods include but are not limited to shape feature extraction, such as the contour, aspect ratio, and the like of the character; texture feature extraction, analyzing the texture characteristics of the character region; statistical feature extraction, such as the mean gray value, variance, and the like of the character region; structural feature extraction, focusing on the stroke structure and the like of the character; local feature extraction, extracting specific patterns or feature points of the local character; deep learning-based feature extraction, 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 easily recognizable characters and easily recognizable error characters.
[0130] In this embodiment, the characters contained in the first preset character database have a similarity greater than or equal to the preset similarity threshold, and are used to accurately recognize the characters prone to recognition errors.
[0131] In this embodiment, the characters contained in the second preset character database have a similarity less than a preset similarity threshold, and are used for accurate recognition of easily recognizable characters.
[0132] The beneficial effects of the above technical solution are: the noise reduction sub-module improves the quality of the historical approval process diagram, laying a foundation for subsequent accurate recognition; the OCR technology is used for text detection, which can accurately obtain the text region; the character mask is processed in detail and features are extracted, which helps to more accurately understand and recognize characters; by calculating the similarity and recognizing according to different situations and different databases, the accuracy and adaptability of character recognition are improved; the text region and characters are comprehensively traversed, ensuring complete recognition of the entire historical approval process diagram; the final recognition result integrates the character matching result and position information, providing more comprehensive and valuable information, facilitating subsequent analysis and application of the approval process diagram.
[0133] Embodiment 3
[0134] The noise reduction sub-module comprises:
[0135] The first screening unit is configured to:
[0136] Take any historical approval process diagram, perform grayscale processing on the historical approval process diagram to obtain a grayscale image;
[0137] Obtain the grayscale values of each pixel point in the grayscale image;
[0138] Determine the sharpness value corresponding to the grayscale image based on a preset algorithm according to the grayscale values of each pixel point in the grayscale image;
[0139] Compare the sharpness value with a preset sharpness threshold, and when it is determined that the sharpness value is less than the preset sharpness threshold, the grayscale image is taken as a to-be-processed image;
[0140] The second screening unit is configured to:
[0141] Calculate the average grayscale value in the to-be-processed image;
[0142] Compare the grayscale values of each pixel point in the to-be-processed image with the average grayscale value;
[0143] Take the pixel points whose grayscale values are greater than or equal to the average grayscale value as to-be-noise-reduced pixel points;
[0144] Traverse all pixel points in the to-be-processed image to obtain a plurality of to-be-noise-reduced pixel points;
[0145] The third screening unit is configured to screen the plurality of to-be-noise-reduced pixel points to obtain a plurality of target to-be-noise-reduced pixel points;
[0146] The noise reduction unit is configured to:
[0147] The preset filter is used to reduce noise of the target pixels to be reduced, to obtain a history approval process diagram after noise reduction.
[0148] All the history approval process diagrams after noise reduction are obtained.
[0149] The working principle of the above technical solution is as follows: first, the first screening unit is used to judge the overall clarity of the history approval process diagram, to determine whether the clarity meets the requirements; if the clarity is relatively low, the second screening unit is used to screen the history approval process diagram with relatively low clarity for pixels to be reduced, which is a preliminary screening, and the preliminary screening range is relatively wide to avoid omissions; after obtaining a plurality of pixels to be reduced, the third screening unit is used to screen the plurality of pixels to be reduced, to obtain a plurality of target pixels to be reduced, which is an accurate screening, and the target pixels to be reduced obtained through the three screenings are more accurate. In the prior art, the image is usually segmented, and the possibility of each pixel point in the segmented image being a noise point is calculated, which increases the calculation amount and is relatively low in efficiency. In the present embodiment, only the pixels to be reduced screened are accurately calculated, which greatly reduces the calculation amount and improves the efficiency of noise reduction.
[0150] The above technical solution has the following beneficial effects: the history approval process diagram is subjected to gray scale processing and clarity judgment, which can effectively screen the image that needs to be subjected to noise reduction processing, and improves the pertinence and efficiency of noise reduction; the gray scale mean value is calculated and used as a standard to screen the pixels to be reduced, so that the noise reduction target is more accurate and unnecessary pixels are avoided from being excessively processed; the screened pixels to be reduced are further screened, to ensure the accuracy and effectiveness of the noise reduction operation; the preset filter is used for noise reduction processing, which can better remove noise and improve the quality and readability of the history approval process diagram; all the history approval process diagrams are subjected to traversal processing, to ensure the consistency of the overall data noise reduction effect.
[0151] Embodiment 4
[0152] The preset algorithm comprises:
[0153]
[0154] wherein F represents the clarity value of the gray scale image; L i represents the gray scale value corresponding to the i-th pixel point in the gray scale image; represents the gray scale mean value of the pixel points in the gray scale image; n represents the total number of the pixel points in the gray scale image; L max represents the maximum gray scale value of the pixel points in the gray scale image; L minThe minimum gray value of a pixel point in a gray image.
[0155] The technical scheme has the beneficial effects that: by comprehensively considering the difference between the gray value of each pixel point and the mean value and the maximum and minimum gray values, the clarity of the image is comprehensively reflected; and the image can be accurately determined whether to be subjected to noise reduction processing, and the accuracy and pertinence of subsequent processing are improved.
[0156] Embodiment 5
[0157] The third screening unit comprises:
[0158] The screening subunit is configured to:
[0159] Any one of the to-be-noise-reduced pixel points is taken;
[0160] A target region of MxN size is determined with the to-be-noise-reduced pixel point as the center;
[0161] The noise intensity value in the target region is calculated as the first noise intensity value corresponding to the to-be-noise-reduced pixel point;
[0162] The number of all to-be-noise-reduced pixel points in the target region is obtained;
[0163] The ratio of the number of all to-be-noise-reduced pixel points in the target region to the total number of pixel points in the target region is taken as the second noise intensity value corresponding to the to-be-noise-reduced pixel point;
[0164] A preset weight value is obtained;
[0165] The noise intensity value corresponding to the to-be-noise-reduced pixel point is determined based on the first noise intensity value, the second noise intensity value, and the preset weight value;
[0166] The determining subunit is configured to:
[0167] The noise intensity value is compared with a preset noise intensity threshold value, and when it is determined that the noise intensity value is greater than or equal to the preset noise intensity threshold value, the to-be-noise-reduced pixel point is taken as a target to-be-noise-reduced pixel point;
[0168] All to-be-noise-reduced pixel points are traversed to obtain a plurality of target to-be-noise-reduced pixel points.
[0169] In this embodiment, the noise intensity value in the target region is calculated, and the specific calculation method is as follows:
[0170]
[0171] Wherein, T represents the noise intensity value in the target region; X n represents the gray value of the nth pixel point in the target region; represents the gray mean value of the pixel points in the target region; and n represents the total number of pixel points in the target region.
[0172] In this embodiment, the ratio of the number of all to-be-de-noised pixel points in the target region to the total number of pixel points in the target region is taken as the second noise intensity value corresponding to the to-be-de-noised pixel point. For example, assuming that the to-be-de-noised pixel point is A, in the 3*3 target region centered on the to-be-de-noised pixel point A, there are other to-be-de-noised pixel points B and C, and the second noise intensity value is wherein 3 is the to-be-de-noised pixel point A, B and C; and 9 represents the total number of pixel points in the target region.
[0173] In this embodiment, the preset weight value is set in advance based on industry experience, and α+β=1, wherein α 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, α takes a value of 0.5, and β takes a value of 0.5.
[0174] The beneficial effects of the above technical solution are: by determining the target region and calculating multiple noise intensity values, the noise condition of the to-be-de-noised pixel point can be more comprehensively and accurately evaluated, and the accuracy of screening is improved; the final noise intensity is determined in combination with different types of noise intensity values and preset weight values, making the evaluation more reasonable and scientific; the target to-be-de-noised pixel point is determined according to comparison with the preset noise intensity threshold, ensuring that the screened pixel point is indeed the pixel point that needs to be processed, and improving the pertinence and effect of de-noising; all to-be-de-noised pixel points are traversed, ensuring the comprehensiveness and systematicness of screening, and avoiding omission of important to-be-de-noised pixel points.
[0175] Embodiment 6
[0176] The flowchart analysis module comprises:
[0177] The input sub-module is configured to input the recognition result into the BiLSTM+CRF model for analysis to obtain an analysis result.
[0178] The second determination sub-module is configured to take the analysis result as the approval process information.
[0179] The beneficial effects of the above technical solution are: the BiLSTM+CRF model is used for analysis, improving the accuracy and reliability of the analysis; the recognition result can be efficiently converted into the approval process information, which helps to improve the automation degree of the work process; accurate basic data is provided for subsequent approval work, reducing errors and tediousness of manual processing; the entire process is more intelligent and efficient, saving time and labor costs.
[0180] Embodiment 7
[0181] As shown in the BiLSTM+CRF model, Figure 3 comprises:
[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, Figure 3 As shown: Input Layer: Input layer, receives input data x0,x1,...,x n .
[0189] Embedding Layer: Embedding layer, embeds the input data to obtain e0, e1, ..., e n .
[0190] BiLSTM Layer: This layer processes the embedded data and generates emission scores. The diagram shows multiple BiLSTM modules, each processing different data types.
[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: 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 between layers are shown in the table, for example, the value of B-Person in the emission score layer is 2.09, the value of I-Person is 0.26, etc.
[0197] The above technical solution has the advantages that BiLSTM can effectively process the sequence information before and after, and combining CRF can further improve the modeling and prediction ability of the sequence; preprocessing the data through the embedding layer and the synergistic effect of each layer can help improve the accuracy of the final analysis result; it can adapt to different types and lengths of recognition result data, and has good universality 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 better understand the semantics and structure of the input data, thereby obtaining more accurate analysis.
[0198] Embodiment 8
[0199] The training method of the approval process generation model comprises:
[0200] Obtain an approval process training set;
[0201] Iteratively train a neural network model based on the approval process training set to obtain an initial approval process generation model;
[0202] Obtain an approval process test data set;
[0203] Test the initial approval process generation model based on the approval process test data set to obtain a test result of the initial approval process generation model;
[0204] Compare the test result of the initial approval process generation model with the manually drawn approval process diagram to determine the accuracy of the test result;
[0205] When the accuracy is greater than or equal to a preset accuracy threshold, it is determined that the test result is qualified, and a trained approval process generation model is obtained.
[0206] In this embodiment, the neural network model can identify the features of the basic information, key nodes, paths and conditions in the approval process graph by learning a large number of approval process graphs in the training set of the approval process; the features of the basic information, key nodes, paths and conditions in the approval process graph are matched with a preset approval process information feature database, an approval process template corresponding to the approval process information is determined based on a matching result, an approval process information knowledge graph is queried based on the basic information in the approval process graph, the approval process information is verified, and incorrect information in the approval process information is eliminated, and the verified approval process information is obtained when the verification result is qualified; and a first approval process graph is generated based on the approval process information and the approval process template.
[0207] The above technical solution has the beneficial effects that: iterative training is performed on a large number of training sets, and a test data set is verified and compared with a manually drawn graph, the model is continuously optimized, and it is ensured that the generated approval process has high accuracy; strict testing and accuracy requirements ensure that the final obtained approval process generation model is reliable and can stably play a role in actual application; the generation of the approval process can be automatically completed by the model, the dependence on manual drawing is reduced, and work efficiency is improved.
[0208] Embodiment 9
[0209] The configuration module comprises:
[0210] The visual display submodule is configured to visually display the first approval process graph.
[0211] The acquisition submodule is configured to acquire approval process configuration requirement information.
[0212] The configuration submodule is configured to configure the visually displayed first approval process graph based on the approval process configuration requirement information, and obtain a second approval process graph.
[0213] The above technical solution has the beneficial effects that: the visual display facilitates users to intuitively view the approval process graph, improves the interactivity, and meets individualized requirements by targeted configuration according to the acquired specific requirement information; the configuration of the approval process graph is quickly completed, time and effort are saved, and the approval process graph can be flexibly adapted to different scenarios and changes in business requirements.
[0214] The second aspect of the present application aims to provide a method for automatically drawing an approval process based on OCR, comprising steps S1-S4:
[0215] S1: identifying a historical approval process graph based on an OCR technology to obtain an identification result;
[0216] S2: analyzing the identification result 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: obtain approval process configuration requirement information, and configure the first approval process diagram based on the approval process configuration requirement information to obtain a second approval process diagram.
[0219] The beneficial effects of the above technical solutions are: by recognizing the historical process diagram through OCR, the existing historical approval process resources can be fully utilized to quickly obtain the basic information of the historical approval process; by inputting the approval process information into a pre-trained approval process generation model to generate a first approval process diagram, a preliminary approval process diagram can be efficiently generated; by obtaining approval process configuration requirement information and configuring the first approval process diagram based on the approval process configuration requirement information, the approval process diagram can be flexibly adjusted and customized according to specific requirements, better meeting the requirements of different scenarios and users, improving the automation degree of the approval process drawing, and reducing the workload and possible errors of manual drawing.
[0220] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application belong to the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.
Claims
1. A system for automatically drawing an approval process based on OCR, characterized in that, The method comprises the following steps: An OCR recognition module is used to recognize historical approval process diagrams based on OCR technology to obtain recognition results; A process diagram analysis module is used to input the recognition results into a BiLSTM+CRF model for analysis to obtain approval process information; The approval process information comprises basic information, key nodes, paths and condition information of the approval process; A process diagram generation module is used to input the approval process information into a pre-trained approval process generation model to generate a first approval process diagram; A 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 a second approval process diagram; The approval process configuration requirement information comprises approval personnel, approval authority and approval time limit information; A training method of the approval process generation model comprises the following steps: Obtain an approval process training set; Iteratively train a neural network model based on the approval process training set to obtain an initial approval process generation model; Obtain an approval process test data set; Test the initial approval process generation model based on the approval process test data set to obtain a test result of the initial approval process generation model; Compare the test result of the initial approval process generation model with a manually drawn approval process diagram to determine the accuracy of the test result; When the accuracy is greater than or equal to a preset accuracy threshold, it is determined that the test result is qualified, and a trained approval process generation model is obtained.
2. The system for automatically drawing an approval flow based on OCR according to claim 1, wherein, The OCR recognition module comprises: A noise reduction sub-module is used to reduce noise of the historical approval process diagram to obtain an enhanced historical approval process diagram; The OCR recognition sub-module is used to: Detect text in the noise-reduced historical approval process diagram based on the OCR technology to obtain a plurality of text regions corresponding to the noise-reduced historical approval process diagram; Randomly select one text region as a target text region; Extract text mask information from the target text region to obtain a character mask corresponding to the target text region and determine position information of each character in the target text region; Extract features from the character mask and map them to a multi-dimensional vector space to obtain a character vector corresponding to each character; Randomly select one character as a target character, and the character vector corresponding to the target character as a target character vector; Calculate the similarity between the target character vector and other character vectors except the target character vector to obtain a plurality of similarities; Sum the plurality of similarities to obtain a 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 the preset similarity threshold, identify the target character with a first preset character database to obtain a first character recognition result; If the target similarity is less than the preset similarity threshold, identify the target character with a second preset character database to obtain a second character recognition result; Iterate through all characters in the target text region to obtain a first character recognition result set and a second character recognition result set; A first determination sub-module is used to: Take the first character matching result set, the second character matching result set and the position information of each character as the recognition result corresponding to the target text region. Traverse all text areas to obtain recognition results corresponding to all text areas; Take the recognition results corresponding to all text areas as the recognition results of the denoised historical approval process diagram.
3. The system for automatically drawing an approval flow based on OCR according to claim 2, wherein, The denoising sub-module comprises: The first screening unit is configured to: Take any historical approval process diagram, perform grayscale processing on the historical approval process diagram to obtain a grayscale image; Obtain the grayscale values of each pixel point in the grayscale image; Determine the sharpness value corresponding to the grayscale image based on the preset algorithm according to the grayscale values of each pixel point in the grayscale image; Compare the sharpness value with a preset sharpness threshold value, and determine the grayscale image as a to-be-processed image when the sharpness value is less than the preset sharpness threshold value; The second screening unit is configured to: Calculate the average grayscale value in the to-be-processed image; Compare the grayscale values of each pixel point in the to-be-processed image with the average grayscale value; Take the pixel points with the grayscale values greater than or equal to the average grayscale value as to-be-denoised pixel points; Traverse all pixel points in the to-be-processed image to obtain a plurality of to-be-denoised pixel points; The third screening unit is configured to screen the plurality of to-be-denoised pixel points to obtain a plurality of target to-be-denoised pixel points; The denoising unit is configured to: Denoise the plurality of target to-be-denoised pixel points based on a preset filter to obtain a denoised historical approval process diagram; Traverse all historical approval process diagrams to obtain all denoised historical approval process diagrams.
4. The system for automatically drawing an approval flow based on OCR according to claim 3, wherein, The preset algorithm comprises: wherein, represents a definition value of the gray-scale image; represents a gray-scale value corresponding to the i-th pixel point in the gray-scale image; represents a gray-scale value corresponding to the i-th pixel point in the gray-scale image; represents a mean value of the gray-scale of the pixel points in the gray-scale image; represents a total number of the pixel points in the gray-scale image; represents a maximum gray-scale value of the pixel points in the gray-scale image; represents a minimum gray-scale value of the pixel points in the gray-scale image.
5. The system for automatically drawing an approval flow based on OCR according to claim 3, wherein, The third screening unit comprises: The screening subunit is configured to: Take any to-be-denoised pixel point; Determine a target region centered on the to-be-denoised pixel point; Calculate the noise intensity value in the target region as the first noise intensity value corresponding to the to-be-denoised pixel point; Obtain the number of all to-be-denoised pixel points in the target region; Take the ratio of the number of all to-be-denoised pixel points in the target region to the total number of pixel points in the target region as the second noise intensity value corresponding to the to-be-denoised pixel point; Obtain a preset weight value; Determine the noise intensity value corresponding to the to-be-denoised pixel point based on the first noise intensity value, the second noise intensity value, and the preset weight value; The determination subunit is configured to: Compare the noise intensity value with a preset noise intensity threshold value, and determine the to-be-denoised pixel point as a target to-be-denoised pixel point when the noise intensity value is greater than or equal to the preset noise intensity threshold value; Traverse all to-be-denoised pixel points to obtain a plurality of target to-be-denoised pixel points.
6. The system for automatically drawing an approval flow based on OCR of claim 1, wherein, The BiLSTM+CRF model comprises: The input layer is configured to receive the recognition result data and take the recognition result data as input data; The embedding layer is configured to perform embedding processing on the input data to obtain embedded data; The bidirectional long short-term memory network layer is configured to process the embedded data to generate emission scores; The linear layer is configured to perform linear transformation on the emission scores; The conditional random field layer is configured to process the linearly transformed emission scores to obtain prediction results; The decoding layer is configured to decode the prediction results to obtain analysis results.
7. The system for automatically drawing an approval flow based on OCR of claim 1, wherein, The configuration module comprises: The visual display sub-module is configured to visually display the first approval process diagram; The obtaining sub-module is configured to obtain approval process configuration requirement information; The configuration submodule is configured to configure the first approval process diagram based on approval process configuration requirement information to obtain a second approval process diagram.
8. A method for automatically drawing an approval process based on OCR, characterized in that, Comprise: Based on the OCR technology to identify the historical approval process diagram, get the recognition result; For inputting the recognition result into the BiLSTM+CRF model for analysis, obtaining the approval process information; The approval process information includes the basic information, key nodes, paths and condition information of the approval process; The approval process information is input into the pre-trained approval process generation model to generate a first approval process diagram; Obtain the 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; The approval process configuration requirement information includes approval personnel, approval authority and approval time limit information; The training method of the approval process generation model comprises: Obtain the approval process training set; Based on the approval process training set, the neural network model is iteratively trained to obtain an initial approval process generation model; Obtain the approval process test data set; Based on the approval process test data set, the initial approval process generation model is tested to obtain the test result of the initial approval process generation model; Compare the test result of the initial approval process generation model with the manually drawn approval process diagram to determine the accuracy of the test result; When it is determined that the accuracy is greater than or equal to a preset accuracy threshold, it is determined that the test result is qualified, and a trained approval process generation model is obtained.
Citation Information
Patent Citations
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