Customized text rule generation and auditing method and system for contract auditing and storage medium

By using custom text rule generation and auditing methods, and leveraging a large rule-generated model and a hierarchical similarity matching mechanism, we have achieved automated and efficient contract review, solving the problem of low efficiency in traditional review models and improving the consistency and accuracy of review standards.

CN120725002BActive Publication Date: 2025-11-04JIANGSU HONGXIN SYST INTEGRATION
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511178835.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-11-04
Estimated Expiration
2045-08-22

AI Technical Summary

Technical Problem

Traditional contract review models are inefficient and cannot adapt to dynamic changes and personalized expressions in contract terms. Furthermore, existing AI models have shortcomings in understanding legal semantics, leading to inconsistent review standards and misjudgments.

Method used

By adopting a custom text rule generation and auditing method, and by building a large rule generation model and a hierarchical similarity matching mechanism, contract risk audit rules are automatically generated and evaluated, and RPA tools are combined to achieve full-process automated auditing.

Benefits of technology

It improved the efficiency and accuracy of contract review, solved the problems of dynamic rule updates and automated auditing, and shortened the processing time from hours to minutes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120725002B_ABST
    Figure CN120725002B_ABST
Patent Text Reader

Abstract

The application provides a contract auditing-oriented custom text rule generation and auditing method and system and a storage medium, and relates to the technical field of computers.The method comprises the following steps: preliminarily screening a custom text containing rule descriptions from external corpus, and splitting the custom text into a specified text form; constructing a rule generation large model, extracting a plurality of contract risk auditing rules meeting predetermined conditions from the specified text form, and generating a contract risk auditing rule library; obtaining and analyzing a contract text to be audited, associating and matching the analysis result with the contract risk auditing rule library, and outputting an auditing suggestion for the contract text.The application uses a rule auditing four-tuple and a rule evaluation three-dimension to deposit complicated document rules into logical rules for training and generation, and uses a rule generation and rule auditing large model to realize automatic auditing of contract texts, thereby effectively solving the problem of non-uniformity of artificial document auditing rule standards.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of computers, in particular to a self-defined text rule generation and auditing method, system and storage medium for contract auditing. BACKGROUND

[0002] Enterprise contract management is under double pressure from business expansion and market complexity. The traditional manual auditing mode is difficult to cope with the surge in the number of contracts due to its low efficiency. At the same time, the risk control difficulties caused by the increase in the complexity of clauses and the non-uniformity of auditing standards have been plaguing enterprises.

[0003] The conventional coping method is to realize the screening of basic clauses through preset keywords and logical conditions, but such a method relies on a static rule library formulated by humans and is difficult to adapt to the dynamic changes and personalized expressions required by contract clauses. At the same time, the clause screening and matching adopt the form of text-by-text comparison, which often cannot effectively distinguish the differences between the text and the clauses, resulting in low matching quality and indirectly affecting the auditing efficiency. In addition, although the traditional AI model can perform part of the risk identification through historical data training, it still has the problem of insufficient understanding of legal semantics and missing context association, leading to misjudgment.

[0004] Therefore, an intelligent solution is urgently needed to solve such problems. SUMMARY

[0005] The purpose of the application is to provide a self-defined text rule generation and auditing method, system and storage medium for contract auditing, which is suitable for enterprise daily contract management processes and solves the problems of dynamic updating and automatic auditing of contract auditing rules.

[0006] In the first aspect of the application, a self-defined text rule generation and auditing method for contract auditing is provided, which comprises the following steps:

[0007] Preliminarily screening self-defined texts containing rule descriptions from external corpus, and splitting them into specified text forms;

[0008] Building a rule generation large model, taking the rule quadruple containing the auditing field, the comparison condition, the comparison type, and the comparison content as the target output of the rule generation large model; extracting a plurality of contract risk auditing rules meeting the predetermined conditions from the specified text forms to generate a contract risk auditing rule library;

[0009] Obtaining and parsing the contract text to be audited, associating and matching the parsing result with the contract risk auditing rule library, obtaining the contract risk auditing rules related to the contract text to be audited from the contract risk auditing rule library through a hierarchical similarity matching mechanism, and outputting the auditing suggestions for the contract text.

[0010] In further embodiments of the first aspect, the self-defined text containing rule descriptions is preliminarily screened out from the external corpus, and is split into a specified text form, specifically including:

[0011] The self-defined text is parsed by a text parser , and a division mode is selected according to the length of the parsed content:

