Document compliance detection model training method and device, equipment and medium
By training the document detection model, the initial detection model is used to extract text entities and data items for compliance inspection of financial business documents, solving the problem of time-consuming and error-prone traditional manual inspections, and achieving efficient and accurate automated detection.
Patent Information
- Application Number
- CN202510158739.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-06-03
AI Technical Summary
Traditional manual inspection methods are time-consuming and error-prone in compliance inspections of financial business documents, especially in the face of growing data volumes and changing regulatory regulations.
By obtaining sample business documents, labeling results and rule configuration information, using the initial detection model to extract text entities and data items, and conduct compliance detection based on this information, obtaining detection results to train the document detection model.
It realizes automated business document compliance inspection, improves detection efficiency, reduces human resource investment, and avoids false alarms and missed defects in manual detection, improving the accuracy of detection.
Smart Images

Figure CN120086595A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to a method, device, equipment and medium for training a document compliance detection model. Background Art
[0002] In the field of financial business, the compliance check of documents is very important. The accuracy and integrity of financial business documents are crucial for investors to make investment decisions, so compliance checks are required.
[0003] Traditional manual inspection methods often rely on human resources to conduct compliance checks on financial business documents. Facing the increasing data volume and constantly changing regulatory requirements, this process is not only time-consuming but also error-prone. Summary of the Invention
[0004] The present invention provides a method, device, equipment and medium for training a document compliance detection model to improve the efficiency and accuracy of compliance detection of business documents.
[0005] In a first aspect, the present invention provides a method for detecting the compliance of a document, including:
[0006] Obtaining a sample business document, an annotation result of the sample business document, and set rule configuration information; the sample business document includes sample business text and sample business charts; the annotation result includes an annotated text entity, an annotated data item, and an annotation compliance result of the sample business document;
[0007] Extracting a text entity to be detected from the sample business text and identifying a data item to be detected from the sample business chart through an initial detection model;
[0008] Performing a compliance detection on the sample business document according to the text entity to be detected, the annotated text entity, the data item to be detected, the annotated data item, and the set rule configuration information to obtain a compliance detection result;
[0009] Training the initial detection model according to the compliance detection result, the annotation result, and the sample business document to obtain a document detection model.
[0010] In a second aspect, the present invention further provides a method for detecting the compliance of a document, including:
[0011] Obtaining a business document to be detected and set rule configuration information; wherein, the business document to be detected includes text and charts;
[0012] Through a document detection model, according to the set rule configuration information, perform compliance detection on the business document to be detected, and obtain the compliance detection result of the business document to be detected; wherein, the document detection model is trained by the document compliance detection model training method provided by any aspect of the embodiments of the present invention.
[0013] In a third aspect, the present invention also provides a training device for a document compliance detection model, including:
[0014] A document acquisition module, configured to acquire a sample business document, an annotation result of the sample business document, and the set rule configuration information; the sample business document includes sample business text and sample business charts; the annotation result includes an annotated text entity and an annotation compliance result of the sample business document;
[0015] A text entity extraction module, configured to extract text entities to be detected from the sample business text and identify data items to be detected from the sample business charts through an initial detection model;
[0016] A document detection module, configured to perform compliance detection on the sample business document according to the text entities to be detected, the annotated text entities, the data items to be detected, and the set rule configuration information, and obtain a compliance detection result;
[0017] A model training module, configured to train the initial detection model according to the compliance detection result, the annotation result, and the sample business document to obtain a document detection model.
[0018] In a fourth aspect, an embodiment of the present invention also provides a compliance detection device for a document, including:
[0019] A document acquisition module, configured to acquire a business document to be detected and the set rule configuration information; wherein, the business document to be detected includes text and charts;
[0020] A document detection module, configured to perform compliance detection on the business document to be detected through a document detection model according to the set rule configuration information, and obtain a compliance detection result of the business document to be detected; wherein, the document detection model is trained by the document compliance detection model training method provided by any aspect of the embodiments of the present invention.
[0021] In a fifth aspect, an embodiment of the present invention also provides an electronic device, including:
[0022] At least one processor; and
[0023] A memory communicatively connected to at least one processor; wherein
[0024] The memory stores instructions that can be executed by at least one processor. The instructions are executed by at least one processor to enable the at least one processor to execute the training method of the document compliance detection model provided in any embodiment of the present invention, or the compliance detection method of the document.
[0025] In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the training method of the document compliance detection model in any embodiment of the present invention, or the compliance detection method of the document when executed by a processor.
[0026] The technical solution of the embodiment of the present invention includes: obtaining a sample business document, an annotation result of the sample business document, and set rule configuration information; the sample business document includes sample business text and sample business charts; the annotation result includes an annotated text entity, an annotated data item, and an annotation compliance result of the sample business document; extracting a text entity to be detected from the sample business text and identifying a data item to be detected from the sample business charts through an initial detection model; performing compliance detection on the sample business document according to the text entity to be detected, the annotated text entity, the data item to be detected, the annotated data item, and the set rule configuration information to obtain a compliance detection result; training the initial detection model according to the compliance detection result, the annotation result, and the sample business document to obtain a document detection model, which can automatically perform compliance checks on business documents. Compared with the manual inspection method, the detection efficiency is improved, and the investment in human resources is reduced; it can also avoid false positives and missed detections that occur during the manual document detection process, and improve the accuracy of document detection.
[0027] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0029] Figure 1 is a flowchart of a method for training a document compliance detection model according to Embodiment 1 of the present invention;
[0030] Figure 2 is a flowchart of a method for training a document compliance detection model according to Embodiment 2 of the present invention;
[0031] Figure 3 It is a flowchart of a method for training a document compliance detection model provided in Embodiment 3 of the present invention;
[0032] Figure 4A It is a flowchart of a method for training a document compliance detection model provided in Embodiment 4 of the present invention;
[0033] Figure 4B It is a schematic diagram of a formula extraction model provided in Embodiment 4 of the present invention;
[0034] Figure 4C It is a schematic diagram of a formula extraction result provided in Embodiment 4 of the present invention;
[0035] Figure 4D It is a schematic diagram of the structure of a document detection system provided in Embodiment 4 of the present invention;
[0036] Figure 5 It is a schematic diagram of the structure of a device for training a document compliance detection model provided in Embodiment 5 of the present invention;
[0037] Figure 6 It is a schematic diagram of the structure of a document detection device provided in Embodiment 6 of the present invention;
[0038] Figure 7 It is a schematic diagram of the structure of an electronic device for implementing the method for training a document compliance detection model of the embodiments of the present invention. Detailed implementation manners
[0039] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.
[0040] It should be noted that the terms "first" and "second" in the description, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0041] In the technical solution of the embodiment of the present invention, the acquisition, storage and application of the involved sample business texts, set rule configuration information, etc. and annotation results, etc. all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0042] Embodiment 1
[0043] Figure 1 As shown in the flowchart of a method for training a document compliance detection model provided in Embodiment 1 of the present invention, this embodiment is applicable to the situation of training a document detection model. This method can be executed by a training device for a document compliance detection model. The training device for the document compliance detection model can be implemented in the form of hardware and / or software, and is specifically configured in an electronic device, such as a server.
[0044] See Figure 1 The method for training a document compliance detection model shown in the figure includes:
[0045] S101. Obtain a sample business document, an annotation result of the sample business document, and set rule configuration information; the sample business document includes a sample business text and a sample business chart; the annotation result includes an annotated text entity, an annotated data item, and an annotation compliance result of the sample business document.
[0046] In this embodiment, the sample business document can be a business document used as a sample for training a model; the business document can be, for example, a contract document, an agreement document, an annual report document, a financial report document, a credit document, an insurance document, etc. The present invention does not limit the specific type of the business document. The set rule configuration information may include, but is not limited to, regulatory regulations, rules, and terms related to the business document. The sample business text can be the text in the sample business document that records business information; the sample business chart can be images, tables, etc. in the sample business document that record business information.
[0047] The annotation result can be the result of manual annotation. The annotated text entity can be the text entity in the manually annotated sample business text; the annotated data item can be the value in the manually annotated chart. The annotation compliance result can be the true compliance result of the manually annotated sample business document; for example, if the annotation compliance result is compliant, it means that the sample business document is truly compliant; if the annotation compliance result is non-compliant, it means that the sample business document is truly non-compliant.
[0048] S102. Extract the text entities to be detected from the sample business text and identify the data items to be detected from the sample business chart through the initial detection model.
[0049] In this embodiment, the initial detection model can be an untrained model for detecting the compliance of business documents. The text entities to be detected can be the words in the text that need to be detected for compliance. The data items to be detected can be the numerical items in the chart that need to be detected for compliance.
[0050] Specifically, using a certain algorithm, through the initial detection model, extract the text entities to be detected through the initial detection model from the sample business text and identify the data items to be detected from the sample business chart.
[0051] Optionally, the initial detection model includes a text processing module and a parameter adjustment module corresponding to the text processing module; extracting the text entities to be detected from the sample business text through the initial detection model includes: through the parameter adjustment module, extracting the features of the sample business text to obtain the first feature vector corresponding to the sample business text; through the parameter adjustment module, predicting the business type of the sample business document according to the first feature vector; through the parameter adjustment module, generating a parameter adjustment function corresponding to the business type according to the business type; through the parameter adjustment module, adjusting the parameters of the text processing module according to the parameter adjustment function; through the text processing module after parameter adjustment, extracting the text entities to be detected from the sample business text according to the first feature vector.
[0052] Among them, the text processing module can be used to extract the text entities to be detected from the sample business text; the parameter adjustment module can be used to adjust the parameters of the text processing module. The first feature vector can be the result of feature extraction of the sample business text. The business type can be the type of the sample business document, which can include but is not limited to contract documents, agreement documents, annual report documents, financial report documents, credit documents, insurance documents, etc. The parameter adjustment function can be used to adjust the parameters of the text processing module.
[0053] Specifically, through the parameter adjustment module, feature extraction is performed on the sample business text to obtain the first feature vector corresponding to the sample business text; through at least one hidden layer, a hidden representation vector of the first feature vector is generated; according to the classification weight matrix, the classification bias matrix, and the hidden representation vector, the probability distribution of the sample text document belonging to each business type is calculated; the business type with the largest probability value in the probability distribution is determined as the business type of the sample business text; exemplarily, the probability distribution of the sample text document belonging to each business type can be determined by the following formula:
[0054] P(y|X w )=softmax(W·h(X w )+b);
[0055] Among them, X w represents the first feature vector; h(X w ) represents the hidden representation vector; W represents the initial classification weight matrix; b represents the initial bias matrix; y represents the business type; P(y|X w ) represents the probability distribution of the sample text document belonging to each business type.
[0056] According to the business type of the sample business text, a parameter adjustment function corresponding to the business type is generated; through the activation function and the parameter adjustment function, the initial parameters of the text processing module are adjusted to obtain the adjusted parameters, thereby obtaining the text processing module with adjusted parameters; through the text processing module with adjusted parameters, according to the first feature vector, the text entity to be detected is extracted from the sample business text; exemplarily, the parameters of the adjusted text processing module can be determined by the following formula:
[0057]
[0058] Among them, θ' represents the adjusted parameter; θ represents the parameter before adjustment; σ() represents the activation function; f(y) represents the parameter adjustment function; represents the element-wise multiplication operation.
[0059] In a specific embodiment, the pre-trained BERT (Bidirectional Encoder Representations from Transformers) model can be determined as the text processing module. Further, the number of Transformer layers in the BERT model can be 6 layers, which reduces the computational cost and memory occupancy compared with 12 layers in the prior art; the number of units in each Transformer layer can be 512, which reduces the computational overhead and the number of parameters compared with 768 in the prior art, and can optimize the model in a larger range, enabling it to perform well under different computational resources and task requirements.
[0060] It can be understood that by adopting the above technical solution, the business type of the business document can be identified, and the parameters of the text processing module can be finely tuned according to the business type, so as to improve the accuracy of extracting text entities from the business text under different business types; and in the prior art, the technical solution of manually checking the text is prone to false positives and false negatives. The technical solution of the embodiment of the present invention can improve the accuracy of the text entities to be detected extracted by performing natural language processing on the sample business text and deeply understanding the content and context of the document, and avoid business risks and compliance risks caused by non-compliant business documents.
[0061] In an alternative embodiment, the knowledge graph of the business domain can be combined with the text processing module. During the processing of the text processing module, the semantic representation of the text is enriched through the entities and relationships in the knowledge graph; a two-way information flow between the text data and the knowledge graph is realized, so that the text analysis result can be fed back to the knowledge graph to further refine and expand the knowledge base; the knowledge in the knowledge graph can be automatically updated, and the regulations and industry trends can be monitored based on the developed automated tools, and the knowledge base can be updated in a timely manner to maintain the timeliness and accuracy of the text processing module.
[0062] S103. Perform compliance detection on the sample business document according to the text entities to be detected, the annotated text entities, the data items to be detected, the annotated data items and the set rule configuration information, and obtain a compliance detection result.
[0063] In this embodiment, the compliance detection result is the result of performing compliance detection on the sample business document. Specifically, a certain algorithm is used to perform compliance detection on the sample business document according to the text entities to be detected, the annotated text entities, the data items to be detected, the annotated data items and the set rule configuration information, and obtain a compliance detection result.
[0064] S104. Train the initial detection model according to the compliance detection result, the annotation result and the sample business document to obtain a document detection model.
[0065] Specifically, a certain algorithm is used to train the initial detection model according to the compliance detection result, the annotated compliance result and the sample business document; the trained initial detection model is determined as the document detection model.
[0066] The technical solution of the embodiment of the present invention includes obtaining a sample business document, the annotation result of the sample business document, and the set rule configuration information; the sample business document includes sample business text and sample business charts; the annotation result includes annotated text entities, annotated data items, and the annotation compliance result of the sample business document; through an initial detection model, to extract text entities to be detected from the sample business text, and to identify data items to be detected from the sample business charts; according to the text entities to be detected, the annotated text entities, the data items to be detected, the annotated data items, and the set rule configuration information, perform compliance detection on the sample business document to obtain a compliance detection result; according to the compliance detection result, the annotation result, and the sample business document, train the initial detection model to obtain a document detection model, which can automatically perform compliance checks on business documents, improving the detection efficiency and reducing the input of human resources compared with the manual inspection method; it can also avoid false positives and missed defect reports that occur during the manual document detection process, improving the accuracy of document detection.
[0067] Embodiment 2
[0068] Figure 2 It is a flowchart of a method for training a document compliance detection model provided by Embodiment 2 of the present invention. Based on the technical solution of the above embodiment, the present invention optimizes and improves the recognition operation of data items to be detected.
[0069] Further, "identifying data items to be detected from the sample business charts through the initial detection model" is refined to "extracting features from the sample business charts through a residual connection module to obtain a second feature vector corresponding to the sample business charts; adjusting the residual path weights of the residual blocks in the residual connection module according to the second feature vector through the residual connection module; generating a first residual connection result of the sample business charts through a residual block according to the second feature vector; determining a second residual connection result of the sample business charts according to the adjusted residual path weights of the residual blocks, the first residual connection result, and the second feature vector through the residual connection module; identifying data items to be detected from the sample business charts according to the second residual connection result through a chart processing module", so as to improve the recognition operation of data items to be detected.
[0070] It should be noted that for the parts not detailed in the embodiments of the present invention, reference may be made to the descriptions of the foregoing embodiments.
[0071] See Figure 2 The method for training a document compliance detection model shown, includes:
[0072] S201. Obtain a sample business document, the annotation result of the sample business document, and the set rule configuration information; the sample business document includes a sample business text and a sample business chart; the annotation result includes an annotated text entity, an annotated data item, and the annotation compliance result of the sample business document.
[0073] S202. Extract the text entity to be detected from the sample business text through the initial detection model.
[0074] S203. Extract features from the sample business chart through the residual connection module in the initial detection model to obtain the second feature vector corresponding to the sample business chart.
[0075] In this embodiment, the initial detection model includes a residual connection module and a chart processing module; the residual connection module can be used to perform residual connection processing on the second feature vector of the sample business chart; the chart processing module can be used to identify the data item to be detected from the sample business chart. The second feature vector can be the result of feature extraction from the sample business chart.
[0076] S204. Through the residual connection module, according to the second feature vector, adjust the residual path weight of the residual block in the residual connection module.
[0077] Specifically, using a certain algorithm, according to the second feature vector, generate the residual path weight corresponding to the second feature vector, and update the residual path weight of the residual block to the residual path weight corresponding to the first feature vector.
[0078] S205. Through the residual block, according to the second feature vector, generate the first residual connection result of the sample business chart.
[0079] In this embodiment, the first residual connection result can be the output result of the residual block. Specifically, through the residual block, perform a residual link on the second feature vector to obtain the first residual connection result of the sample business chart.
[0080] S206. Through the residual connection module, according to the adjusted residual path weight of the residual block, the first residual connection result, and the second feature vector, determine the second residual connection result of the sample business chart.
[0081] In this embodiment, the second residual connection result can be the output result of the residual connection module. Specifically, according to the adjusted residual path weight of the residual block, adjust the first residual connection result; according to the adjusted first residual connection result and the second feature vector, determine the second residual connection result; through the chart processing module, according to the second residual connection result, identify the data item to be detected from the sample business chart. Exemplarily, the second residual connection result can be determined by the following formula:
[0082] Y = Xu +α·F(X u );
[0083] Among them, Y represents the second residual connection result; X u represents the second feature vector; α represents the residual path weight; F(X u ) represents the first residual connection result.
[0084] S207. Through the chart processing module, identify the data items to be detected from the sample business charts according to the second residual connection result.
[0085] Specifically, the second residual connection result may include the second residual connection results of the sample business charts at multiple scales. That is, through the residual connection module in the initial detection model, feature extraction is performed on the sample business charts to obtain the second feature vector corresponding to the sample business charts. It may be through the feature pyramid layer in the residual connection module to perform multi-scale feature extraction on the sample business charts to obtain the second feature vector corresponding to the sample business charts at each scale. Then, through the residual block, according to the second feature vector at each scale, the first residual connection result at each scale is generated respectively; according to the residual path weight of the adjusted residual block, the first residual connection result at each scale, and the second feature vector at each scale, the second residual connection result of the sample business charts at each scale is determined respectively; through the convolutional layer and the pooling layer, the second residual connection results at each scale are fused to obtain a fusion result; through the obtained fusion result, the data items to be detected are identified from the sample business charts, so as to be able to identify the fine features at small scales and the global features at large scales in the charts.
[0086] In a specific embodiment, the chart processing module may adopt a ResNet network (residual neural network). The chart processing module may also include a chart area attention module. The chart area attention module can be used to automatically identify and focus on the areas in the chart that contain important information, such as the data part of the chart or specific graphic marks; perform weighted pooling on the focused areas. When performing feature pooling, the pooling operation is weighted according to the attention weights, so that the chart processing module gives priority to these areas when performing feature extraction. In the charts of business documents, only certain areas may contain the key information that needs to be subject to compliance detection. Through the chart area attention module, the feature discrimination ability can be enhanced, and the generalization ability of the model can be improved, so as to accurately focus on these key areas containing the data volume to be detected when identifying the data items to be detected, and improve the processing efficiency and recognition accuracy.
[0087] S208. Perform compliance detection on the sample business document according to the text entities to be detected, the annotated text entities, the data items to be detected, the annotated data items, and the set rule configuration information, and obtain the compliance detection result.
[0088] S209. Train the initial detection model based on the compliance detection results, annotation results, and sample business documents to obtain a document detection model.
[0089] In the embodiments of the present invention, the first feature vector of the business chart can be used to generate the corresponding residual path weight; and according to the generated residual path weight, the second residual processing result corresponding to the sample business chart can be obtained, so that the residual connection module can generate a targeted second residual processing result according to different business charts, thereby improving the adaptability of the document detection model to different business charts and improving the accuracy of the data items to be detected extracted from the business charts.
[0090] Embodiment III
[0091] Figure 3 FIG. is a flowchart of a method for training a document compliance detection model provided in Embodiment III of the present invention. Based on the technical solutions of the above embodiments, the present invention optimizes and improves the operation of determining the compliance detection results.
[0092] Further, "performing compliance detection on the sample business document according to the text entity to be detected, the annotated text entity, the data item to be detected, and the set rule configuration information to obtain a compliance detection result" is refined to "detecting whether the text entity to be detected is consistent with the annotated text entity to obtain a text entity detection result; detecting whether the data item to be detected is consistent with the annotated data item to obtain a data item detection result; if the text entity detection result is inconsistent or the data item detection result is inconsistent, then determining the compliance detection result according to the text entity detection result and the data item detection result; if both the text entity detection result and the data item detection result are consistent, then detecting whether the text entity to be detected and the data item to be detected meet the rules in the set rule configuration information to obtain a rule detection result; and determining the compliance detection result according to the rule detection result", so as to improve the operation of determining the compliance detection result.
[0093] It should be noted that for the parts not detailed in the embodiments of the present invention, reference may be made to the descriptions of the foregoing embodiments.
[0094] See Figure 3 The method for training a document compliance detection model shown includes:
[0095] S301. Obtain a sample business document, the annotation result of the sample business document, and the set rule configuration information; the sample business document includes a sample business text and a sample business chart; the annotation result includes an annotated text entity, an annotated data item, and the annotation compliance result of the sample business document.
[0096] S302. Extract the text entities to be detected from the sample business text and identify the data items to be detected from the sample business charts through the initial detection model.
[0097] S303. Detect whether the text entities to be detected are consistent with the labeled text entities to obtain the text entity detection result.
[0098] In this embodiment, the text entity detection result may include consistent and inconsistent. If the text entity detection result is consistent, it means that the text entity to be detected is consistent with the labeled text entity; if the text entity detection result is inconsistent, it means that the text entity to be detected is inconsistent with the labeled text entity.
[0099] S304. Detect whether the data items to be detected are consistent with the labeled data items to obtain the data item detection result.
[0100] In this embodiment, the data item detection result may include consistent and inconsistent. If the data item detection result is consistent, it means that the data item to be detected is consistent with the labeled data item; if the data item detection result is inconsistent, it means that the data item to be detected is inconsistent with the labeled data item.
[0101] S305. If the text entity detection result is inconsistent or the data item detection result is inconsistent, determine the compliance detection result according to the text entity detection result and the data item detection result.
[0102] Specifically, if the text entity detection result is inconsistent and the data item detection result is consistent, determine that the compliance detection result is that the text entity detection fails; if the text entity detection result is consistent and the data item detection result is inconsistent, determine that the compliance detection result is that the data item detection fails; if the text entity detection result is inconsistent and the data item detection result is inconsistent, determine that the compliance detection result is that the text entity detection fails and the data item detection fails.
[0103] S306. If both the text entity detection result and the data item detection result are consistent, detect whether the text entities to be detected and the data items to be detected meet the rules in the set rule configuration information to obtain the rule detection result.
[0104] In this embodiment, the rule detection result may be the result obtained by detecting whether the text entities to be detected and the data items to be detected meet the rules in the set rule configuration information. Specifically, the rule matching the text entity to be detected can be found from the rules in the rule configuration information, and it is detected whether the text entity to be detected meets the matching rule; if the text entity to be detected meets the matching rule, determine that the rule detection result is compliant; if there is a text entity to be detected that does not meet the matching rule, determine that the rule detection result is non - compliant.
[0105] S307. Determine the compliance test result based on the rule test result.
[0106] Specifically, if the rule test result is compliant, determine that the compliance test result is compliant; if the rule test result is non - compliant, determine that the compliance test result is non - compliant.
[0107] S308. Train the initial detection model based on the compliance test result, the annotation result, and the sample business document to obtain a document detection model.
[0108] Specifically, use a certain algorithm to train the initial detection model based on the compliance test result, the annotation result, and the sample business document to obtain a document detection model.
[0109] Optionally, the initial detection model includes a rule detection module; the rule detection module is used to detect whether the text entity to be detected and the data item to be detected meet the rules in the set rule configuration information to obtain a rule test result; the compliance test result includes at least one of text entity detection failed, data item detection failed, and rule detection failed; correspondingly, training the initial detection model based on the compliance test result, the annotation result, and the sample business document to obtain a document detection model includes: if the compliance test result is text entity detection failed, train the text processing module and the parameter adjustment module corresponding to the text processing module in the initial detection model based on the sample business text and the annotated text entity to obtain a document detection model; if the compliance test result is data item detection failed, train the residual connection module and the chart processing module in the initial detection model based on the sample business chart and the annotated data item to obtain a document detection model; if the compliance test result is rule detection failed, train the rule detection module based on the compliance test result and the annotated compliance result to obtain a document detection model.
[0110] Specifically, if the compliance test result is that the text entity detection fails, the first loss function of the text processing module is calculated based on the sample business text and the annotated text entity; with the minimum value of the first loss function as the goal, the text processing module in the initial detection model and the parameter adjustment module corresponding to the text processing module are trained; and the initial detection model with the minimum value of the first loss function is determined as the document detection model; if the compliance test result is that the data item detection fails, the second loss function of the chart processing module and the regularized loss function of the residual connection module are calculated based on the sample business chart and the annotated data item; the target loss function is determined based on the second loss function and the regularized loss function; with the minimum value of the target loss function as the goal, the residual connection module and the chart processing module in the initial detection model are trained; the initial detection model with the minimum value of the target loss function is determined as the document detection model; illustratively, the target loss function can be determined by the following formula:
[0111] La=L1+λL2;
[0112] Among them, L a represents the target loss function; L 1 represents the second loss function; L 2 represents the regularized loss function; λ represents the regularized loss weight.
[0113] If the compliance detection result is that the rule detection fails, the third loss function is calculated based on the compliance detection result and the labeled compliance result; with the third loss function minimized as the goal, the rule detection module is trained to obtain a document detection model.
[0114] It can be understood that by adopting the above-mentioned technical scheme, different modules in the initial detection model can be trained in a targeted manner according to different compliance detection results, thereby improving the accuracy of the compliance detection results output by the model while avoiding training of other modules that are not related to the compliance detection results, thereby reducing the amount of data used in the model training process and improving the training efficiency of the model.
[0115] In an embodiment of the present invention, a text entity detection result is obtained by detecting whether a text entity to be detected is consistent with a labeled text entity; a data item detection result is obtained by detecting whether a data item to be detected is consistent with a labeled data item; if the text entity detection result is inconsistent or the data item detection result is inconsistent, a compliance detection result is determined according to the text entity detection result and the data item detection result; if both the text entity detection result and the data item detection result are consistent, it is detected whether the text entity to be detected and the data item to be detected meet the rules in the set rule configuration information to obtain a rule detection result; according to the rule detection result, a compliance detection result is determined. It is possible to determine whether the document detection model can accurately extract the text entity and data item to be detected from the business document by detecting whether the text entity to be detected and the data item to be detected extracted from the business document are consistent with the labeled text entity and the labeled data item. When it is determined that the document detection model can accurately extract entities and data items, the compliance detection result is determined according to the rule detection result; in the case where accurate extraction is not possible, the text processing module, parameter adjustment module, image processing module or residual connection module in the document detection model is trained, so as to avoid detecting whether the entities and data items to be detected comply with the rule configuration information when extraction errors have already occurred, thereby improving the training efficiency of the document compliance detection model.
[0116] Embodiment 4
[0117] Figure 4A As shown in the flowchart of a method for training a document compliance detection model provided in Embodiment 4 of the present invention, this embodiment is applicable to the case of performing compliance detection on business documents. This method can be executed by a training device for a document compliance detection model, and the training device for the document compliance detection model can be implemented in the form of hardware and / or software and is specifically configured in an electronic device, such as a server.
[0118] See Figure 4A The compliance detection method of the document shown, including:
[0119] S401. Obtain a business document to be detected and set rule configuration information; wherein, the business document to be detected includes text and charts.
[0120] S402. Through the document detection model, perform compliance detection on the business document to be detected according to the set rule configuration information to obtain a compliance detection result of the business document to be detected; wherein, the document detection model is trained by the training method of the document compliance detection model in any one of the embodiments of the present invention.
[0121] In this embodiment, the business document to be detected may be a business document to be subjected to compliance detection. The business document may be, for example, a contract document, an agreement document, an annual report document, a financial report document, a credit document, an insurance document, etc. The present invention does not limit the specific type of the business document. The set rule configuration information may include, but is not limited to, regulatory regulations, rules, and terms related to the business document, etc. The business text may be the text in the business document that records business information; the business chart may be the images and tables, etc. in the business document that record business information.
[0122] Specifically, through the document detection model, the text entities to be detected are extracted from the business text to be detected, and the data items to be detected are identified from the business charts to be detected; according to the text entities to be detected, the data items to be detected, and the set rule configuration information, the compliance detection of the business document to be detected is performed to obtain the compliance detection result.
[0123] Optionally, the document detection model includes a text processing module and a parameter adjustment module corresponding to the text processing module; through the parameter adjustment module, feature extraction is performed on the business text to be detected to obtain the first feature vector corresponding to the sample business text; through the parameter adjustment module, according to the first feature vector, the business type of the business document to be detected is predicted; through the parameter adjustment module, according to the business type of the business document to be detected, a parameter adjustment function corresponding to the business type is generated; through the parameter adjustment module, the parameters of the text processing module are adjusted according to the parameter adjustment function; through the text processing module with adjusted parameters, according to the first feature vector, the text entities to be detected are extracted from the business text to be detected.
[0124] Optionally, the document detection model includes a residual connection module and a chart processing module; through the residual connection module, feature extraction is performed on the business chart to be detected to obtain the second feature vector corresponding to the business chart to be detected; through the residual connection module, according to the second feature vector, the residual path weight of the residual block in the residual connection module is adjusted; through the residual block, according to the second feature vector, the first residual connection result of the business chart to be detected is generated; through the residual connection module, according to the adjusted residual path weight of the residual block, the first residual connection result, and the second feature vector, the second residual connection result of the business chart to be detected is determined; through the chart processing module, according to the second residual connection result, the data items to be detected are identified from the business chart to be detected.
[0125] Optionally, it is detected whether the text entities to be detected and the data items to be detected meet the rules in the set rule configuration information to obtain the rule detection result; according to the rule detection result, the compliance detection result is determined.
[0126] Optionally, during the application of the document detection model, the compliance manual detection results of the business document to be detected through manual means can be obtained; based on the compliance detection results of the business document by the document detection model and the compliance manual detection results, the parameters of the text processing module can be updated in real time; exemplarily, the updated parameters can be expressed by the following formula:
[0127]
[0128] where represents the parameter after the (t + 1)-th update; represents the parameter after the t-th update; η represents the learning rate; ▽L t represents the gradient of the loss function of the document detection model at the t-th time.
[0129] Optionally, the basic components such as the title part, chapter part, and paragraph part in the business document to be detected can also be identified by extracting the text entities to be detected from the business document to be detected; through the context and context of the extracted text entities, the coherence and connection between paragraphs can be identified, and the logical connection between paragraphs can be understood; analyze the relevance and internal association between each paragraph, and understand the core content and main idea of the document.
[0130] Optionally, a hash algorithm can also be used to generate a unique hash code for each component in the business document to be detected; where the components include titles, chapters, and paragraphs, etc.; for each component, find the other component that is most similar to this component according to the text content of this component, the position of this component in the business document to be detected, and the size of this component; form a text pair of this component and the found component; through sequence comparison algorithms such as Myers Diff Algorithm (differential algorithm) and LCS (longest common subsequence) algorithm, obtain the difference points between the two texts in the text pair; through the candidate set semantic information pair, filter and correct the misjudged difference points that may exist in the difference points; according to the position information of each word parsed from the business text to be detected, the semantic features of each word, and the position information of the difference points, perform operations such as merging, splitting, and deleting on the difference points to obtain a user-friendly comparison result; from the user-friendly comparison result, identify potential compliance issues, and conduct a risk assessment on the potential compliance issues; divide the priorities according to the severity and urgency of the potential compliance issues, and provide specific correction plans so that technicians can give priority to handling high-risk issues, thereby accelerating the speed of compliance adjustment and reducing the need for manual intervention.
[0131] Optionally, Figure 4B a formula extraction sub-model can also be included in a document detection model. As Figure 4BAs shown, in the formula extraction sub-model, the Embedding module (embedding module) represents each word as a dense vector; the Bi-LSTM module (bidirectional long short-term memory module) combines the sentences in the business text to be detected to generate a dense vector with context relationships for each word; the DAG-LSTM module (directed acyclic graph long short-term memory module) generates dense representations for each extracted node and each candidate node, which are used to represent and classify this node. The structure of each DAG-LSTM node is as Figure 4B shown, allowing it to accept inputs from multiple child nodes and inputs of relationship types, and generating new representations through multiple gate structures. Each type of node shares the same set of DAG-LSTM node parameters. The text is processed sentence by sentence through the DAG-LSTM unit, and operators and relationships are iteratively extracted from the leaf nodes to the root nodes, finally completing the process of identifying formulas from sentences; the identified formulas are subjected to compliance detection to determine whether the formulas in the business document to be detected are compliant.
[0132] Optionally, Figure 4C is a schematic diagram of the formula extraction result. As Figure 4B shown, the text in green font in the text content is the date text entity; the text in blue font is the account text entity; the text in purple font is the amount text entity; through the formula extraction module as Figure 4B shown, formulas can be extracted from the text.
[0133] Optionally, Figure 4D is a schematic diagram of the structure of a document detection system. The document detection system can be deployed in the cloud. The deployment method of the cloud platform can enable business organizations to easily access the system without large-scale local hardware investment, while ensuring the efficiency and scalability of data processing; the interactive user interface provides an intuitive operation interface and a real-time feedback mechanism, allowing users to easily upload documents, view the compliance check results in real time, and directly edit and adjust the documents to meet the compliance requirements. At the same time, the model performs self-learning and feeds the end feedback to the model for model iteration and optimization.
[0134] The technical solution of the embodiment of the present invention is to obtain a business document to be detected and set rule configuration information; wherein, the business document to be detected includes text and charts; through a document detection model, according to the set rule configuration information, perform compliance detection on the business document to be detected to obtain the compliance detection result of the business document to be detected; wherein, the document detection model is trained by the training method of the document compliance detection model in any one of the embodiments of the present invention, and can automatically perform compliance checks on business documents. Compared with the manual inspection method, the detection efficiency is improved and the investment in human resources is reduced; it can also avoid false positives and missed reports in the process of manually detecting documents, and improve the accuracy of document detection.
[0135] Embodiment 5
[0136] Figure 5 It is a schematic structural diagram of a training device for a document compliance detection model provided in Embodiment 5 of the present invention. This embodiment is applicable to the situation of training a document detection model. The device can execute the training method of the document compliance detection model. The training device of the document compliance detection model can be implemented in the form of hardware and / or software, and the device can be configured in an electronic device.
[0137] See Figure 5 The training device for the document compliance detection model shown, includes a document acquisition module 501, a text entity extraction module 502, a document detection module 503 and a model training module 504, wherein,
[0138] The document acquisition module 501 is used to obtain a sample business document, the annotation result of the sample business document and the set rule configuration information; the sample business document includes sample business text and sample business charts; the annotation result includes the annotated text entity and the annotation compliance result of the sample business document;
[0139] The text entity extraction module 502 is used to extract text entities to be detected from the sample business text and identify data items to be detected from the sample business charts through an initial detection model;
[0140] The document detection module 503 is used to perform compliance detection on the sample business document according to the text entities to be detected, the annotated text entities, the data items to be detected and the set rule configuration information to obtain a compliance detection result;
[0141] The model training module 504 is used to train the initial detection model according to the compliance detection result, the annotation result and the sample business document to obtain a document detection model.
[0142] In the technical solution of the embodiment of the present invention, a document acquisition module 501 is configured to acquire a sample business document, an annotation result of the sample business document, and set rule configuration information; the sample business document includes a sample business text and a sample business chart; the annotation result includes an annotated text entity and an annotation compliance result of the sample business document; a text entity extraction module 502 is configured to extract a text entity to be detected from the sample business text and identify a data item to be detected from the sample business chart through an initial detection model; a document detection module 503 is configured to perform compliance detection on the sample business document according to the text entity to be detected, the annotated text entity, the data item to be detected, and the set rule configuration information to obtain a compliance detection result; a model training module 504 is configured to train the initial detection model according to the compliance detection result, the annotation result, and the sample business document to obtain a document detection model. It can automatically perform compliance checks on business documents, improve the detection efficiency and reduce the investment in human resources compared with the manual inspection method; it can also avoid false positives and missed defects that occur during the manual document detection process and improve the accuracy of document detection.
[0143] Optionally, the initial detection model includes a text processing module and a parameter adjustment module corresponding to the text processing module;
[0144] The text entity extraction module 502 includes:
[0145] A first feature extraction unit is configured to extract features of the sample business text through the parameter adjustment module to obtain a first feature vector corresponding to the sample business text;
[0146] A business type prediction unit is configured to predict the business type of the sample business document according to the first feature vector through the parameter adjustment module;
[0147] A parameter generation unit is configured to generate a parameter adjustment function corresponding to the business type according to the business type through the parameter adjustment module;
[0148] A parameter adjustment unit is configured to adjust the parameters of the text processing module according to the parameter adjustment function through the parameter adjustment module;
[0149] An entity extraction unit is configured to extract a text entity to be detected from the sample business text according to the first feature vector through the text processing module after parameter adjustment.
[0150] Optionally, the initial detection model includes a residual connection module and a chart processing module;
[0151] The text entity extraction module 502 includes:
[0152] A second feature extraction unit, configured to extract features from a sample service chart through a residual connection module to obtain a second feature vector corresponding to the sample service chart;
[0153] A weight adjustment unit, configured to adjust the residual path weights of the residual blocks in the residual connection module according to the second feature vector through the residual connection module;
[0154] A first result determination unit, configured to generate a first residual connection result of the sample service chart according to the second feature vector through a residual block;
[0155] A second result determination unit, configured to determine a second residual connection result of the sample service chart according to the adjusted residual path weights of the residual blocks, the first residual connection result, and the second feature vector through the residual connection module;
[0156] A data item identification unit, configured to identify a data item to be detected from the sample service chart according to the second residual connection result through a chart processing module.
[0157] Optionally, the document detection module 503 includes:
[0158] An entity detection unit, configured to detect whether a text entity to be detected is consistent with a labeled text entity to obtain a text entity detection result;
[0159] A data item detection unit, configured to detect whether a data item to be detected is consistent with a labeled data item to obtain a data item detection result;
[0160] A first detection result determination unit, configured to determine a compliance detection result according to the text entity detection result and the data item detection result if the text entity detection result is inconsistent or the data item detection result is inconsistent;
[0161] A rule detection unit, configured to detect whether the text entity to be detected and the data item to be detected satisfy the rules in the set rule configuration information to obtain a rule detection result if both the text entity detection result and the data item detection result are consistent;
[0162] A second detection result determination unit, configured to determine a compliance detection result according to the rule detection result.
[0163] Optionally, the initial detection model includes a rule detection module; the rule detection module is configured to detect whether the text entity to be detected and the data item to be detected satisfy the rules in the set rule configuration information to obtain a rule detection result;
[0164] The compliance detection result includes at least one of text entity detection failed, data item detection failed, and rule detection failed;
[0165] Correspondingly, the model training module 504 includes:
[0166] The first training unit is configured to, if the compliance detection result is that the text entity detection fails, train the text processing module and the parameter adjustment module corresponding to the text processing module in the initial detection model according to the sample business text and the annotated text entity, so as to obtain a document detection model;
[0167] The second training unit is configured to, if the compliance detection result is that the data item detection fails, train the residual connection module and the chart processing module in the initial detection model according to the sample business chart and the annotated data item, so as to obtain a document detection model;
[0168] The third training unit is configured to, if the compliance detection result is that the rule detection fails, train the rule detection module according to the compliance detection result and the annotated compliance result, so as to obtain a document detection model.
[0169] The training device for the document compliance detection model provided by the embodiments of the present invention can execute the data forensics method of the device provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the training method of the document compliance detection model.
[0170] Embodiment Six
[0171] Figure 6 It is a schematic structural diagram of a document compliance detection device provided by Embodiment Six of the present invention. This embodiment is applicable to the situation of performing compliance detection on business documents. The device can execute the document compliance detection method. The document compliance detection device can be implemented in the form of hardware and / or software, and the device can be configured in an electronic device.
[0172] See Figure 6 The document compliance detection device shown in the figure includes a document acquisition module 601 and a document detection module 602, where
[0173] The document acquisition module 601 is configured to acquire a business document to be detected and set rule configuration information; wherein, the business document to be detected includes text and charts;
[0174] The document detection module 602 is configured to perform compliance detection on the business document to be detected according to the set rule configuration information through the document detection model, so as to obtain a compliance detection result of the business document to be detected; wherein, the document detection model is trained by the training method of the document compliance detection model in any one of the embodiments of the present invention.
[0175] The technical solution of the embodiment of the present invention includes a document acquisition module for acquiring a business document to be detected and set rule configuration information; a document detection module for performing compliance detection on the business document to be detected according to the set rule configuration information through a document detection model, and obtaining a compliance detection result of the business document to be detected. Among them, the document detection model is trained by the document compliance detection model training method of any one of the embodiments of the present invention, which can automatically perform compliance checks on business documents. Compared with the manual inspection method, it improves the detection efficiency and reduces the input of human resources. It can also avoid false positives and missed detections during the manual document detection process, improving the accuracy of document detection.
[0176] Embodiment Seven
[0177] Figure 7 FIG. shows a schematic structural diagram of an electronic device 700 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0178] As Figure 7 shown, the electronic device 700 includes at least one processor 701 and a memory communicatively connected to the at least one processor 701, such as a read-only memory (ROM) 702, a random access memory (RAM) 703, etc. Among them, the memory stores a computer program executable by the at least one processor. The processor 701 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 702 or the computer program loaded from the storage unit 708 into the random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The input / output (I / O) interface 705 is also connected to the bus 704.
[0179] Multiple components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disc, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0180] The processor 701 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 701 executes the various methods and processes described above, such as the training method of the document compliance detection model or the compliance detection method of the document.
[0181] In some embodiments, the training method of the document compliance detection model or the compliance detection method of the document can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the processor 701, one or more steps of the training method of the document compliance detection model or the compliance detection method of the document described above can be executed. Alternatively, in other embodiments, the processor 701 can be configured to execute the training method of the document compliance detection model or the compliance detection method of the document in any other suitable manner (e.g., by means of firmware).
[0182] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.
[0183] The computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, a special purpose computer, or other programmable compliance detection device for a document, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
[0184] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0185] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0186] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0187] A computing system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS (Virtual Private Server) services.
[0188] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0189] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub - combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for training a document compliance detection model, characterized in that: The method comprises: Acquire a sample business document, a marking result of the sample business document, and set rule configuration information; the sample business document includes a sample business text and a sample business chart; the marking result includes a marked text entity, a marked data item, and a marking compliance result of the sample business document; Extracting text entities to be detected from the sample business text and identifying data items to be detected from the sample business chart through the initial detection model; Through the initial detection model, according to the text entity to be detected, the annotated text entity, the data item to be detected, the annotated data item and the set rule configuration information, the sample business document is subjected to compliance detection to obtain a compliance detection result; The initial detection model is trained according to the compliance detection result, the annotation result and the sample business document to obtain a document detection model.
2. The method according to claim 1, characterized in that The initial detection model includes a text processing module and a parameter adjustment module corresponding to the text processing module; The extracting the text entity to be detected from the sample business text by using the initial detection model includes: By means of the parameter adjustment module, feature extraction is performed on the sample business text to obtain a first feature vector corresponding to the sample business text; Predicting the business type of the sample business document according to the first feature vector by the parameter adjustment module; Generate a parameter adjustment function corresponding to the service type according to the service type through the parameter adjustment module; By means of the parameter adjustment module, the parameters of the text processing module are adjusted according to the parameter adjustment function; The text entity to be detected is extracted from the sample business text according to the first feature vector through the text processing module with adjusted parameters.
3. The method according to claim 1, characterized in that The initial detection model includes a residual connection module and a graph processing module; The step of identifying the data items to be detected from the sample business graph by using the initial detection model includes: Performing feature extraction on the sample business graph through the residual connection module to obtain a second feature vector corresponding to the sample business graph; By means of the residual connection module, adjusting the residual path weight of the residual block in the residual connection module according to the second feature vector; generating, by the residual block, a first residual connection result of the sample service graph according to the second eigenvector; Determining, by the residual connection module, a second residual connection result of the sample service graph according to the adjusted residual path weight of the residual block, the first residual connection result and the second eigenvector; The graph processing module identifies the data item to be detected from the sample business graph according to the second residual connection result.
4. The method according to claim 1, characterized in that: The step of performing compliance detection on the sample business document according to the to-be-detected text entity, the annotated text entity, the to-be-detected data item and the set rule configuration information to obtain a compliance detection result includes: Detecting whether the text entity to be detected is consistent with the annotated text entity, and obtaining a text entity detection result; Detecting whether the data item to be detected is consistent with the marked data item, and obtaining a data item detection result; If the text entity detection result is inconsistent, or the data item detection result is inconsistent, determining a compliance detection result based on the text entity detection result and the data item detection result; If the text entity detection result is consistent with the data item detection result, then detect whether the text entity to be detected and the data item to be detected meet the rules in the set rule configuration information to obtain a rule detection result; According to the rule detection result, the compliance detection result is determined.
5. The method according to claim 4, characterized in that The initial detection model includes a rule detection module; the rule detection module is used to detect whether the text entity to be detected and the data item to be detected meet the rules in the set rule configuration information, and obtain a rule detection result; The compliance detection result includes at least one of text entity detection failure, data item detection failure and rule detection failure; Accordingly, the initial detection model is trained according to the compliance detection result, the annotation result and the sample business document to obtain a document detection model, including: If the compliance detection result is that the text entity detection fails, the text processing module in the initial detection model and the parameter adjustment module corresponding to the text processing module are trained according to the sample business text and the annotated text entity to obtain a document detection model; If the compliance detection result is that the data item detection fails, the residual connection module and the chart processing module in the initial detection model are trained according to the sample business chart and the annotated data item to obtain a document detection model; If the compliance detection result is that the rule detection fails, the rule detection module is trained according to the compliance detection result and the marked compliance result to obtain a document detection model.
6. A method for detecting compliance of a document, characterized in that: The method comprises: Acquire a business document to be detected and set rule configuration information; wherein the business document to be detected includes text and charts; Through the document detection model, according to the set rule configuration information, the compliance detection of the business document to be detected is performed to obtain the compliance detection result of the business document to be detected; wherein, the document detection model is trained by the training method of the document compliance detection model described in any one of claims 1-5.
7. A training device for a document compliance detection model, characterized in that: The device comprises: A document acquisition module, used to acquire sample business documents, annotation results of the sample business documents, and set rule configuration information; the sample business documents include sample business texts and sample business charts; the annotation results include annotated text entities and annotation compliance results of the sample business documents; A text entity extraction module, used to extract text entities to be detected from the sample business text and identify data items to be detected from the sample business chart through an initial detection model; A document detection module, used to perform compliance detection on the sample business document according to the text entity to be detected, the annotated text entity, the data item to be detected and the set rule configuration information, and obtain a compliance detection result; The model training module is used to train the initial detection model according to the compliance detection result, the annotation result and the sample business document to obtain a document detection model.
8. A document compliance detection device, characterized in that: The device comprises: A document acquisition module, used to acquire the business document to be detected and the set rule configuration information; wherein the business document to be detected includes text and charts; A document detection module is used to perform compliance detection on the business document to be detected through a document detection model according to the set rule configuration information, and obtain the compliance detection result of the business document to be detected; wherein, the document detection model is trained by the training method of the document compliance detection model described in any one of claims 1-5.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the training method of the document compliance detection model described in any one of claims 1-5, or execute the document compliance detection method described in claim 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the document compliance detection model training method described in any one of claims 1 to 5, or implement the document compliance detection method described in claim 6 when executed.
Citation Information
Cited By
File analysis method, data enhancement method, equipment, medium and product
CN121351793A