A contract verification method, device, computer equipment and storage medium
The method enhances contract verification by using feature recognition and information extraction to analyze contract images, enabling efficient and accurate compliance verification of complex documents.
Patent Information
- Application Number
- CN202411320127.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-20
AI Technical Summary
Existing contract verification methods struggle with accurately and efficiently verifying complex and diverse contract documents, especially when manual verification is not allowed and only photos of the documents are available.
A method involving feature recognition and information extraction to identify and verify contracts by analyzing image sets of contract documents, determining contract types, and extracting relevant field information based on compliance requirements.
Facilitates faster and more accurate contract verification by automatically identifying and extracting information from contract images, improving efficiency and compliance verification results.
Smart Images

Figure CN118863813B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a contract verification method, apparatus, computer equipment and storage medium. Background Art
[0002] In some contract document verification scenarios, it is usually necessary to perform compliance verification on the content in the contract document. However, in some cases, it is not allowed to directly verify the original contract document. Instead, you can take a photo of the original contract document to obtain the contract document photo, and then verify the content in the contract document photo.
[0003] However, the content of contract documents is complex and diverse. Especially for a large number of contract documents, it is difficult to quickly and accurately complete the verification of contract documents by manual verification. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a contract verification method, apparatus, computer equipment and storage medium.
[0005] In a first aspect, an embodiment of the present disclosure provides a contract verification method, including:
[0006] Obtain a contract image set of the contract document to be verified; the contract image set includes contract images arranged in order; each of the contract images corresponds to a contract page;
[0007] By performing feature recognition on each contract image in the contract image set, determining each contract to be verified contained in the contract document to be verified and the contract type of the contract to be verified, and extracting the text content of each contract to be verified;
[0008] Determine, according to the contract type of each contract to be verified, the information extraction field corresponding to the contract to be verified;
[0009] According to the information extraction field, extracting field information under the information extraction field from the text content of the contract to be verified;
[0010] For each contract to be verified, according to the compliance requirements for different types of information extraction fields under the contract type of the contract to be verified, information verification is performed on the field information under each information extraction field to obtain a compliance verification result for the contract to be verified.
[0011] In an optional implementation, the method of performing feature recognition on each contract image in the contract image set, determining each contract to be verified contained in the contract document to be verified, and the contract type of the contract to be verified, and extracting the text content of each contract to be verified, includes:
[0012] Performing feature extraction processing on each contract image in the contract image set to obtain image features of each contract image;
[0013] Determining the contract type to which each of the contract images belongs according to the image features;
[0014] According to the arrangement order of the contract images in the contract image set, consecutive contract images belonging to the same contract type are divided into the same contract to be verified, so as to obtain contract images belonging to the same contract to be verified;
[0015] The contract type of each contract image classified into the same contract to be verified is used as the contract type of the contract to be verified, and the text content of each contract image included in the contract to be verified is extracted.
[0016] In an optional implementation manner, after extracting the field information under the information extraction field from the text content of the contract to be verified, and before performing information verification on the field information under each of the information extraction fields, the method further includes:
[0017] According to the target type of the information extraction field, determining whether the information format of the field information conforms to the target format corresponding to the target type;
[0018] If not, the field information is processed according to the target format to obtain the field information in the target format.
[0019] In an optional implementation manner, according to the information extraction field, extracting field information under the information extraction field from the text content of the contract to be verified includes:
[0020] Inputting each of the information extraction fields and the text content into a trained field information extraction model, and using the trained field information extraction model to extract field information under each information extraction field from the text content;
[0021] For each information extraction field, the field information under the information extraction field whose confidence ranks in the top N positions is determined in descending order; N is a positive integer greater than or equal to 1.
[0022] In an optional implementation manner, the trained field information extraction model is determined according to the following steps:
[0023] Obtaining target text content of each sample contract; the target text content is obtained by annotating the original text content of the sample contract according to the preset information extraction field;
[0024] The target text content of some sample contracts is used as a training sample set, inputted into the field information extraction model, and the field information extraction model is trained to obtain a currently trained field information extraction model;
[0025] The target text contents of the remaining sample contracts are used as a test sample set and input into the currently trained field information extraction model to obtain test field information;
[0026] Determining the test result according to the test field information and the field information marked in the test sample set;
[0027] If the test result indicates that the preset requirements are met, the currently trained field information extraction model is used as the trained field information extraction model; if the test result indicates that the preset requirements are not met, the step of inputting the training sample set into the field information extraction model, training the field information extraction model, and obtaining the currently trained field information extraction model is continued until a trained field information extraction model is obtained.
[0028] In an optional implementation manner, extracting field information under the information extraction field from the text content of the contract to be verified includes:
[0029] Determining, from the text content of the contract to be verified, field description information that matches the information extraction field;
[0030] If the field description information directly corresponds to the information extraction field, extracting the field information from the field description information;
[0031] If the information extraction field indirectly corresponds to the field description information, the information to be processed is extracted from the field description information, and the information to be processed is processed to obtain the field information.
[0032] In an optional implementation, the information extraction field includes the number of seals and the number of signatures; the field description information includes seal information and signature information; the compliance requirements include requirements on the number of seals and the number of signatures;
[0033] Extracting the information to be processed from the field description information, and processing the information to be processed to obtain the field information, including:
[0034] After extracting the seal information and signature information from the contract image of the contract to be verified, the number of seals is determined according to each of the seal information, and the number of signatures is determined according to each of the signature information.
[0035] In a second aspect, the present disclosure also provides a contract verification device, including:
[0036] An acquisition module, used to acquire a contract image set of the contract document to be verified; the contract image set includes contract images arranged in order; each of the contract images corresponds to a contract page;
[0037] A first extraction module is used to determine the contracts to be verified contained in the contract document to be verified and the contract type of the contract to be verified by performing feature recognition on each contract image in the contract image set, and extract the text content of each contract to be verified;
[0038] A determination module, used to determine the information extraction field corresponding to the contract to be verified according to the contract type of each contract to be verified;
[0039] A second extraction module, configured to extract field information under the information extraction field from the text content of the contract to be verified according to the information extraction field;
[0040] The verification module is used to verify the field information under each information extraction field for each contract to be verified, according to the compliance requirements of different types of information extraction fields under the contract type of the contract to be verified, so as to obtain the compliance verification result for the contract to be verified.
[0041] In a third aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps in the above-mentioned first aspect, or any optional implementation of the first aspect are performed.
[0042] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect, or any optional implementation of the first aspect are executed.
[0043] The contract verification method provided by the embodiment of the present disclosure can, after obtaining a contract image set of the contract document to be verified, determine the various contracts to be verified contained in the contract document to be verified and the contract type of the contract to be verified by performing feature recognition on each contract image in the contract image set, and extract the text content of each contract to be verified. Then, information extraction fields of the contract to be verified can be extracted in a targeted manner for different contract types, and then information verification can be performed on the field information under each information extraction field according to the compliance requirements of different types of information extraction fields. The above process can not only perform targeted verification on contracts to be verified of different contract types, but also verify the text content of the contract to be verified by automatically extracting information extraction fields and extracting field information, so that the verification process is faster and more accurate, thereby improving the efficiency of contract verification.
[0044] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0046] Figure 1 A flow chart of a contract verification method provided by an embodiment of the present disclosure is shown;
[0047] Figure 2 A schematic diagram showing the structure of a field information extraction model provided by an embodiment of the present disclosure is shown;
[0048] Figure 3 A schematic diagram of the structure of a contract verification device provided by an embodiment of the present disclosure is shown;
[0049] Figure 4 A schematic diagram of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0051] In some contract document verification scenarios, it is usually necessary to perform compliance verification on the contents of the contract document. However, in some scenarios, such as when a project auditor reviews a contract document, the project auditor is not allowed to take the original contract document away for verification, but can take a photo of the original contract document, obtain a photo of the contract document, and then verify the contents of the photo of the contract document.
[0052] However, the content of contract documents is complex and diverse. Especially for a large number of contract documents, it is difficult to quickly and accurately complete the verification of contract documents by manual verification.
[0053] Based on this, the present disclosure provides a contract verification method, including: obtaining a contract image set of a contract document to be verified; the contract image set includes contract images arranged in order; each contract image corresponds to a contract page; by performing feature recognition on each contract image in the contract image set, determining each contract to be verified contained in the contract document to be verified, and the contract type of the contract to be verified, and extracting the text content of each contract to be verified; according to the contract type of each contract to be verified, determining the information extraction field corresponding to the contract to be verified; according to the information extraction field, extracting the field information under the information extraction field from the text content of the contract to be verified; for each contract to be verified, according to the compliance requirements of different types of information extraction fields under the contract type of the contract to be verified, performing information verification on the field information under each information extraction field, and obtaining the compliance verification result for the contract to be verified. The above process can not only perform targeted verification on contracts to be verified of different contract types, but also verify the text content of the contract to be verified by automatically extracting the information extraction field and extracting the field information, so that the verification process is faster and more accurate, thereby improving the efficiency of contract verification.
[0054] The defects existing in the above schemes and the proposed solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0055] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0056] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0057] To facilitate understanding of this embodiment, a contract verification method disclosed in the embodiment of the present disclosure is first introduced in detail. The executor of the contract verification method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities.
[0058] See also Figure 1 FIG. 1 is a flow chart of a contract verification method provided by an embodiment of the present disclosure, the method comprising S101 to S105, wherein:
[0059] S101: Obtain a contract image set of the contract document to be verified; the contract image set includes contract images arranged in sequence; each of the contract images corresponds to a contract page.
[0060] S102: Determine the contracts to be verified contained in the contract document to be verified and the contract type of the contracts to be verified by performing feature recognition on each contract image in the contract image collection, and extract the text content of each contract to be verified.
[0061] S103: Determine the information extraction field corresponding to each contract to be verified according to the contract type of each contract to be verified.
[0062] S104: According to the information extraction field, extract the field information under the information extraction field from the text content of the contract to be verified.
[0063] S105: For each of the contracts to be verified, according to the compliance requirements for different types of information extraction fields under the contract type of the contract to be verified, the field information under each information extraction field is verified to obtain a compliance verification result for the contract to be verified.
[0064] In the disclosed embodiment, the contract document to be verified may be formed by integrating multiple original contracts to be verified. The original contract to be verified may be an electronic contract or a paper contract. Each original contract to be verified contains at least one contract page. The contract document to be verified contains the contract pages of each original contract to be verified, and the contract pages in the contract document to be verified are arranged in sequence. By taking photos or scanning at least one contract page of each contract to be verified in any feasible form, the contract images corresponding to each contract page can be obtained. The collection of these contract images is the contract image collection of the contract document to be verified. The arrangement order of the contract images in the contract image collection may be consistent with the arrangement order of the contract pages in the contract document to be verified.
[0065] In some embodiments, a channel processing algorithm may also be used to remove the seal in the red channel of the contract image to reduce the situation where the seal obscures the text content.
[0066] After obtaining the contract image set of the contract document to be verified, feature recognition can be performed on each contract image in the contract image set to determine the contracts to be verified contained in the contract document to be verified, as well as the contract types of the contracts to be verified, and extract the text content of each contract to be verified.
[0067] In the disclosed embodiment, the contract type of the contract to be verified may include multiple types, such as a project construction contract, an equipment purchase contract, a real estate contract, etc. The contract type of the contract to be verified is used to determine the information extraction field according to the contract type when extracting the field information in the text content of the contract to be verified. The specific implementation process will be described in detail later. The following is a detailed description of the process of determining the various contracts to be verified contained in the contract document to be verified, the contract type of the contract to be verified, and extracting the text content of the contract to be verified.
[0068] In one embodiment, feature extraction processing can be performed on each contract image in the contract image set to obtain the image features of each contract image. Then, the contract type to which each contract image belongs can be obtained based on the image features of each contract image. Next, according to the arrangement order of the contract images in the contract image set, the contract images that continuously belong to the same contract type are divided into the same contract to be verified, and the contract images that belong to the same contract to be verified are divided into the same contract to be verified, and the contract images that belong to the same contract to be verified are obtained. Then, the contract type of each contract image divided into the same contract to be verified is used as the contract type of the contract to be verified, and the text content of each contract image contained in the contract to be verified is extracted.
[0069] In the above implementation, the contract picture set can be input into a trained picture processing model, and the feature extraction module in the picture processing model can be used to perform feature recognition on each contract picture in the contract picture set to obtain the picture features of each contract picture. The network structure of the picture processing model includes: a convolution layer and a full pooling average layer. Among them, the feature extraction module can be a convolution layer in the network structure.
[0070] After obtaining the image features of each contract image, the image features of each contract image can be input into the image classification module in the image processing model, and the page category of each contract image can be determined by using the image classification module. The image classification module can be a full pooling average layer in the network structure.
[0071] Then, according to the page category information under each contract type and the page category of each contract image, as well as the arrangement order of the contract images in the contract image set, the contract images that continuously belong to the same contract type are divided into the same contract to be verified, and the contract images that belong to the same contract to be verified are obtained. The contract type of each contract image that is divided into the same contract to be verified is the contract type of the contract to be verified.
[0072] After obtaining the contracts to be verified contained in the contract document to be verified, optical character recognition (OCR) technology may be used to extract text content of each contract image in the contract image group corresponding to the contract to be verified.
[0073] In the disclosed embodiment, field information under corresponding fields in the contract to be verified can be extracted. Field information under different fields can be extracted for contracts of different contract types to be verified. Here, the information extraction field corresponding to the contract to be verified can be determined according to the contract type of each contract to be verified.
[0074] For example, when the contract to be verified is a project construction contract, the corresponding information extraction fields may include: project name, contractor name, contractor name, planned start date, planned completion date, construction period, signing date, etc. When the contract to be verified is an equipment purchase contract, the corresponding information extraction fields may include: buyer, seller, contract amount, signing date, etc. When the contract to be verified is a real estate contract, the corresponding information extraction fields may include: buyer, seller, sales time, sales area, total sales price, etc.
[0075] In the disclosed embodiment, the field information extraction model can be used to extract field information under the information extraction field from the text content of the contract to be verified. Specifically, in one embodiment, each information extraction field and text content can be input into a trained field information extraction model, and the trained field information extraction model can be used to extract field information under each information extraction field from the text content; for each information extraction field, the confidence ranking of the field information under the information extraction field is ranked in the top N positions, and N is a positive integer greater than or equal to 1.
[0076] In the above implementation, each information extraction field can extract multiple field information, and these multiple field information respectively correspond to confidences. The confidence can be determined according to the accuracy and recall of the extracted field information. The accuracy and recall of the field information can be obtained by outputting the field information when the field information is extracted using the field information extraction model. The greater the confidence, the more accurate the field information is. A confidence threshold can be set here. For each information extraction field, according to the confidence of the field information under the information extraction field, in the order of confidence from large to small, the field information with the top N confidence rankings is selected as the field information corresponding to the information extraction field. Here, N can be a positive integer greater than or equal to 1. For example, here, the field information with the top five confidence rankings can be selected as the field information under the information extraction field.
[0077] In other implementations, according to the confidence of the field information under the information extraction field, field information with a confidence greater than a set threshold may be selected as the field information corresponding to the information extraction field.
[0078] By selecting field information with a higher confidence level or selecting field information with a confidence level exceeding a set threshold, more accurate field information can be screened out, thereby obtaining a more accurate verification result.
[0079] Figure 2 A structural schematic diagram of a field information extraction model is shown. Figure 2 The field information extraction model in includes an encoder, an entity extraction module, a relationship extraction module, and a decoder. The encoder can be used to encode the input text content. The entity extraction module can be used to extract multiple entities (i.e., information extraction fields) and categories of multiple information extraction fields. The relationship extraction module can be used to identify the relationship between multiple information extraction fields. The decoder can be used to decode and output different information extraction fields.
[0080] In one implementation, the trained field information extraction module may be determined according to the following steps:
[0081] Step 1: Obtain the target text content of each sample contract; the target text content is obtained by annotating the original text content of the sample contract according to the preset information extraction field.
[0082] Step 2: Use the target text content of part of the sample content as a training sample set, input it into the field information extraction model, train the field information extraction model, and obtain the currently trained field information extraction model.
[0083] Step 3: Use the target text content of the remaining sample contracts as the test sample set and input it into the currently trained field information extraction model to obtain the test field information.
[0084] Step 4: Determine the test results based on the test field information and the field information marked in the test sample set.
[0085] Step 5: If the test result indicates that the preset requirements are met, the currently trained field information extraction model is used as the trained field information extraction model; if the test result indicates that the preset requirements are not met, continue to input the training sample set into the field information extraction model, train the field information extraction model, and obtain the currently trained field information extraction model, until a trained field information extraction model is obtained.
[0086] In the above implementation, the sample contract can be obtained according to the following steps: obtaining a sample contract image set of a sample contract document; the contract image set contains sample contract images arranged in order; each sample contract image corresponds to a sample contract page; and determining each sample contract contained in the sample contract document by performing feature recognition on each sample contract image in the sample contract image set.
[0087] The original text content of each sample contract can be extracted from the sample contract using OCR technology. The target text content of each sample contract can be obtained by annotating the original text content with a annotation tool.
[0088] The target text content of some sample contracts is used as a training sample set and input into the field information extraction model, and the field information extraction model is trained to obtain the currently trained field information extraction model. The currently trained field information extraction model may be a field information extraction model obtained after a preset number of training rounds.
[0089] In order to verify whether the currently trained field information extraction model is trained, the target text content of the remaining sample contracts can be used as a test sample set and input into the currently trained field information extraction model to obtain the test field information, and then the test field information is compared with the field information annotated in the test sample set to obtain the test result. The test result may include information such as the accuracy of the test field information.
[0090] If the test result indicates that the preset requirements are met, it means that the currently trained field information extraction model is a trained field information extraction model; if the test result indicates that the preset requirements are not met, continue to execute the step of inputting the training sample set into the field information extraction model, training the field information extraction model, and obtaining the currently trained field information extraction model until a trained field information extraction model is obtained.
[0091] In one embodiment, when extracting field information, the extraction can also be performed in the following manner: determine the field description information that matches the information extraction field from the text content of the contract to be verified; if the field description information directly corresponds to the information extraction field, extract the field information from the field description information; if the information extraction field indirectly corresponds to the field description information, extract the information to be processed from the field description information, and process the information to be processed to obtain the field information.
[0092] In the above implementation, the text content of the contract to be verified may include field description information. The field description date may be information describing or explaining the information extraction field. The field description information may directly correspond to the information extraction field or may indirectly correspond to the information extraction field.
[0093] For example, the information extraction field is the project date, and the text content of the contract to be verified contains field description information such as the planned start date. The planned start date can be understood as the project date, and the two are equivalent. It can be determined that the field description information directly corresponds to the information extraction field. At this time, the field information can be extracted from the field description information, that is, the time information corresponding to the planned start date.
[0094] For another example, the information extraction field is the number of signatures, and the text content of the contract to be verified contains field description information such as signature information. Obviously, the information extraction field and the field description information are not equivalent, but the number of signatures can be determined based on the signature information under the field description information, that is, the field description information and the information extraction field are indirectly corresponding. At this time, the information to be processed, that is, the signatures, can be extracted from the field description information. The number of signatures can be accumulated to obtain the number of signatures, which is the field information under the information extraction field of the number of signatures (that is, the numerical value corresponding to the number of signatures).
[0095] In an embodiment of the present disclosure, when the compliance requirements include requirements on the number of seals and the number of signatures, the information extraction field includes the number of seals and the number of signatures, and the field description information includes the seal information and the signature information, the step of extracting the information to be processed from the field description information and processing the information to be processed to obtain the field information may include: after extracting the seal information and signature information from the contract image of the contract to be verified, determining the number of seals according to each seal information, and determining the number of signatures according to each signature information.
[0096] Here, the number of seals can be obtained by accumulating the number of seal information; the number of signatures can be obtained by accumulating the number of signature information.
[0097] In the embodiments of the present disclosure, there may be multiple information formats of the field information extracted from the same information extraction field. For example, when the information extraction field is a date or an amount, the numerical value under the date or amount usually has multiple formats, specifically, the date type, such as: 2024.6.20, 2024 / 6 / 20, 2024-6-2, etc., the amount type, such as: 200000000 yuan, 2 million yuan, 200 million yuan, etc. In view of the above situation, in one embodiment, after extracting the field information under the information extraction field from the text content of the contract to be verified, before performing information verification on the field information under each information extraction field, the method further includes: judging whether the information format of the field information conforms to the target format corresponding to the target type according to the target type of the information extraction field; if not, processing the field information according to the target format to obtain the field information under the target format.
[0098] In the above implementation, the target type of the information extraction field may include a numerical type (such as date, amount), a text language type (such as Chinese, English abbreviations), etc. The target format corresponding to the target type may be pre-set. In the case where the information format of the extracted field information does not conform to the target format corresponding to the target type, the field information may be processed according to the target format, that is, the field information is converted into an information format to obtain the field information in the target format.
[0099] In the disclosed embodiment, the types of information extraction fields are different, and the compliance requirements are also different. Here, by performing information verification on the field information under different types of information extraction fields, the compliance verification results for different contracts to be verified are obtained. Exemplarily, for a project construction contract containing the information extraction field of date, the compliance requirements for the field information may include: the contract start date cannot be greater than the contract completion date and the contract start and completion dates should be within this year, and the project name of the contract should not be repeated; for an equipment purchase contract containing the information extraction field of amount, the compliance requirements for the field information may include: the uppercase amount and lowercase amount of the contract need to be consistent; for various types of contracts containing the number of seals and the number of signatures, the compliance requirements for the field information may include: the number of seals and the number of handwritten signatures of the contract need to be greater than 2. According to the comparison rules of the field information of the contract to be verified, the compliance verification is performed on the contract to be verified, and the compliance verification results are given, which can facilitate users to make more reasonable decisions.
[0100] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0101] Based on the same inventive concept, a contract verification device corresponding to the contract verification method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned contract verification method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0102] Reference Figure 3 FIG. 1 is a schematic diagram of a contract verification device provided by an embodiment of the present disclosure, wherein the device comprises:
[0103] The acquisition module 301 is used to acquire a contract image set of the contract document to be verified; the contract image set includes contract images arranged in order; each of the contract images corresponds to a contract page;
[0104] The first extraction module 302 is used to determine the contracts to be verified contained in the contract document to be verified and the contract type of the contracts to be verified by performing feature recognition on each contract image in the contract image set, and extract the text content of each contract to be verified;
[0105] A determination module 303, configured to determine, according to the contract type of each contract to be verified, the information extraction field corresponding to the contract to be verified;
[0106] A second extraction module 304 is used to extract field information under the information extraction field from the text content of the contract to be verified according to the information extraction field;
[0107] The verification module 305 is used to verify the field information under each information extraction field for each contract to be verified, according to the compliance requirements for different types of information extraction fields under the contract type of the contract to be verified, to obtain the compliance verification result for the contract to be verified.
[0108] In an optional implementation manner, the first extraction module 302 is specifically configured to:
[0109] Performing feature extraction processing on each contract image in the contract image set to obtain image features of each contract image;
[0110] Determining the contract type to which each of the contract images belongs according to the image features;
[0111] According to the arrangement order of the contract images in the contract image set, consecutive contract images belonging to the same contract type are divided into the same contract to be verified, so as to obtain contract images belonging to the same contract to be verified;
[0112] The contract type of each contract image classified into the same contract to be verified is used as the contract type of the contract to be verified, and the text content of each contract image included in the contract to be verified is extracted.
[0113] In an optional implementation manner, after executing the step of extracting the field information under the information extraction field from the text content of the contract to be verified, and before executing the step of performing information verification on the field information under each of the information extraction fields, the device further includes:
[0114] A judgment module, used for judging whether the information format of the field information conforms to the target format corresponding to the target type according to the target type of the information extraction field;
[0115] The processing module is used for processing the field information according to the target format to obtain the field information in the target format if it does not meet the requirements.
[0116] In an optional implementation manner, the second extraction module 304 is specifically configured to:
[0117] Inputting each of the information extraction fields and the text content into a trained field information extraction model, and using the trained field information extraction model to extract field information under each information extraction field from the text content;
[0118] For each information extraction field, the field information under the information extraction field whose confidence ranks in the top N positions is determined in descending order; N is a positive integer greater than or equal to 1.
[0119] In an optional implementation, the device further includes a training module, which is used to:
[0120] Obtaining target text content of each sample contract; the target text content is obtained by annotating the original text content of the sample contract according to the preset information extraction field;
[0121] The target text content of some sample contracts is used as a training sample set, inputted into the field information extraction model, and the field information extraction model is trained to obtain a currently trained field information extraction model;
[0122] The target text contents of the remaining sample contracts are used as a test sample set and input into the currently trained field information extraction model to obtain test field information;
[0123] Determining the test result according to the test field information and the field information marked in the test sample set;
[0124] If the test result indicates that the preset requirements are met, the currently trained field information extraction model is used as the trained field information extraction model; if the test result indicates that the preset requirements are not met, the step of inputting the training sample set into the field information extraction model, training the field information extraction model, and obtaining the currently trained field information extraction model is continued until a trained field information extraction model is obtained.
[0125] In an optional implementation manner, the second extraction module 304 is specifically configured to:
[0126] Determining, from the text content of the contract to be verified, field description information that matches the information extraction field;
[0127] If the field description information directly corresponds to the information extraction field, extracting the field information from the field description information;
[0128] If the information extraction field indirectly corresponds to the field description information, the information to be processed is extracted from the field description information, and the information to be processed is processed to obtain the field information.
[0129] In an optional implementation, the information extraction field includes the number of seals and the number of signatures; the field description information includes seal information and signature information; the compliance requirements include requirements on the number of seals and the number of signatures;
[0130] The processing module is specifically used to: after extracting seal information and signature information from the contract image of the contract to be verified, determine the number of seals according to each seal information, and determine the number of signatures according to each signature information.
[0131] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0132] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 4 As shown, it is a schematic diagram of the structure of a computer device 400 provided in an embodiment of the present disclosure, including a processor 401, a memory 402, and a bus 403. Among them, the memory 402 is used to store execution instructions, including a memory 4021 and an external memory 4022; the memory 4021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 401, and the data exchanged with the external memory 4022 such as a hard disk. The processor 401 exchanges data with the external memory 4022 through the memory 4021. When the computer device 400 is running, the processor 401 communicates with the memory 402 through the bus 403, so that the processor 401 executes the following instructions:
[0133] Obtain a contract image set of the contract document to be verified; the contract image set includes contract images arranged in order; each of the contract images corresponds to a contract page;
[0134] By performing feature recognition on each contract image in the contract image set, determining each contract to be verified contained in the contract document to be verified and the contract type of the contract to be verified, and extracting the text content of each contract to be verified;
[0135] Determine, according to the contract type of each contract to be verified, the information extraction field corresponding to the contract to be verified;
[0136] According to the information extraction field, extracting field information under the information extraction field from the text content of the contract to be verified;
[0137] For each contract to be verified, according to the compliance requirements for different types of information extraction fields under the contract type of the contract to be verified, information verification is performed on the field information under each information extraction field to obtain a compliance verification result for the contract to be verified.
[0138] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the contract verification method described in the above method embodiment are executed. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0139] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the contract verification method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0140] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0141] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0142] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0143] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0144] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0145] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A contract verification method, characterized in that: include: Get the contract image collection of the contract document to be verified; The contract image set includes contract images arranged in order; each of the contract images corresponds to a contract page; By performing feature recognition on each contract image in the contract image set, determining each contract to be verified contained in the contract document to be verified and the contract type of the contract to be verified, and extracting the text content of each contract to be verified; Determine, according to the contract type of each contract to be verified, the information extraction field corresponding to the contract to be verified; According to the information extraction field, extracting field information under the information extraction field from the text content of the contract to be verified; For each of the contracts to be verified, according to the compliance requirements of different types of information extraction fields under the contract type of the contract to be verified, information verification is performed on the field information under each of the information extraction fields to obtain a compliance verification result for the contract to be verified; The method of performing feature recognition on each contract image in the contract image set, determining each contract to be verified contained in the contract document to be verified, and the contract type of the contract to be verified, and extracting the text content of each contract to be verified, includes: Performing feature extraction processing on each contract image in the contract image set to obtain image features of each contract image; Inputting the image features of each of the contract images into an image classification module in the image processing model to obtain a page category of each of the contract images; According to the page category information under each contract type and the page category of each contract image, and the arrangement order of the contract images in the contract image set, the contract images that continuously belong to the same contract type are divided into the same contract to be verified, so as to obtain the contract images that belong to the same contract to be verified; The contract type of each contract image classified into the same contract to be verified is used as the contract type of the contract to be verified, and the text content of each contract image included in the contract to be verified is extracted.
2. The contract verification method according to claim 1, characterized in that: After extracting the field information under the information extraction field from the text content of the contract to be verified, and before performing information verification on the field information under each of the information extraction fields, the method further includes: According to the target type of the information extraction field, determining whether the information format of the field information conforms to the target format corresponding to the target type; If not, the field information is processed according to the target format to obtain the field information in the target format.
3. The contract verification method according to claim 1, characterized in that: According to the information extraction field, extracting field information under the information extraction field from the text content of the contract to be verified includes: Inputting each of the information extraction fields and the text content into a trained field information extraction model, and using the trained field information extraction model to extract field information under each information extraction field from the text content; For each information extraction field, the field information under the information extraction field whose confidence ranks in the top N positions is determined in descending order; N is a positive integer greater than or equal to 1.
4. The contract verification method according to claim 3, characterized in that: The trained field information extraction model is determined according to the following steps: Obtaining target text content of each sample contract; the target text content is obtained by annotating the original text content of the sample contract according to the preset information extraction field; The target text content of some sample contracts is used as a training sample set, inputted into the field information extraction model, and the field information extraction model is trained to obtain a currently trained field information extraction model; The target text contents of the remaining sample contracts are used as a test sample set and input into the currently trained field information extraction model to obtain test field information; Determining a test result according to the test field information and the field information marked in the test sample set; If the test result indicates that the preset requirements are met, the currently trained field information extraction model is used as the trained field information extraction model; if the test result indicates that the preset requirements are not met, the step of inputting the training sample set into the field information extraction model, training the field information extraction model, and obtaining the currently trained field information extraction model is continued until a trained field information extraction model is obtained.
5. The contract verification method according to claim 1, characterized in that: Extracting field information under the information extraction field from the text content of the contract to be verified includes: Determining, from the text content of the contract to be verified, field description information that matches the information extraction field; If the field description information directly corresponds to the information extraction field, extracting the field information from the field description information; If the information extraction field indirectly corresponds to the field description information, the information to be processed is extracted from the field description information, and the information to be processed is processed to obtain the field information.
6. The method according to claim 5, wherein the information extraction field includes the number of seals and the number of signatures; the field description information includes seal information and signature information; and the compliance requirements include requirements for the number of seals and the number of signatures; Extracting the information to be processed from the field description information, and processing the information to be processed to obtain the field information, including: After extracting the seal information and signature information from the contract image of the contract to be verified, the number of seals is determined according to each of the seal information, and the number of signatures is determined according to each of the signature information.
7. A contract verification device, characterized in that: include: An acquisition module is used to acquire a collection of contract images of the contract document to be verified; The contract image set includes contract images arranged in order; each of the contract images corresponds to a contract page; A first extraction module is used to determine the contracts to be verified contained in the contract document to be verified and the contract type of the contract to be verified by performing feature recognition on each contract image in the contract image set, and extract the text content of each contract to be verified; A determination module, used to determine the information extraction field corresponding to the contract to be verified according to the contract type of each contract to be verified; A second extraction module, configured to extract field information under the information extraction field from the text content of the contract to be verified according to the information extraction field; A verification module, for each of the contracts to be verified, and according to the compliance requirements of different types of information extraction fields under the contract type of the contract to be verified, performing information verification on the field information under each of the information extraction fields, to obtain a compliance verification result for the contract to be verified; The first extraction module is specifically used to: perform feature extraction processing on each contract image in the contract image set to obtain the image features of each contract image; input the image features of each contract image into the image classification module in the image processing model to obtain the page category of each contract image; according to the page category information under each contract type and the page category of each contract image, and the arrangement order of the contract images in the contract image set, the contract images that continuously belong to the same contract type are divided into the same contract to be verified, so as to obtain the contract images that belong to the same contract to be verified; The contract type of each contract image classified into the same contract to be verified is used as the contract type of the contract to be verified, and the text content of each contract image included in the contract to be verified is extracted.
8. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the contract verification method as described in any one of claims 1 to 6 are performed.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the contract verification method as described in any one of claims 1 to 6.