[0012] If the length is less than , it is directly divided into one block, that is ;

[0013] If the length is greater than or equal to , the long text is divided according to the paragraph structure obtained by the text parser, to ensure that each block of paragraph text is within , that is .

[0014] In further embodiments of the first aspect, a rule generation large model is constructed, specifically including:

[0015] A rule quadruple is designed as the target output of the rule generation large model, wherein represents an audit field; represents a comparison condition; represents a comparison type; represents comparison content;

[0016] An application rule instance based on the rule quadruple is constructed through the self-defined text ;

[0017] The rule generation large model is constructed through prompt engineering .

[0018] In further embodiments of the first aspect, the rule generation large model is constructed through prompt engineering , specifically including:

[0019] Prompt engineering is performed according to a prepared rule sample, and a prompt prompt word is output :

[0020]

[0021] In the formula, represents background information; represents a logical rule; represents an output specification, that is, the result content output by the rule generation large model ; a current task, i.e. a text description of a rule to be generated;

[0022] with a prompt prompt word and a rule generation large model generating a large model rule, comparing the generated large model rule with a pre-prepared rule sample, and if there is a difference in the result, performing a prompt project in a loop to adjust to achieve the expected rule generation.

[0023] In further embodiments of the first aspect, the rule generation large model extracts a contract risk audit rule R from the text ;

[0024] constructs a rule evaluation model performs availability evaluation on the contract risk audit rule R; the rule evaluation model contains three dimensions of support , coverage and confidence ;

[0025] Support is defined as the number of rule quadruples that meet the rule quadruples in the rule quadruples :

[0026]

[0027] Coverage is defined as follows:

[0028]

[0029] Confidence is defined as follows:

[0030]

[0031] In the formula, denotes the counting operation; refers to a field pair formed by any combination with as the head field and as the tail field; is the rule head; is the rule body; denotes the combination mode;

[0032] When the contract risk audit rule R meets all three dimensions in the rule evaluation model , it is added to the contract risk audit rule library .

[0033] In a further embodiment of the first aspect, the hierarchical similarity matching mechanism is based on rule quadruples. Matching implementation;

[0034] Rule Quadruple The hidden state is obtained after encoding by the BERT encoder. :

[0035]

[0036] In the formula, , , , Corresponding to the rule quadruple , , , The hidden state;

[0037] For hidden state After performing attention masking, a weighted average is taken to obtain the hierarchical vector. :

[0038]

[0039] In the formula, This represents the hidden state of the r-th quad; A label representing the l-th attention mask; Indicates the product operation; This represents the length of the content of the r-th quad;

[0040] Combination and The similarity score is calculated using the following formula:

[0041]

[0042]

[0043]

[0044] In the formula, Indicate the importance of the i-th layer; The importance score is represented for each level; for The average vector contains a representation of the correlations across all layers; This represents the number of layers in the BERT encoder. , , These are learnable weight parameters.

[0045] In further embodiments of the first aspect, the associating and matching the resolution result with the contract risk audit rule library further comprises:

[0046] The text to be audited The contract risk audit rule library The corresponding The hierarchical similarity matching is performed to obtain a matching rule The matching rule The corresponding The matching values are calculated and sorted from high to low, and the default number of selected rules is ;

[0047] The text to be audited The matching rule The rule comparison large model is applied Secondary audit and difference analysis are performed.

[0048] In further embodiments of the first aspect, the rule comparison large model The rule generation large model Uses the same base model, and the prompt engineering is constructed according to the text to be audited , the matching rule , and the prompt prompt word is output:

[0049]

[0050] In the formula, Indicates background information; Indicates the text information to be audited; Indicates the approximate rule matched by the rule library; Is the result output, that is, the result of rule matching and audit problems;

[0051] The prompt prompt word Is used for rule comparison risk audit by the rule comparison large model , that is, the interface of the rule comparison large model is called by the text combination to output the result;

[0052] The rule comparison large model Matches the risk rules based on the audit text ;

[0053] The rule comparison large model Generates the risk basis corresponding to the risk rule . ​​​

[0054] In a second aspect, the present application provides a self-defined text rule generation and auditing system for contract auditing, which can automatically execute the method for self-defined text rule generation and auditing for contract auditing disclosed in the first aspect.

[0055] Specifically, the system comprises a rule generation module, a rule correlation analysis module and an automated auditing module.

