Intelligent contract review method, device, equipment, and medium based on content extraction
By splitting the contract text into multiple text blocks and using the NLP model and CoT mechanism for cross-part logical association, the problem of insufficient reliability of contract audit results in the existing technology is solved, and efficient and reliable contract audit is achieved.
Patent Information
- Application Number
- CN202411780576.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-12-05
AI Technical Summary
When the existing technology automatically reviews the content of the contract, it is difficult to logically correlate across parts, resulting in insufficient reliability of the audit results.
By splitting the contract text into multiple text blocks and using the preset NLP model and CoT mechanism, block review and content extraction are carried out to achieve cross-part logical association and synthesis of audit results.
It improves the efficiency and reliability of contract review, ensures the accuracy of logical reasoning results of contract text, and reduces the amount of calculation and time.
Smart Images

Figure CN119249109B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device, equipment and medium for intelligent contract review based on content extraction. Background Art
[0002] At present, a large number of contracts need to be reviewed in the property management field. For example, in order to provide services to all owners in the community, a contract needs to be generated for each owner, which leads to a large number of contracts that need to be processed. The traditional manual review method can no longer meet the needs. With the development of natural language processing (NLP) technology, some large models that can automatically review the content of contracts have emerged. The contract text is obtained by scanning the paper contract through optical character recognition (OCR) technology, and then the contract text is input into the large model for automatic review.
[0003] Since the contract text is usually long, if the contract text is audited as a whole in a large model, it will result in too much calculation and too long calculation time. Therefore, the existing technology usually treats each chapter or page of the contract text as a part, and inputs each part into the large model for recognition in turn. However, the existing technology only outputs the audit results for each part separately. If the relevant content is divided into different parts, logical errors will be found in the audit due to missing text; if the content of two parts is inconsistent, the large model will not be able to recognize it and judge it as passed. Therefore, the reliability of the audit results of the existing technology cannot be guaranteed. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a content extraction-based intelligent contract review method, device, equipment, and medium, which can divide a contract into multiple parts for review and can perform logical association across the parts, thereby improving the efficiency and reliability of contract review.
[0005] In a first aspect, an embodiment of the present invention provides a content extraction-based intelligent contract audit method, which is applied to a preset NLP model, wherein the NLP model is preset with audit rules and a CoT mechanism, wherein the audit rules include multiple preset audit items, and the method includes:
[0006] Sequentially split the contract text into multiple text blocks, and sequentially traverse each of the text blocks;
[0007] Determine the text block currently traversed as the target block, and determine the block review result of the target block based on the NLP model, wherein the block review result includes the candidate review results and associated text sequences corresponding to each of the preset review items, and when the target block is the first text block, the input of the NLP model includes the target block, or, when the target block is not the first text block, the input of the NLP model includes the target block and the block review result of the last traversed text block;
[0008] Determine each of the candidate audit results of the last block audit result as a target audit result, and input all of the target audit results and the corresponding associated text sequences into the NLP model;
[0009] Based on any pair of associated target audit results and associated text sequences, extracting content through the NLP model based on the CoT mechanism to obtain target audit information;
[0010] Generate a text audit result based on all the preset audit items and the corresponding target audit information.
[0011] According to some embodiments of the present invention, before splitting the contract text into multiple text blocks in sequence, the method further includes:
[0012] Acquire multiple contract images, wherein the multiple contract images belong to the same target contract;
[0013] Performing OCR recognition on each of the contract images in order to obtain image recognition information and page number information corresponding to each of the contract images, wherein the image recognition information includes recognized text or signature images;
[0014] When the image recognition information does not include the signature image, determining the recognition text as the image text of the contract image;
[0015] Alternatively, when the image recognition information includes the signature image, the signature text of the signature image is obtained based on text recognition, and the recognition text and the signature text are arranged in sequence into the image text;
[0016] All the image texts are sorted based on the page number information to obtain the contract text.
[0017] According to some embodiments of the present invention, the contract text is sequentially split into multiple text blocks, including:
[0018] Based on the contract text of the first contract image, determining a target type from a plurality of preset contract types;
[0019] Determining the audit rule from a plurality of preset optional rules based on the target type, wherein each of the optional rules corresponds to at least one of the contract types;
[0020] At least one target separator is determined from a plurality of preset separators based on the target type, and the contract text is split into a plurality of text blocks based on the target separator, wherein each contract type is associated with at least one preset separator, and each preset separator is different from each other.
[0021] According to some embodiments of the present invention, the plurality of preset audit items include a plurality of format audit items and a plurality of content audit items, and when the target block is the first text block, determining a block audit result of the target block based on the NLP model includes:
[0022] Based on any of the format review items, traverse the target block to determine a format review result;
[0023] Based on any of the content audit items, determining a first text sequence corresponding to the content audit item from the first target block, and determining a content audit result based on the first text sequence and the content audit item;
[0024] The format audit result and the content audit result are respectively determined as the candidate audit results, and the block audit result is constructed based on all the candidate audit results and the corresponding preset audit items.
[0025] According to some embodiments of the present invention, after respectively determining the format review result and the content review result as the candidate review results, the method further includes:
[0026] When the format review result indicates that the review is passed, the preset first description information is determined as the associated text sequence;
[0027] When the format audit result indicates an audit anomaly, combining at least one text set in which the anomaly is identified into the associated text sequence, the text set including a plurality of continuous text characters;
[0028] When the content review result indicates that the review is passed, determining the first text sequence as the associated text sequence;
[0029] When the content audit result indicates an audit anomaly, anomaly analysis information is generated based on the first text sequence, and the first text sequence and the anomaly analysis information are combined into the associated text sequence.
[0030] According to some embodiments of the present invention, when the target block is not the first text block, determining a block review result of the target block based on the NLP model includes:
[0031] Based on the block audit result of the previous text block of the target block, the associated text sequence of the format audit result characterizing the audit anomaly is determined as a first reference sequence, and the associated text sequence of the content audit result is determined as a second reference sequence;
[0032] splicing the first reference sequence and the target block into a second text sequence, and based on any of the format review items, traversing the second text sequence to determine the format review result of the target block;
[0033] Based on any of the content review items, determine the first text sequence from the previous target block, and determine the format review result of the target block based on the content review item, the first text sequence and the second reference sequence;
[0034] The format audit result and the content audit result are respectively determined as the candidate audit results, and the block audit result is constructed based on all the candidate audit results and the corresponding preset audit items.
[0035] According to some embodiments of the present invention, generating a text audit result based on all the preset audit items and the corresponding target audit information includes:
[0036] Based on the target audit result corresponding to the preset audit item, determining a corresponding audit mark, wherein the audit mark is used to indicate whether the audit is passed or not;
[0037] Constructing a visual table, determining the associated preset audit items, the audit marks and the target audit information as a group of table units;
[0038] Input each group of the table cells into the visual table in sequence to obtain the text review result.
[0039] In a second aspect, an embodiment of the present invention provides a content extraction-based intelligent contract audit device, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the content extraction-based intelligent contract audit method as described in the first aspect above.
[0040] In a third aspect, an embodiment of the present invention provides an electronic device, comprising the content extraction-based intelligent contract review device as described in the second aspect above.
[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the content extraction-based intelligent contract review method as described in the first aspect above.
[0042] According to the content extraction-based intelligent contract audit method of the embodiment of the present invention, there are at least the following beneficial effects: the contract text is divided into multiple text blocks in sequence, and each of the text blocks is traversed in sequence; the text block currently traversed is determined as the target block, and the block audit result of the target block is determined based on the NLP model, wherein the block audit result includes the candidate audit results and the associated text sequence corresponding to each of the preset audit items, when the target block is the first text block, the input of the NLP model includes the target block, or, when the target block is not the first text block, the input of the NLP model includes the target block and the block audit result of the last traversed text block; each of the candidate audit results of the last block audit result is determined as the target audit result, and all of the target audit results and the corresponding associated text sequences are input into the NLP model; based on any pair of associated target audit results and the associated text sequences, the target audit information is obtained by performing content extraction based on the CoT mechanism through the NLP model; and a text audit result is generated based on all of the preset audit items and the corresponding target audit information. According to the technical solution of the embodiment of the present invention, the contract text can be reviewed in blocks. When executing the review of the next-level target block, the candidate review results of the previous level are used as reference information for the preceding content and input into the NLP model together with the next-level target block. The CoT mechanism is used to realize the associated logical reasoning of multiple text blocks in the recognition of one target block, so that the target review result finally outputted can represent the logical reasoning result of the entire contract text, thereby improving the reliability of the contract review with less computational effort. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a schematic diagram of the processing flow of the NLP model provided by one embodiment of the present invention;
[0044] Figure 2 is a flow chart of a content extraction-based intelligent contract review method provided by an embodiment of the present invention;
[0045] Figure 3 is a complete flow chart of a content extraction-based intelligent contract review method provided by another embodiment of the present invention;
[0046] Figure 4 It is a structural diagram of a content extraction-based intelligent contract review device provided by another embodiment of the present invention. DETAILED DESCRIPTION
[0047] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0048] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0049] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0050] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution.
[0051] The following is an explanation of the terms involved in this application:
[0052] Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics, but there are important differences. Natural language processing is not a general study of natural language, but the development of computer systems that can effectively realize natural language communication, especially the software systems therein. Therefore, it is part of computer science.
[0053] Chain-of-Thought Prompting (CoT) technology is an important part of Natural Language Processing (NLP) technology. It can enhance the model reasoning ability by providing a series of prompts of intermediate reasoning steps to the large model.
[0054] Optical Character Recognition (OCR): It is a technology that can directly convert the text content on pictures and photos into editable text format. Through OCR technology, text information can be quickly extracted from various documents, greatly improving the efficiency of data entry and processing.
[0055] Few-shot learning is a machine learning method that aims to train the model using very few labeled samples and enable it to have good generalization ability.
[0056] The embodiments of the present invention provide a method, apparatus, device, and medium for intelligent contract auditing based on content extraction, wherein the method for intelligent contract auditing based on content extraction includes: splitting the contract text into multiple text blocks in sequence, and traversing each of the text blocks in sequence; determining the text block currently traversed as the target block, and determining the block audit result of the target block based on the NLP model, wherein the block audit result includes the candidate audit results and associated text sequences corresponding to each of the preset audit items, and when the target block is the first text block, the input of the NLP model includes the target block, or when the target The block is not the first text block, and the input of the NLP model includes the target block and the block audit result of the last traversed text block; each candidate audit result of the last block audit result is determined as the target audit result, and all the target audit results and the corresponding associated text sequence are input into the NLP model; based on any pair of associated target audit results and associated text sequences, the NLP model performs content extraction based on the CoT mechanism to obtain target audit information; and generates text audit results based on all the preset audit items and the corresponding target audit information. According to the technical solution of the embodiment of the present invention, the contract text can be audited in blocks. When performing the audit of the next-level target block, the candidate audit results of the previous level are used as reference information of the preceding content and are input into the NLP model together with the next-level target block. The CoT mechanism is used to realize the associated logical reasoning of multiple text blocks in the recognition of a target block, so that the target audit result finally output can represent the logical reasoning result of the entire contract text, and the reliability of the contract audit is improved with less computational effort.
[0057] The technical solution of the embodiment of the present invention is further described below based on the accompanying drawings.
[0058] Reference Figure 2 , Figure 2 A flowchart of a content extraction-based intelligent contract audit method provided by an embodiment of the present invention. The content extraction-based intelligent contract audit method is applied to a preset NLP model. The NLP model is preset with audit rules and CoT mechanism. The audit rules include multiple preset audit items. The method includes:
[0059] The intelligent contract review method based on content extraction includes but is not limited to the following steps:
[0060] S10, splitting the contract text into multiple text blocks in order, and traversing each text block in order;
[0061] S20, determining the currently traversed text block as the target block, and determining the block review result of the target block based on the NLP model, wherein the block review result includes the candidate review results and the associated text sequence corresponding to each preset review item, and when the target block is the first text block, the input of the NLP model includes the target block, or, when the target block is not the first text block, the input of the NLP model includes the target block and the block review result of the last traversed text block;
[0062] S30, determining each candidate audit result of the last block audit result as a target audit result, and inputting all the target audit results and the corresponding associated text sequences into the NLP model;
[0063] S40, based on any pair of associated target audit results and associated text sequences, extracting content through the NLP model based on the CoT mechanism to obtain target audit information;
[0064] S50, generating a text audit result based on all preset audit items and corresponding target audit information.
[0065] It should be noted that the contract text is divided into multiple text blocks in sequence, and each text block is logically independent. For example, each text block corresponds to a chapter, a paragraph, a clause or a sentence of the contract text. The specific division granularity can be set according to actual needs. Multiple text blocks are continuous and arranged in sequence. For example, each chapter of the contract text is divided into a text block, which is text block 1 corresponding to the first chapter and text block 2 corresponding to the second chapter. It is ensured that all text and symbols of the contract text are recorded in the corresponding text blocks to avoid errors in logical analysis caused by missing text.
[0066] It should be noted that the NLP model is preset with a CoT mechanism, and a Zero-shot mechanism and a few-shot mechanism can also be set to improve the model's predictive ability, and multiple preset audit items are set in the audit rules, with each preset audit item as a question for the NLP model to trigger the CoT mechanism to perform a series of intermediate reasoning to enhance the reasoning ability of the NLP model, so that the NLP model answers each preset audit item based on the target block, thereby obtaining the candidate audit results corresponding to each preset audit item, and the text of the inferred candidate audit results is used as an associated text sequence. The CoT mechanism is a technology well known to those skilled in the art, and the specific principles will not be elaborated here.
[0067] For example, Figure 1 As shown, the questions of the preset audit items include "core content of the contract", "whether there are conflicting clauses in the contract", "there are blank spaces in the contract", and "whether there are typos in the contract". After the text block 1 is input into the NLP model, the NLP model identifies the "contract clause" from the text block 1, and considers that the contract clause belongs to the core content of the contract. The text content of the corresponding contract clause is used as the associated text sequence, and the serial number of the contract clause is output as the candidate audit result. For example, the text block includes contract clause 1, the content is XXX, the candidate audit result is contract clause 1, and the associated text sequence is XXX.
[0068] For another example, the NLP model reviews whether there are conflicts among multiple contract clauses in text block 1. When it detects that the contents of clause 1 and clause 2 conflict with each other, it takes the specific contents of clause 1 and clause 2 as associated text sequences and outputs "clause 1" and "clause 2" as candidate review results.
[0069] It should be noted that, after obtaining multiple text blocks, this embodiment determines each text block as a target block in turn, and inputs each text block into the NLP model for review one by one. For example, Figure 1 As shown, the contract text is divided into text block 1, text block 2, ... text block N (N is an integer greater than 2), text block 1 is input into the NLP model to obtain block audit result 1, text block 2 and block audit result 1 are input into the NLP model to output block audit result 2, block audit result 2 and text block 3 are input into the NLP model to obtain block audit result 3, and so on to achieve iterative audit. Figure 1 The multiple NLP models shown in are the same model. In order to better express the data iteration relationship, multiple NLP models are used for illustration and will not be repeated later.
[0070] It should be noted that each audit involves each of the above-mentioned preset audit blocks. For the content that is not involved, the candidate audit result can be output as empty. For example, when checking "whether the contract has conflicting terms" for text block 2, text block 2 does not involve the contract terms, then the candidate audit result is determined to be not involved, and the audit is determined to be passed. In this embodiment, for each text block, the candidate audit results and associated text sequences corresponding to all preset audit items are obtained, and all candidate audit results and associated text sequences are combined into a block audit result.
[0071] For example, the audit rules include 10 preset audit items. After text block 1 is input into the NLP model, 10 candidate audit results and 10 related text sequences are obtained, which correspond to the 10 preset audit items respectively. The 10 candidate audit results and 10 related text sequences are combined to obtain the block audit result of text block 1. The block audit result of each text block includes all 10 candidate audit results and 10 related text sequences.
[0072] It should be noted that since the text blocks in this embodiment are arranged in sequence, when the traversed text block is the first text block, that is, the front-end content of the contract text, there is no preceding content to refer to, and therefore the input of the NLP model only includes the target block. The input and output of the first target block will not be elaborated here.
[0073] It should be noted that when the target block is not the first text block, the block review result of the previous text block has been output through the NLP model, and the block review result includes the candidate review results and associated text sequences of each preset review item. According to the description of the above embodiment, the associated text sequence records the text content corresponding to the preset review item, and the content of the associated text sequence is less than the content of the text block. Therefore, in this embodiment, the block review result of the previous text block is used as the simplified content of the text block content corresponding to a preset review item, and the block review result of the previous text block is input into the next target block, which can form a continuous logic on the content required by the same preset review item and realize association analysis through content iteration.
[0074] For example, text block 1 and text block 2 are distinguished by page numbers, and the contract terms of text block 1 are the first few contract terms of text block 2. Therefore, the block review results of text block 1 extracted based on the contract terms are input into the NLP model together with text block 2. The NLP model can construct the associated text sequence of the block review results of text block 1 and text block 2 into multiple continuous contract terms. When conducting relevant reviews, not only the terms content of text block 2 is considered, but also the associated text sequence of text block 1 based on the CoT mechanism, so as to perform correlation reasoning on multiple contract terms distributed across pages, thereby improving the reliability of content review.
[0075] For another example, text block 1 and text block 2 are distinguished by chapters, the contract terms of text block 1 include content xxx, and the contract terms of text block 2 include content yyy. If the two text blocks are reviewed independently, even if content xxx and content yyy conflict with each other, the review results of content xxx and content yyy are both approved when they are reviewed independently. However, this embodiment inputs the block review result with content XXX and text block 2 into the NLP model together. When reviewing the preset review item "whether the terms conflict", the NLP model can identify that content xxx and content yyy conflict with each other, thereby improving the continuity and reliability of content review. Compared with content recognition of the contract text as a whole, this embodiment can use the block review result as a simplified content representation of the upper-level text block, effectively reducing the calculation input of the NLP model, and realizing the logical association before and after while improving the calculation accuracy.
[0076] It should be noted that after obtaining the last block audit result, based on the principle of the above-mentioned iterative block audit results, it can be determined that each candidate audit result of the last block audit result is associated with the content of the entire contract text. Therefore, each candidate audit result of the last block audit result can be determined as the target audit result of the corresponding preset audit item. Each target audit result records all relevant content of each preset audit item. Therefore, this embodiment further inputs the target audit result and the associated text sequence into the NLP model again, and performs content extraction in the target audit result through the NLP model. In each preset audit item, the target audit result and the associated text sequence are converted into a simple structured text to reduce content display, making the target audit information more concise.
[0077] Exemplarily, taking the preset audit item of "whether there are blank spaces in the contract" as an example, the target audit results obtained include that file block 1 does not have blank spaces, file block 2 does not have blank spaces, file block 3 has blank spaces, file block 4 has blank spaces,..., file block N does not have blank spaces. If the full amount is displayed, the target audit information is rather bloated. When extracting content based on the CoT mechanism, this embodiment infers that it is only necessary to inform the user of the file blocks with blank spaces. Therefore, the associated text sequences corresponding to file blocks 3 and file block 4 are extracted, and the obtained target audit information includes "there is a blank space in the first line of file block 3, and there is a blank space in the last line of file block 4", thereby simplifying the displayed information.
[0078] It should be noted that after obtaining the target audit information of each preset audit item, all preset audit items can be summarized to obtain the text audit result, for example, Figure 1 As shown, each preset audit item is displayed in the form of a list, thereby realizing the visualization of the target audit information and improving the ease of use of contract audit.
[0079] In addition, in one embodiment, referring to Figure 3 Before executing step S10, the method further includes but is not limited to the following steps:
[0080] S01, obtaining multiple contract images, wherein the multiple contract images belong to the same target contract;
[0081] S02, performing OCR recognition on each contract image in order to obtain image recognition information and page number information corresponding to each contract image, wherein the image recognition information includes recognized text or signature image;
[0082] S03, when the image recognition information does not include the signature image, determining the recognized text as the image text of the contract image;
[0083] S04, when the image recognition information includes a signature image, obtaining the signature text of the signature image based on text recognition, and arranging the recognition text and the signature text in order into an image text;
[0084] S05, sorting all the image texts based on the page number information to obtain the contract text.
[0085] It should be noted that the contract text of this embodiment is obtained through OCR technology. The operator can obtain multiple contract images by scanning or taking pictures, and identify the image recognition information from the contract images through OCR technology. Unlike general document recognition, seals and signatures need to be considered when reviewing contracts. Therefore, when performing OCR recognition, this embodiment not only obtains the recognized text, but also further identifies the signature image, which is convenient for reviewing whether the contract lacks a signature. It is worth noting that OCR recognition is a technology well known to those skilled in the art, and will not be elaborated on here.
[0086] It should be noted that when the image recognition information does not include the signature image, it can be determined that the contract image only includes text content, and the recognized text can be determined as the image text of the contract image. When the signature image is included, this embodiment converts the signature image into signature text through text recognition, for example, the text content in the seal is recognized through text, and the signature text can be converted into structured data. For example, if the text in the seal is "XX Company", the signature text is "Seal-XX Company", so that in the subsequent review process, the seal text can be recognized as the content of the seal, rather than the text in the contract.
[0087] It should be noted that, since OCR recognition can obtain page number information, this embodiment relies on the sequential arrangement of text blocks, so multiple image texts can be arranged into a contract text by using page number information to ensure the accuracy of the order of the contract text.
[0088] In addition, in one embodiment, referring to Figure 3Step S10 specifically includes but is not limited to the following steps:
[0089] S11, determining a target type from a plurality of preset contract types based on the contract text of the first contract image;
[0090] S12, determining a review rule from a plurality of preset optional rules based on the target type, wherein each optional rule corresponds to at least one contract type;
[0091] S13, determining at least one target separator from a plurality of preset separators based on the target type, and splitting the contract text into a plurality of text blocks based on the target separator, wherein each contract type is associated with at least one preset separator, and each preset separator is different from each other.
[0092] It should be noted that after the image text is recognized through OCR, the contract has a strict format. Usually, the first contract image will have a descriptive text of the contract type, such as the management service contract between the property and the owner, the public maintenance contract between the property and the owner, the parking space purchase contract, etc. The type of contract is usually reflected in the text on the first page. Therefore, this embodiment can determine the target type of the target contract through simple text recognition based on the contract text of the first contract image.
[0093] It should be noted that the present embodiment sets multiple optional rules, each optional rule corresponds to at least one contract type, so as to realize flexible review of different contract types, and at least one preset review item of each optional rule is different. For example, in a property maintenance contract, the amount of each maintenance item needs to be involved, and it is necessary to review whether all maintenance items are included in the contract content. However, for a parking space purchase contract, there is no need to review the maintenance items, but it is necessary to review whether the location of the parking space and the property rights period are recorded in the contract. The present embodiment provides multiple optional rules, which can provide a basis for different contract review needs and realize flexible configuration of review rules.
[0094] It should be noted that after determining the target type of the contract, this embodiment further sets different preset delimiters for each contract type, matches at least one target delimiter through the target type, and uses the target delimiter to split the contract text into multiple text blocks. The preset delimiter can be a period, a paragraph break, a page break, a chapter break, etc. Splitting the contract text by the target delimiter can ensure that each text block has complete logic. The target delimiter corresponding to each contract type can be selected according to actual needs, and the number can be arbitrary. For example, the parking space purchase contract is relatively short, and the text block segmentation with chapter delimiters can also meet the computational efficiency requirements of the NLP model. The management service contract is relatively long, and paragraph breaks and page breaks are required as delimiters to divide the management service contract into more text blocks. Then, the principle of iterative block audit results of the text blocks of this embodiment is used to ensure that continuous logical audit can be achieved after multiple text blocks are divided.
[0095] In addition, in one embodiment, referring to Figure 3 The multiple preset review items include multiple format review items and multiple content review items. When the target block is the first text block, step S20 specifically includes but is not limited to the following steps:
[0096] S211, based on any format review item, traverse the target block to determine the format review result;
[0097] S212, based on any content review item, determining a first text sequence corresponding to the content review item from the first target block, and determining a content review result based on the first text sequence and the content review item;
[0098] S213, determining the format review result and the content review result as candidate review results respectively, and constructing a block review result based on all the candidate review results and the corresponding preset review items.
[0099] It should be noted that the preset audit items of this embodiment include two types: format audit items and content audit items. The format audit items are used to audit whether there are defects in the format of the text block, for example Figure 1 The "whether there are blank spaces in the contract" and "whether there are typos in the contract" items shown are used to review whether the content of the text block meets the standards, for example Figure 1 As shown: "Core content of the contract" and "Whether there are conflicting clauses in the contract", of course, format review items or content review items can be increased or decreased according to actual needs. This embodiment does not limit the number and type of specific preset review items.
[0100] It should be noted that the first text block does not involve the iterative recognition of this embodiment. The NLP model only reviews the first text block. After the first text block is input into the NLP model, since each format review item targets different contents, the entire target block can be traversed through each format review item to determine the format review result. For example Figure 1 Check whether there are blank spaces or typos in the text shown.
[0101] It should be noted that each content review item targets different content. For example, the "core content of the contract" needs to extract the "core content" from the contract terms, so the first text sequence corresponding to the content review item is each contract term; for another example, the content review item is "whether the attachment title listed in the contract body is consistent with the actual attachment title", so the first text sequence corresponding to the content review item is each attachment title. In the NLP model, you can configure the object type or keyword targeted by each content review item, and locate the first text sequence from the target block through the object type or keyword.
[0102] It should be noted that after obtaining the content review results and format review results, both results are determined as corresponding candidate review results, and then each candidate review structure is associated with the corresponding preset review item to obtain the block review result, and the block review result of the first text block is input into the second text block.
[0103] In addition, in one embodiment, referring to Figure 3 After executing step S23, the method further includes but is not limited to the following steps:
[0104] S231, when the format review result indicates that the review is passed, the preset first description information is determined as an associated text sequence;
[0105] S232, when the format audit result indicates an audit anomaly, combining at least one text set in which the anomaly is identified into an associated text sequence, the text set including a plurality of continuous text characters;
[0106] S233, when the content review result indicates that the review is passed, the first text sequence is determined as a related text sequence;
[0107] S234, when the content audit result indicates an audit anomaly, abnormality analysis information is generated based on the first text sequence, and the first text sequence and the abnormality analysis information are combined into an associated text sequence.
[0108] It should be noted that, for the format review, the text part that does not conform to the format in the contract is mainly identified. If the entire target block meets the format requirements, the format review result is passed. Since there is no text part that does not conform to the format, this embodiment uses the preset first description information as the associated text sequence. The first description information can indicate that the format review item is reviewed and passed, for example Figure 1 As shown, the first description information of "whether there are blank spaces in the contract" is "there are no blank spaces in the contract". Even if the next text block is input, it can be determined that the previous text block "does not have blank spaces" based on the associated text sequence.
[0109] It should be noted that when the format review result represents an audit anomaly, the text set when the anomaly is identified is combined into an associated text sequence. Each text set can be a section of image text or signature text. For example, if a typo is identified in a section, the position of the typo and the typo are taken as a text set. When a text block recognizes multiple text sets, all the text sets are sorted according to the position of the text to obtain an associated text sequence. For example, there are typos in the first and third lines of text block 1. The first text set is "there is a typo 'Y' in 'XYX' on the first line", and the second text set is "there is a typo 'YZ' in 'XYZ' on the third line". The resulting associated text sequence is "there is a typo 'Y' in 'XYX' on the first line, and there is a typo 'YZ' in 'XYZ' on the third line".
[0110] It should be noted that when the content review result indicates that the review is passed, the first text sequence used for content review is determined as the associated text sequence, for example Figure 1 As shown, after the "core content of the contract" is reviewed and approved, the first text sequence is the content of each clause, and the content of each clause is extracted from the text block and saved as an associated text sequence.
[0111] It should be noted that when the content audit result indicates an audit anomaly, the anomaly analysis information of the first text sequence is determined, and the anomaly analysis information can be obtained from the audit log of the NLP model. For example, when auditing a question based on a preset audit item, it is determined based on an element that the target block is abnormal in the preset audit item, and the element is determined as the anomaly analysis information. Figure 1 As shown, in "Does the contract have conflicting clauses?", it is detected that the clauses in text block 1 conflict with the text clauses in text block 2. The first text sequence includes "Clause 1" and "Clause 2". The generated abnormal analysis information is "Clause 1 and Clause 2 contradict each other". Therefore, the associated text sequence obtained is "Clause 1 of text block 1 and Clause 2 of text block 2 contradict each other".
[0112] In addition, in one embodiment, referring to Figure 3When the target block is not the first text block, step S20 specifically includes but is not limited to the following steps:
[0113] S221, based on the block audit result of the previous text block of the target block, determine the associated text sequence of the format audit result representing the audit anomaly as the first reference sequence, and determine the associated text sequence of the content audit result as the second reference sequence;
[0114] S222, splicing the first reference sequence and the target block into a second text sequence, and based on any format review item, traversing the second text sequence to determine a format review result of the target block;
[0115] S223, based on any content review item, determining a first text sequence from a previous target block, and determining a format review result of the target block based on the content review item, the first text sequence, and the second reference sequence;
[0116] S224, determining the format review result and the content review result as candidate review results respectively, and constructing a block review result based on all the candidate review results and the corresponding preset review items.
[0117] It should be noted that, when reviewing the next target block, according to the description of the above embodiment, the block review result of the previous text block will be input into the NLP model for synchronous review to improve the relevance of the context. After obtaining the block review result of the previous text block, since the preset review items include format review items and content review items, if the format review item is passed, there is no need to splice it with the next target block, and the format review result of the previous text block can be directly merged into the format review result of the next target block. When the format review result indicates an abnormality, the text may have format errors due to the separation of the delimiter. For example, when the text block is divided by a page break, the front and back parts of the last sentence of the previous text block are located on two pages. Therefore, when the format review item is "whether the sentence is smooth", the review result of the last sentence of the previous target block is abnormal. The last sentence is used as the first reference sequence. In this embodiment, the first reference sequence and the target block are directly spliced into the second text sequence, so that the text across pages can remain continuous between the two pages. At this time, when the "whether the sentence is smooth" review is performed based on the second text sequence, it will be determined that the review is passed. Therefore, in this embodiment, when the format review results of the same preset review item for the same first text sequence are different, the format review result of the next text block is the final format review result.
[0118] It should be noted that, for content audit items, the principle of determining the second reference sequence from the current target block can refer to the principle of the first text sequence, and the content to be audited in the target block can be located according to the content audit item, and no further details will be given here. In the content audit process, the content of the text is audited, not the format. Therefore, this embodiment does not need to splice the first text sequence and the second reference sequence, but recognizes the first text sequence and the second reference sequence at the same time. For example, in the above example, the first text sequence is Figure 1 In the "Whether there are conflicting clauses in the contract" shown, after traversing text block 1, "Clause 1 of text block 1" is obtained, which is used as the first text sequence and input into the NLP model together with text block 2. The second reference sequence is "Clause 2 of text block 2". There is no need to splice the two clauses, but they are used as input for content review at the same time to determine whether there is a conflict between the two and obtain the content review result of text block 2.
[0119] In addition, in one embodiment, referring to Figure 3 Step S50 specifically includes but is not limited to the following steps:
[0120] S51, based on the target audit result corresponding to the preset audit item, determining a corresponding audit mark, wherein the audit mark is used to indicate whether the audit is passed or not;
[0121] S52, constructing a visual table, determining the associated preset audit items, audit marks and target audit information as a group of table cells;
[0122] S53, inputting each group of table cells into the visualization table in sequence to obtain the text review result.
[0123] It should be noted that after obtaining each target audit result, this embodiment also performs secondary content extraction on the target audit result and the corresponding associated text sequence. In this process, the final audit result corresponding to each preset audit item can be summarized, and then the corresponding audit mark can be determined. For example, each block audit result can only represent the audit result of the current file block in each preset audit item. After secondary content extraction, the target audit information can represent the final audit result of each preset audit item of the entire contract text. Therefore, in order to improve the degree of visualization, this embodiment determines the audit mark based on the target audit result to represent whether the corresponding preset audit item has passed the audit.
[0124] It should be noted that, due to the large number of preset audit items, this embodiment displays the list in a visual table format. Figure 1As shown, each preset audit item, audit mark and target audit information are displayed in a visual table, and each group of table cells is the audit mark and target audit information corresponding to a preset audit item, thereby realizing a visual display of the text audit results. The audit mark can intuitively reflect whether the corresponding preset audit item has passed, and by displaying the relevant associated text sequence in the target audit information, the streamlined key content can be manually re-checked to improve the reliability of the audit.
[0125] like Figure 4 As shown, Figure 4 1 is a structural diagram of a smart contract audit device based on content extraction provided by an embodiment of the present invention. The present invention also provides a smart contract audit device based on content extraction, comprising:
[0126] The processor 401 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0127] The memory 402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 402 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 402, and the processor 401 calls and executes the intelligent contract audit method based on content extraction in the embodiment of this application;
[0128] Input / output interface 403, used to implement information input and output;
[0129] Communication interface 404, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0130] A bus 405 that transmits information between various components of the device (e.g., processor 401, memory 402, input / output interface 403, and communication interface 404);
[0131] The processor 401 , the memory 402 , the input / output interface 403 and the communication interface 404 are connected to each other in communication within the device via the bus 405 .
[0132] An embodiment of the present application also provides an electronic device, including the above-mentioned content extraction-based intelligent contract review device.
[0133] An embodiment of the present application also provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned content extraction-based intelligent contract review method is implemented.
[0134] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are implemented to be located in one place, or may also be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0135] It will be appreciated by those skilled in the art that all or some of the steps and systems in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media generally include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0136] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A contract intelligent audit method based on content extraction, characterized in that: Applied to a preset NLP model, the NLP model is preset with audit rules and a thinking chain CoT mechanism, the audit rules include multiple preset audit items, and the method includes: Sequentially split the contract text into multiple text blocks, and sequentially traverse each of the text blocks; Determine the text block currently traversed as the target block, and determine the block review result of the target block based on the NLP model, wherein the block review result includes the candidate review results and associated text sequences corresponding to each of the preset review items, and when the target block is the first text block, the input of the NLP model includes the target block, or, when the target block is not the first text block, the input of the NLP model includes the target block and the block review result of the last traversed text block; Determine each of the candidate audit results of the last block audit result as a target audit result, and input all of the target audit results and the corresponding associated text sequences into the NLP model; Based on any pair of associated target audit results and associated text sequences, extracting content through the NLP model based on the CoT mechanism to obtain target audit information; Generate a text audit result based on all the preset audit items and the corresponding target audit information; The plurality of preset audit items include a plurality of format audit items and a plurality of content audit items. When the target block is the first text block, determining a block audit result of the target block based on the NLP model includes: Based on any of the format review items, traverse the target block to determine a format review result; Based on any of the content audit items, determining a first text sequence corresponding to the content audit item from the first target block, and determining a content audit result based on the first text sequence and the content audit item; Determine the format review result and the content review result as the candidate review results respectively, and construct the block review result based on all the candidate review results and the corresponding preset review items; After determining the format review result and the content review result as the candidate review results respectively, the method further includes: When the format review result indicates that the review is passed, the preset first description information is determined as the associated text sequence; When the format audit result indicates an audit anomaly, combining at least one text set in which the anomaly is identified into the associated text sequence, the text set including a plurality of continuous text characters; When the content review result indicates that the review is passed, determining the first text sequence as the associated text sequence; When the content audit result indicates an audit anomaly, generating anomaly analysis information based on the first text sequence, and combining the first text sequence and the anomaly analysis information into the associated text sequence; When the target block is not the first text block, determining a block review result of the target block based on the NLP model includes: Based on the block audit result of the previous text block of the target block, the associated text sequence of the format audit result characterizing the audit anomaly is determined as a first reference sequence, and the associated text sequence of the content audit result is determined as a second reference sequence; splicing the first reference sequence and the target block into a second text sequence, and based on any of the format review items, traversing the second text sequence to determine the format review result of the target block; Based on any of the content review items, determine the first text sequence from the previous target block, and determine the format review result of the target block based on the content review item, the first text sequence and the second reference sequence; The format audit result and the content audit result are respectively determined as the candidate audit results, and the block audit result is constructed based on all the candidate audit results and the corresponding preset audit items.
2. The intelligent contract audit method based on content extraction according to claim 1 is characterized in that: Before splitting the contract text into multiple text blocks in sequence, the method further includes: Acquire multiple contract images, wherein the multiple contract images belong to the same target contract; Performing OCR recognition on each of the contract images in order to obtain image recognition information and page number information corresponding to each of the contract images, wherein the image recognition information includes recognized text or signature images; When the image recognition information does not include the signature image, determining the recognition text as the image text of the contract image; Alternatively, when the image recognition information includes the signature image, the signature text of the signature image is obtained based on text recognition, and the recognition text and the signature text are arranged in sequence into the image text; All the image texts are sorted based on the page number information to obtain the contract text.
3. The intelligent contract audit method based on content extraction according to claim 2 is characterized in that: Split the contract text into multiple text blocks in sequence, including: Based on the contract text of the first contract image, determining a target type from a plurality of preset contract types; Determining the audit rule from a plurality of preset optional rules based on the target type, wherein each of the optional rules corresponds to at least one of the contract types; At least one target separator is determined from a plurality of preset separators based on the target type, and the contract text is split into a plurality of text blocks based on the target separator, wherein each contract type is associated with at least one preset separator, and each preset separator is different from each other.
4. The intelligent contract audit method based on content extraction according to claim 1 is characterized in that: Generating a text audit result based on all the preset audit items and the corresponding target audit information includes: Based on the target audit result corresponding to the preset audit item, determining a corresponding audit mark, wherein the audit mark is used to indicate whether the audit is passed or not; Constructing a visual table, determining the associated preset audit items, the audit marks and the target audit information as a group of table units; Input each group of the table cells into the visual table in sequence to obtain the text review result.
5. A content extraction-based intelligent contract review device, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the content extraction-based contract intelligent audit method as described in any one of claims 1 to 4.
6. An electronic device, characterized in that: Including the content extraction-based intelligent contract review device as described in claim 5.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the content extraction-based intelligent contract review method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Contract auditing method, contract auditing system and readable storage medium
CN114842493A
Electronic signature system and method taking PDF signature as core
CN116842583A