[0056] The rule generation module is used to preliminarily screen self-defined texts containing rule descriptions from external corpus, split them into specified text forms, build a rule generation large model, extract a plurality of contract risk auditing rules meeting predetermined conditions from the specified text forms, and generate a contract risk auditing rule library.

[0057] The rule correlation analysis module is used to acquire and analyze a contract text to be audited, correlate and match the analysis result with the contract risk auditing rule library, and output an auditing suggestion for the contract text.

[0058] The automated auditing module accesses an RPA tool and calls the rule correlation analysis module to complete automated auditing of the contract.

[0059] In a third aspect, the present application provides a computer-readable storage medium, which stores at least one executable instruction, and the executable instruction makes an electronic device execute the method for self-defined text rule generation and auditing for contract auditing disclosed in the first aspect when running on the electronic device.

[0060] Compared with the prior art, the present application has the following beneficial effects:

[0061] (1) The rule auditing quadruple and rule evaluation three dimensions are used to reduce complex document rules to logical rules for training and generation, such rules can efficiently represent rule meanings and reduce redundant information, improve model application efficiency, and use rule generation and rule auditing large models to solve the problem of inconsistent artificial document auditing rule standards.

[0062] (2) The hierarchical similarity matching method is used to optimize the single text-rule matching method to a multi-layer text-dimension-rule matching method, further improve the accuracy of the similarity matching model, and ensure efficient rule screening.

[0063] (3) The prompt engineering combined with the large model is used to automatically generate self-defined text auditing rules, solve the problem of not timely automatic evaluation, synchronization and storage of risk auditing rules.

[0064] (4) RPA and large models are used to realize automatic processing of the whole document auditing process, fully connect the automated process of the contract auditing scene, and shorten the processing time from hours to minutes. BRIEF DESCRIPTION OF DRAWINGS

[0065] Figure 1 A flowchart of a contract auditing-oriented custom text rule generation and auditing method is shown.

[0066] Figure 2 A flowchart of a contract auditing-oriented custom text rule generation and auditing method is shown. DETAILED DESCRIPTION

[0067] In the following description, numerous specific details are set forth to provide a more thorough understanding of the present application. However, it will be apparent to one of skill in the art that the present application can be practiced without one or more of these specific details. In other instances, well-known features have not been described in order to avoid obscuring the present application.

[0068] Embodiment 1:

[0069] The embodiment proposes a contract auditing-oriented custom text rule generation and auditing system, which supports semantic understanding of external materials (such as enterprise specifications, artificial language descriptions, and other information), uses a rule generation large model to pre-generate contract auditing rules, and then performs content auditing and automatic transfer on contracts generated in actual production work, to solve the problem of time-consuming and laborious manual contract auditing and inconsistent auditing standards.

[0070] Figure 1 The display is a schematic diagram of each module of the contract auditing-oriented custom text rule generation and auditing system, which includes:

[0071] Rule generation module: This module mainly implements rule extraction of external corpus such as enterprise specifications and artificial language descriptions, then uses a rule evaluation mechanism to realize effective rule differentiation, and finally completes auditing rule storage to form a contract auditing risk rule library to provide basic library capabilities for the automatic auditing module.

[0072] Rule association analysis module: This module mainly realizes association rule matching between the input contract and the contract auditing risk rule library, analyzes the corresponding description of the related rules and the contract, and provides abnormal reminder suggestions.

[0073] Automatic auditing module: This model mainly realizes contract automatic auditing, including RPA process and auditing process; the RPA process completes contract-related information automatic acquisition, backfilling, and reminding operations; the auditing process completes contract risk comparison and auditing result output.

[0074] Figure 2 The display is the main implementation process of the present scheme, and the steps are as follows:

[0075] Step S1: Use rule generation large model to realize rule generation and form a contract risk audit rule library.

[0076] Step S2: After parsing the contract, associate and match the contract risk audit library, and output analysis suggestions.

[0077] Step S3: Combine RPA process and contract audit process to complete full-process automatic contract audit operation.

[0078] Embodiment 2:

[0079] In order to more clearly describe the technical solutions, on the basis of the foregoing embodiment 1, the embodiment discloses implementation details of each step.

[0080] Step S1: Use rule generation large model to realize rule generation and form a contract risk audit rule library;

[0081] Step S1-1: Receive custom text , including documents ending with doc, docx, pdf, txt and json content provided in the interface, and convert them into specified text form ;

[0082] Step S1-1-1: Use a text parser to parse the custom text, the text parser including pywin32, pdfplumber, open;

[0083] Step S1-1-2: Split the custom text into specified text form;

[0084] Step S1-1-2-1: According to the content length parsed by the text parser, select the division mode;

[0085] Step S1-1-2-1-1: If the length is less than token, directly divide it into a block, that is ;

[0086] Step S1-1-2-1-2: If the length is greater than or equal to token, divide the long text according to the paragraph structure obtained by the text parser, to ensure that each block of text is within token, that is ;

[0087] Step S1-2: Construct rule generation large model to the content output by step S1-1 ;

[0088] Step S1-2-1: Design the rule model output by the rule generation large model ;

[0089] Step S1-2-1-1: rule model The basic content consists of four parts, including audit field , comparison condition , comparison type , comparison content , that is

[0090]

[0091] Step S1-2-1-2: audit field Definition and explanation, this field is the summary of the text abstract;

[0092] Step S1-2-1-3: audit field Definition and explanation, this field includes "true", "false", "contains", "does not contain", "equals", "empty", "less than or equal to", "less than", "greater than", "greater than or equal to";

[0093] Step S1-2-1-4: audit field Definition and explanation, this field includes "text", "amount", "numeric value", "date";

[0094] Step S1-2-1-5: audit field Definition and explanation, this field is the specific expression content of the audit field ;

[0095] Step S1-2-1-6: rule model There are multiple rule combinations, that is

[0096]

[0097] Among them, the relationship between rule and rule is that the condition needs to be met at the same time to meet rule ;

[0098] Step S1-2-2: build application rule instance based on rule model through self-defined text, that is

[0099]

[0100] The above formula represents the rule model i corresponding to the i th text content, and the initialization rule needs to be manually constructed according to the rule model ;

[0101] ​Step S1-2-3: Generating large model by prompt engineering construction rule ;

[0102] Step S1-2-3-1: Select qwen3-32B as the base model for prompt engineering, which can be replaced according to the open source situation of the large model;

[0103] Step S1-2-3-2: Perform prompt engineering according to the prepared rule sample, and output prompt prompt The prompt mainly includes four parts: background information, logical rule, output specification and current task, that is

[0104]

[0105] Step S1-2-3-2-1: Background information That is, the ability and demand background required by a large model;

[0106] Step S1-2-3-2-2: Logical rule That is, the logical specification that the large model needs to understand, which can be combined with Content for listing and example description;

[0107] Step S1-2-3-2-3: Output specification That is, the result content expected by the large model , which can be directly used as the input of step S1-3;

[0108] Step S1-2-3-2-4: Current task That is, the text description of the rule to be generated;

[0109] Step S1-2-3-3: Generate large model rule using And Compare with the prepared rule, if there is a difference, execute step S1-2-3-2 to adjust To achieve the expected rule generation;

[0110] Step S1-2-3-4: When step S1-2-3-3 is completed, perform step S1-3 operation on the text without corresponding rule to construct new rule;

[0111] Step S1-3: Construct rule evaluation model Evaluate the usability of the new rule output by S1-2 ;

[0112] Step S1-3-1: Rule evaluation model Contains support , coverage and confidence Three dimensions to comprehensively evaluate the quality of rule generation;

[0113] Step S1-3-1-1: The support of the generated rule can be defined as the number of rule quadruples that meet the rule model, that is,

[0114]

[0115] Wherein represents the counting operation, refers to the field pair formed by as the head field, as the tail field and through any combination, is the rule head, is the rule body, represents the combination method, obviously, when is 0, that is, a low-quality rule;

[0116] Step S1-3-1-2: The coverage of the rule reflects the ratio of the number of rules contained in the rule body; the higher the coverage, the more meaningful the rule is, and the coverage is defined as follows:

[0117]

[0118] Step S1-3-1-3: The confidence of the rule reflects the frequency of the rule head appearing when the rule body is true; the higher the confidence, the more the rule head is true when the rule body is true, the higher the rule quality, and the confidence is defined as follows:

[0119]

[0120] Step S1-3-2: When the rule meets the rule evaluation model , go to step S1-4, otherwise continue to evaluate the availability of the remaining rules until all rules are evaluated;

[0121] Step S1-3-2-1: The evaluation is realized by , that is,

[0122]

[0123] indicates that the evaluation model indicators are sent to the large model for expert evaluation, and the evaluation result is directly returned to pass and fail;

[0124] Step S1-4: Rules that meet the availability evaluation standard in step S1-3 are stored in the rule library to form a contract risk audit rule library ;

[0125] Step S1-4-1: The database is used for warehousing, and telePG is selected as the database;

[0126] Step S1-4-2: After the rule warehousing is completed, the rule query is developed for steps S2 and S3;

[0127] Step S2: After the contract is parsed, the contract risk audit library is associated and matched, and the analysis suggestion is output;

[0128] Step S2-1: Obtain the text to be audited ;

[0129] Step S2-1-1: Obtain the text to be audited through the API interface ;

[0130] Step S2-2: Obtain relevant rules from the contract risk audit rule library through a hierarchical similar matching mechanism ;

[0131] Step S2-2-1: Hierarchical similar matching, that is, matching is realized according to the rule four-tuple ;

[0132] Step S2-2-1-1: is the hidden state obtained after the four-tuple is encoded by the bert encoder, that is

[0133]

[0134] Step S2-2-1-2: Hierarchical vector , that is, the weighted average after attention mask operation is performed on , that is

[0135]

[0136] wherein represents the i-th four-tuple , represents the i-th attention mask token, represents the multiplication operation, represents the length of the corresponding four-tuple content; Step S2-2-1-2: Combine and

[0137] to perform similarity scoring, and the calculation formula is as follows:

[0138] ​​

[0139]

[0140]

[0141] wherein represents the importance of the i-th layer; is the importance score for each layer; is the average vector containing the representation of all layer dependencies; is the number of layers of the bert model, , , , are learnable weight parameters;

[0142] Step S2-2-2: combine the matching rules ;

[0143] Step S2-2-2-1: the matching rules corresponding to are calculated, and the matching values are sorted from high to low, and the default number of selected values is ;

[0144] Step S2-2-3: the text to be audited is compared with the matching rules of step S2-2-2, and the rule comparison large model is used for secondary audit and difference analysis;

[0145] Step S2-2-3-1: the rule comparison large model used here is the same base model as the rule generation large model constructed by the prompt engineering of step S1-2-3, i.e., qwen3-32B, and the following is the differentiated content;

[0146] Step S2-2-3-2: according to , prompt engineering is constructed, and the prompt prompt word is output, which mainly includes four parts: background information, audit text, matching rule, and result output, i.e.

[0147]

[0148] Step S2-2-3-2-1: background information , i.e., the ability and demand background required by the large model, which is used for the large model to understand the actions to be performed next;

[0149] Step S2-2-3-2-2: audit text , i.e., the text information to be audited;

[0150] Step S2-2-3-2-3: Matching rules Approximate rules including rule base matching, i.e. other auxiliary understanding rule examples;

[0151] Step S2-2-3-2-4: Result output Results of rule matching and audit questions;

[0152] Step S2-2-3-3: Utilization Risk audit by rule comparison, i.e. by Text combination calling large model interface for result output;

[0153] Step S2-2-3-3-1: Large model matching to obtain risk rules based on audit text ;

[0154] Step S2-2-3-3-2: Large model generates risk basis for corresponding rules ;

[0155] Step S3: Combine RPA process and contract audit process to complete full-process automatic contract audit operation;

[0156] Step S3-1: Perform contract audit automation configuration based on process automation technology;

[0157] Step S3-1-1: Select process automation tool RPA;

[0158] Step S3-1-2: Custom configuration information;

[0159] Step S3-1-2-1: Web basic information, including website, username, password;

[0160] Step S3-1-2-2: To-be-audited document download location information;

[0161] Step S3-1-2-3: Audit content backfill location information;

[0162] Step S3-1-2-4: Other configurable information;

[0163] Step S3-2: Perform contract risk audit by executing the automation program;

[0164] Step S3-2-1: Start step S3-1, complete the configuration of the automation program;

[0165] Step S3-2-2: Execute to the document audit link, call step S2 to obtain the audit result;​​​

[0166] Step S3-2-2-1: Perform document segmentation in step S1-1-2 to obtain document segment information ;

[0167] Step S3-2-2-2: Send document segment information to Perform document risk review;

[0168] Step S3-2-2-3: Obtain review results ;

[0169] Step S3-3: Perform step S3-2 in a loop to implement all contract reviews.

[0170] Embodiment 3:

[0171] The present application is used in the contract intelligent review link, realizes the generation of risk rule library based on documents, and simultaneously realizes the full-process automatic operation of contract risk review by using automatic tools. The details of each step are described in combination with actual cases.

[0172] Step S1: Use the rule generation large model to realize rule generation and form a contract risk review rule library;

[0173] Step S1-1: Receive custom text , including documents ending with doc, docx, pdf, txt and json content provided in the form of an interface, and convert them into the specified text form ;

[0174] For example, "the amount of arrears in the contract cannot exceed 2 million yuan";

[0175] Step S1-1-1: Set to 1000, because The token length is less than 1000 tokens, so it is directly processed as a whole without further division;

[0176] Step S1-2: Construct a rule generation large model through prompt engineering ;

[0177] Step S1-2-1: Select qwen3-32B as the base model for prompt engineering;

[0178] Step S1-2-2: Perform prompt engineering according to the prepared rule samples, and output prompt prompts The prompt mainly includes 4 parts: background information, logical rules, output specifications and current tasks, that is

[0179]

[0180] Wherein, each part is shown as follows:

[0181] BACKGROUND As follows:

[0183] You are a rule parsing expert, please strictly follow the following requirements to parse the input rules:

[0184] 1. Category: Match the closest field name from the predefined list of fields to match (support fuzzy matching and semantic understanding, ignore modifiers, parentheses comments, abbreviations, etc.).

[0185] 2. Expression: Map natural language trigger words to standard operators.

[0186] 3. Content:

[0187] Amount pattern: Extract the numerical value and convert it to yuan units and keep the unit.

[0188] Field comparison: Fill in the comparison field name.

[0189] Special list 1: Fill in "No".

[0190] Special list 2: Fill in the field name itself.

[0191] New exception: The rule contains "contract termination" and "unresolved matters" -> "business type: contract termination";

[0192] The rule contains "associated forward contract" -> "whether associated contract: forward"

[0193] 4. Type: Fill in "text / number / field value" according to the content type.

[0195] Logical rules As follows:

[0197] Task goal, extract the following 4 fields from the input rules:

[0198] 1. Category: Match the closest field name from the predefined list of fields to match (support fuzzy matching and semantic understanding, strictly check whether it is in the rule list).

[0199] 2. Expression: Map natural language trigger words to standard operators (e.g. "more than" -> "greater than").

[0200] 3. Content: Fill in according to the numerical value, field or special logic in the rule.

[0201] ​​​4, Type: Value is [“text”, “number”, “field value”], determine according to content type. **

[0203] Output specification As follows: **

[0205] Strict JSON format, including category, expression, content, and type four fields. If it can't match, return {{“category”:“no”}} **

[0207] Current task As follows: **

[0209] Input text: Contract cannot appear in the amount of arrears more than 200 million yuan **

[0211] Step S1-2-3: Generate rules That is {“category”:“arrears amount (yuan)”, “expression”:“less than”, “content”:“2000000”, “type”;“number”}.

[0212] Step S1-3: Rule storage, form contract risk audit rule library .

[0213] Step S2: After parsing the contract, the contract risk audit library is associated and matched, and the analysis suggestion is output.

[0214] Step S2-1: Get the text to be audited That is “... the contract still has 300 million yuan of arrears unpaid...”.

[0215] Step S2-2: Get the contract risk audit library Some rules are as follows:

[0216] “Rule 1: {“category”:“arrears amount (yuan)”, “expression”:“less than”, “content”:“2000000”, “type”:“number”}”

[0217] “Rule 2: {“category”:“contract amount (yuan)”, “expression”:“less than”, “content”:“2000000”, “type”:“number”}”

[0218] “Rule 3: {“category”:“business type”, “expression”:“equal to”, “content”:“forward”, “type”:“text”}”

[0219] "Rule 4: { "category": "operational abnormality", "expression": "equal to", "content": "operational abnormality", "type": "text"}"

[0220] "Rule n:...".

[0221] Step S2-3: Obtain rule sorting through hierarchical similarity matching mechanism, such as (Rule 1, Rule 2, Rule n, Rule 3, Rule 4).

[0222] Step S2-4: Default number of selection is 2.

[0223] Step S2-5: Select the text to be audited Match the rules in step S2-2 Apply rule comparison to large model Secondly, review and analyze the differences.

[0224] Step S2-5-1: Select qwen3-32B as the base model for prompt engineering.

[0225] Step S2-5-2: According to , Prompt engineering construction, output prompt words , The prompt words mainly include four parts: background information, audit text, matching rules and result output, that is

[0226]

[0227] Among them, each part is as follows:

[0228] Background information As follows: [

[0230] You are a rule risk audit expert, please strictly follow the following requirements to audit the input rules:

[0231] 1. Category: Match the closest rule from the matching list (support fuzzy matching, punctuation retention and ignore, semantic understanding, ignore modifiers, parentheses annotations, abbreviations, etc. Differences).... ]

[0233] Audit text As follows: [

[0235] Text to be audited:... The contract still has 3 million yuan of arrears unpaid... ]

[0237] Matching rules As follows: [

[0239] Candidate matching rule: Rule 1: { "category": "amount of arrears (yuan)", "expression": "less than", "content": "2000000", "type": "number"}; { "category": "contract amount (yuan)", "expression": "less than", "content": "2000000", "type": "number"}. }

[0241] Result output As follows: [

[0243] Output format requirement: Strict JSON format, including risk rule and risk description two fields. If there is no risk match, return { "risk rule": "none", "risk description": "none"} }

[0245] Step S2-6: Large model matching gets risk rules based on the audit text , that is, "Rule 1: { "category": "amount of arrears (yuan)", "expression": "less than", "content": "2000000", "type": "number"}"; The large model generates the risk basis corresponding to the rule , that is, "The amount of arrears (yuan) does not meet the requirements, the rule requires the amount to be less than 2000000, and the actual contract is 3000000". Step S3: Combine RPA process and contract audit process to complete the whole process of automatic contract audit operation.

[0246] Step S3-1: Configure contract audit automation based on process automation technology;

[0247] Step S3-1-1: Select the process automation tool RPA;

[0248] Step S3-1-2: Customize configuration information;

[0249] Step S3-1-2-1: Web basic information, including website, username, password;

[0250] Step S3-1-2-2: Information of the location of the document to be audited (such as: my to-do list - contract details - contract text);

[0251] Step S3-1-2-3: Information of the location of the audit content backfill (such as: contract details - submission - opinion column);

[0252] Step S3-1-2-4: Other configurable information (such as: abnormal reminder);

[0253] Step S3-1-2-4: Other configurable information (such as: abnormal reminder);

[0254] ​Step S3-2: executing the automatic program to perform contract risk audit;

[0255] Step S3-2-1: starting the automatic program configured in step S3-1;

[0256] Step S3-2-2: performing to the document audit link, calling step S2 to obtain the audit result;

[0257] Step S3-2-2-1: performing step S1-1-2 to perform document segmentation to obtain document segment information ;

[0258] Step S3-2-2-2: sending the document segment information to perform document risk audit;

[0259] Step S3-2-2-3: obtaining the audit result ;

[0260] Step S3-3: cyclically performing step S3-2 to realize all contract audits.

[0261] The logic behind the method disclosed in the above embodiments can be realized by software, hardware, firmware or any other combination in whole or in part. When realized by software, the above embodiments can be realized in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs.

[0262] When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. containing one or more available medium collections. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid state disk.

[0263] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks.

[0264] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flowchart or flows and / or block diagram block or blocks specified in the flowchart or flows and / or block diagram. Figure 1 one or more flow or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks.

[0265] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks. Figure 1 one or more flow or flows and / or block diagram block or blocks.

[0266] As described above, while the present application has been described in terms of specific preferred embodiments, it is to be understood that the application is not limited to these particular embodiments. Various modifications can be made to form still further embodiments without departing from the spirit and scope of the present application as defined by the appended claims.

Claims

1. A method for generating and auditing custom text rules for contract review, characterized in that, The method comprises the following steps: The method comprises the following steps: Parsing the custom text using a text parser and selecting a division mode according to the length of the parsed content If the length is less than , it is directly divided into a block, that is ; If the length is greater than or equal to , the long text is divided according to the paragraph structure obtained by the text parser, so that each piece of paragraph text is within , that is ; The method comprises the following steps: Design rule four-tuple as a target output of the rule generation large model, wherein, represents an audit field; represents a comparison condition; represents a comparison type; represents comparison content; By customizing the text Constructing application rule instances based on rule quadruples of the application rule instances; Rule generation large model constructed by prompt engineering ; The method comprises the following steps: The rule generation model is constructed, and the rule four-tuple comprising the audit field, the comparison condition, the comparison type and the comparison content is taken as the target output of the rule generation model.

2. The contract audit oriented custom text rule generation and auditing method of claim 1, wherein, Rule generation large model constructed by prompt engineering , and specifically comprises: According to the pre-prepared rule sample, the prompt engineering is performed, and a prompt prompt word is output : wherein, represents background information; represents logical rules; represents output specification, the output specification being a desired rule generation large model outputted result content ; represents current task, the current task being a text description of a rule to be generated; Utilizing prompt cues With rule generation large model Generation large model rule, compare the generated large model rule with the pre-prepared rule sample, if there is a difference in the result, loop the prompt project to adjust Make it reach the rule generation expectation.

3. The contract audit oriented custom text rule generation and auditing method of claim 2, wherein, Generating large models using the rules from text extracting contract risk review rules R; Building a rule evaluation model Performing an availability assessment on the contract risk audit rule R; the rule evaluation model Comprising three dimensions of support , coverage , and confidence ; Support is defined as the number of rule quadruples in the rule quadruple that satisfy the rule quadruple: Coverage is defined as follows: Confidence Is defined as follows: In the formula, represents a counting operation; means that the is a head field, is a tail field, and the pair of fields is formed by an arbitrary combination; is a rule head; is a rule body; represents a combination manner; When the contract risk audit rule R meets all three dimensions in the rule evaluation model , the contract risk audit rule R is added to the contract risk audit rule library .

4. The contract audit oriented self-defined text rule generation and auditing method according to claim 1, characterized in that, The hierarchical similarity matching mechanism according to the rule four-tuple Matching implementation; Rule four tuple Hidden state after encoding by the bert encoder : In the formula, , , , correspond to the hidden states of , , , in the rule quadruple, respectively; on the hidden state weighted average after attention mask operation, to get hierarchical vector : wherein, denotes the hidden state of the r-th quadruple; denotes the token of the l-th attention mask; denotes the multiplication operation; denotes the length of the r-th quadruple content; In conjunction with With Similarity score is calculated as follows: wherein, denotes the importance of the i-th layer; denotes the importance score for each layer; is the average vector containing the representation of all layer dependencies; is the average vector containing the representation of all layer dependencies; is the number of layers of the bert encoder; , , are learnable weight parameters.

5. The contract audit oriented custom text rule generation and auditing method of claim 4, wherein, The contract text to be audited is obtained and parsed, the parsed result is associated and matched with the contract risk audit rule library, the contract risk audit rule related to the contract text to be audited is obtained from the contract risk audit rule library through a hierarchical similar matching mechanism, and an audit suggestion for the contract text is output. The text to be audited The contract risk auditing rule library The corresponding Hierarchical similar matching is performed to obtain a matching rule ; the matching rule corresponding to The matching values are sorted from high to low, and the default number of selections is ; The text to be audited with the matching rules Apply rule comparison to large model Secondly review and difference analysis.

6. The contract audit oriented custom text rule generation and auditing method of claim 5, wherein, The rule comparison large model The rule generation large model Using the same base model, according to the text to be audited , match rules Perform prompt engineering construction, output prompt prompt words : wherein, represents background information; represents text information that needs to be reviewed; represents an approximate rule that matches the rule base; is a result output that is a result of rule matching and a review question; Utilizing prompt prompt words Rule comparison large model Performing rule comparison risk audit, through Text combination invokes the interface of the rule comparison large model Output results; Rule comparison large model Matched risk rules based on audit text ;​ Rule comparison large model Generate a risk basis corresponding to the risk rule .

7. A contract audit oriented custom text rule generation and auditing system for automatically performing the contract audit oriented custom text rule generation and auditing method of any one of claims 1 to 6, characterized by, The parsed result is associated and matched with the contract risk audit rule library, and the method further comprises the following steps: The system comprises: The rule generation module is configured to preliminarily screen custom text comprising rule descriptions from external corpus, and split the custom text into specified text forms. The rule generation module is further configured to construct a rule generation model, take a rule four-tuple comprising an audit field, a comparison condition, a comparison type and comparison content as the target output of the rule generation model, and extract a plurality of contract risk audit rules meeting predetermined conditions from the specified text forms to generate a contract risk audit rule library.

8. A computer-readable storage medium, characterized in that, The rule association analysis module is configured to obtain and parse a contract text to be audited, associate and match a parsed result with the contract risk audit rule library, obtain a contract risk audit rule related to the contract text to be audited from the contract risk audit rule library through a hierarchical similar matching mechanism, and output an audit suggestion for the contract text. The automatic audit module is configured to access an RPA tool and call the rule association analysis module to complete automatic audit of the contract. The storage medium stores at least one executable instruction, and the executable instruction makes the electronic device execute the contract audit-oriented custom text rule generation and auditing method when running on the electronic device.

Citation Information

Patent Citations

  • Contract text review method, system and device based on natural language and medium

    CN118467683A