Contract generation method, contract generation system, storage medium and program product
By extracting contract form information and automatically proofreading using contract rendering parameters, the problem that electronic contract generation in the existing technology is not suitable for different business areas, and efficient and reliable contract generation is achieved, reducing the need for manual review.
Patent Information
- Application Number
- CN202411311103.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2024-12-20
AI Technical Summary
The existing intelligent way of generating electronic contracts is difficult to adapt to different business areas, resulting in errors in the generated electronic contracts, which require manual proofreading word by word, and consumes a lot of manpower and time.
Provide a contract generation method, by obtaining contract form information, extracting target information and filling in preset templates, generating a contract to be evaluated, and using contract rendering parameters to render and similarity calculations to automatically proofread the generated contract and judge it. Whether the preset threshold is met.
It reduces manpower and time consumption, improves the reliability of contract generation, saves time and resources for manual review, and improves the applicability of electronic contracts.
Smart Images

Figure CN119167894A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a contract generation method, a contract generation system, a storage medium, and a computer program product. Background Art
[0002] With the development of the Internet industry, many commercial contracts can be signed electronically through online signing. Some online signing business platforms can use templates to intelligently create electronic contracts, providing greater convenience.
[0003] However, commercial contracts involve a wide range of areas, and electronic contract templates may not be suitable for different business areas. The generated electronic contracts are usually only used as references and are difficult to be directly applied to contract signing. Before signing, it is usually necessary to manually proofread the electronic contracts generated by the platform word by word in order to eliminate defects in the electronic contracts before signing. In this way, a large amount of human resources are required to be invested in the review of electronic contracts, and a long review time is required. Summary of the invention
[0004] In order to solve one of the above technical problems, the present disclosure provides a contract generation method, a contract generation system, a storage medium and a computer program product.
[0005] In a first aspect, the present disclosure provides a contract generation method, comprising: acquiring contract form information; extracting target information from the contract form information, and filling the target information into a preset contract template to generate a contract to be evaluated; extracting text content from a contract clause text in the contract to be evaluated to obtain a first contract text; rendering the contract text of the contract form information based on a contract rendering parameter to obtain a second contract text, wherein the second contract text includes one or more contract clause texts; calculating the similarity between the contract clause texts in the first contract text and the second contract text to obtain a target similarity; and outputting the contract to be evaluated as a target contract when the target similarity is greater than a similarity threshold.
[0006] In at least one optional implementation, obtaining contract form information includes: generating a template form corresponding to an input contract field type according to the contract field type, the template form including fixed text content and text content to be filled in; and obtaining filled-in text content when the text content to be filled in is completed, and obtaining the contract form information according to the filled-in text content and the fixed text content.
[0007] In at least one optional implementation, target information is extracted from the contract form information, and the target information is filled into a preset contract template to generate a contract to be evaluated, including: determining the contract field type corresponding to the contract form information, and matching the corresponding contract template according to the contract field type; and matching the corresponding target text content in the text content of the contract form information based on the content of the to-be-filled fields in the contract template, and filling the matched target text into the contract template to obtain the contract to be evaluated.
[0008] In at least one optional implementation, text content extraction is performed on the contract clause text in the contract to be evaluated to obtain a first contract text, including: identifying and extracting each contract clause text in the contract to be evaluated; identifying the clause type of each contract clause text in the contract to be evaluated; classifying each contract clause text in the contract to be evaluated based on whether the clause types are the same to obtain at least one classified clause set, the contract clause texts in different classified clause sets having different clause types; and obtaining the first contract text based on each of the classified clause sets.
[0009] In at least one optional embodiment, the contract rendering parameters include multiple sub-parameters, and the contract rendering parameters are obtained based on training a contract text model, and the contract text model is used to generate a contract text based on the input contract form data, and the contract text includes one or more contract clause texts; based on the contract rendering parameters, the contract form information is rendered to obtain a second contract text, and the second contract text includes one or more contract clause texts, including: performing keyword extraction on the contract form information to obtain multiple form fields; obtaining the clause label corresponding to each of the form fields; based on the sub-parameters corresponding to the same clause label, the form field corresponding to the same clause label is rendered to obtain the contract clause text corresponding to the clause label; and the second contract text is obtained based on the contract clause text corresponding to each of the clause labels.
[0010] In at least one optional implementation, the target similarity includes the sub-similarity corresponding to each of the contract clause texts in the first contract text and the second contract text; calculating the similarity between the contract clause texts in the first contract text and the second contract text to obtain the target similarity includes: obtaining the similarity between the contract clause text in the first contract text and the corresponding contract clause text in the second contract text one by one, and obtaining the sub-similarity corresponding to each of the contract clause texts.
[0011] In at least one optional implementation manner, the obtaining of the similarity between the contract clause text in the first contract text and the corresponding contract clause text in the second contract text one by one, and obtaining the sub-similarity corresponding to each of the contract clause texts, respectively, includes: performing word segmentation processing on the contract clause text in the first contract text and the corresponding contract clause text in the second contract text, respectively, to obtain a first word segmentation set corresponding to the first contract text and a second word segmentation set corresponding to the second contract text; respectively obtaining a first word frequency of each word segmentation in the first word segmentation set, and a second word frequency of each word segmentation in the second word segmentation set; vectorizing and encoding the first word segmentation set based on the first word frequency of each word segmentation in the first word segmentation set to obtain a first word frequency vector; vectorizing and encoding the second word segmentation set based on the second word frequency of each word segmentation in the second word segmentation set to obtain a second word frequency vector; and calculating the cosine value of the angle between the first word frequency vector and the second word frequency vector to obtain the sub-similarity.
[0012] In at least one optional implementation, when the target similarity is greater than a similarity threshold, the contract to be evaluated is output as a target contract, including: when the sub-similarity corresponding to each of the contract clause texts in the first contract text is greater than a similarity threshold, the contract to be evaluated is output as a target contract.
[0013] In at least one optional implementation, the similarity between the contract clause texts in the first contract text and the second contract text is calculated to obtain a target similarity, including: respectively obtaining the number of contract clause texts in the first contract text and the number of contract clause texts in the second contract text; when the number of contract clause texts in the first contract text is different from the number of contract clause texts in the second contract text, outputting a preset minimum similarity as the target similarity.
[0014] A second aspect of the present disclosure provides a contract generation system, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the contract generation method of any embodiment of the present disclosure.
[0015] A third aspect of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the contract generation method of any embodiment of the present disclosure is executed.
[0016] A fourth aspect of the present disclosure provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the contract generation method of any embodiment of the present disclosure is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0018] Figure 1 It is a schematic diagram of a scenario in which a contract generation system of some embodiments of the present disclosure performs contract generation.
[0019] Figure 2 It is a flowchart of a contract generation method according to some embodiments of the present disclosure.
[0020] Figure 3 It is a flowchart of a contract generation method according to some embodiments of the present disclosure.
[0021] Figure 4 It is a flowchart of a contract generation method according to some embodiments of the present disclosure.
[0022] Figure 5 It is a flowchart of a contract generation method according to some embodiments of the present disclosure.
[0023] Figure 6 It is a flowchart of a contract generation method according to some embodiments of the present disclosure.
[0024] Figure 7 It is a flowchart of a contract generation method according to some embodiments of the present disclosure.
[0025] Figure 8 It is a flowchart of a contract generation method according to some embodiments of the present disclosure.
[0026] Fig. 9 It is a schematic block diagram of the structure of a contract generation system of some embodiments of the present disclosure. DETAILED DESCRIPTION
[0027] The present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is understood that the specific examples described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0028] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0029] At present, most of the smart electronic contract generation methods are based on preset contract templates. However, commercial contracts involve many business areas, and general contract templates are often difficult to adapt to the electronic contract generation of more finely divided business areas, which may lead to incorrect information in the created electronic contract. Therefore, before using electronic contracts for signing, manual review of electronic contracts is often required.
[0030] On the one hand, some contracts contain a lot of content and need to be manually confirmed word by word, which consumes a lot of time.
[0031] On the other hand, some contracts are highly professional, and contracts in different business areas often require human resources from different business areas to review them, which requires a lot of manpower investment.
[0032] Based on the above problems, the present disclosure provides a contract generation method M100 for intelligently proofreading a contract. The contract generation method can be applied to a contract generation system 1000. Figure 1 A schematic diagram of a scenario in which the contract generation system 1000 according to an embodiment of the present disclosure generates an electronic contract is shown.
[0033] The contract generation system 1000 is an electronic device, such as a computer device, a mobile phone, etc. The contract generation system 1000 can create a contract according to the input contract form information. However, the contract created at this time is not directly output, but recorded as a contract to be evaluated. The contract to be evaluated needs to be evaluated and proofread, and can be output as a target contract after passing the proofreading.
[0034] The contract generation system 1000 uses the contract text generated by the trained contract text model to proofread the contract text in the contract to be evaluated.
[0035] Specifically, the contract text model is trained to render the contract text of the input contract form information according to the contract rendering parameters obtained through training, and generate the corresponding contract text. The generated contract text is a text related to the content of the contract clauses, and the contract text contains one or more contract clauses. Furthermore, the contract to be evaluated also has a contract text containing one or more contract clauses. The contract generation system 1000 extracts the contract text from the contract to be evaluated, compares it with the contract text generated by the contract text model, and calculates the similarity between the two. If the similarity is greater than a preset threshold, the contract to be evaluated passes the proofreading, and the contract to be evaluated is output as the target contract. Otherwise, if the similarity is less than or equal to the preset threshold, the contract to be evaluated has not been proofread, and the contract generation system 1000 issues an early warning notification to remind relevant business personnel.
[0036] In summary, the contract generation method M100 and the contract generation system 1000 disclosed in the present invention, while generating a contract to be evaluated based on the contract form information, use the contract rendering parameters to render the same contract form information to obtain the contract text, and calculate the similarity between it and the contract text in the contract to be evaluated to obtain the target similarity. Therefore, it is possible to determine whether the contract to be evaluated has passed the proofreading based on the value of the target similarity. Among them, obtaining the contract text using the contract rendering parameters, and calculating the similarity of the two sets of contract texts, can all be achieved through computer programs, thereby saving manpower input and improving the proofreading speed. In this way, a more reliable target contract can be generated on the basis of reducing manpower consumption and time consumption.
[0037] Figure 2 The following is a flow chart of a contract generation method M100 according to an embodiment of the present disclosure. The contract generation method M100 includes the following steps S110 to S160: S110: Acquire contract form information. This process can be implemented through an acquisition module.
[0038] S120: extracting target information from the contract form information, and filling the target information into a preset contract template to generate a contract to be evaluated. This process can be implemented by a contract generation module.
[0039] S130: Extract the text content of the contract clauses in the contract to be evaluated to obtain a first contract text. This process can be implemented by a text extraction module.
[0040] S140: Based on the contract rendering parameters, the contract form information is rendered to obtain a second contract text, where the second contract text includes one or more contract clause texts. This process can be implemented by a contract text generation module.
[0041] S150: Calculate the similarity between the contract clauses in the first contract text and the second contract text to obtain a target similarity. This process can be implemented by a similarity calculation module.
[0042] S160: When the target similarity is greater than the similarity threshold, the contract to be evaluated is output as the target contract. This process can be implemented by a comparison module.
[0043] In step S110, the contract form information is information related to the contract provided by the party to the contract. For example, the contract form information related to commodity trading includes the traded commodity, the quantity of commodities, the transaction time, the transaction method, the transaction amount, etc., which are not listed here one by one. Among them, the form information refers to information filled in according to the format of a predetermined structure. In this way, the various information fields in the contract form information are located in a fixed position, which is conducive to extracting the corresponding information content at a fixed position in the contract form information by a computer program in the subsequent process. For example, the contract form information related to commodity trading includes information filled in a table, the first row of the table is the commodity traded, and the second row is the quantity of the commodity. In this way, when obtaining the contract form information, the corresponding information type can be determined according to the position of the table, which is convenient for the computer program to enter information by category.
[0044] In step S120, the target information is text information related to the contract terms. Not all text information in the contract form information is related to the contract terms. When generating a contract based on the contract form information, the target information in the contract form information needs to be extracted to generate the contract using the target information.
[0045] The preset contract template contains the template of contract clauses. The template of contract clauses includes fixed template text and replaceable sample text. After replacing the sample text with the relevant content in the contract form information, the contract clause can be generated. For example, a contract clause in the preset contract template is: Party A Towards Party B Payment amount xxx Yuan. Party A "," Party B "," xxx”Taking [example text] as an example, the rest is fixed template text. For the example text in this clause, the corresponding contents are the name of the purchaser, the name of the seller, and the transaction amount. Therefore, it is necessary to extract the name of the purchaser, the name of the seller, and the transaction amount from the contract form information respectively as the target information and fill them into the positions where the corresponding example text is located in order to generate this contract clause in the contract to be evaluated. For example, assuming that the name of the purchaser, the name of the seller, and the transaction amount are "Zhang San", "Li Si", and "100" respectively, the generated contract clause is: "Zhang San pays Li Si the amount of 100 yuan". And so on, filling the target information in the contract form into the positions of the example text in the templates of each contract clause in the preset contract template can generate the contract to be evaluated.
[0046] In yet another embodiment, the position where the example text is located can be left blank. For example, a certain contract clause in the preset contract template is: " To Pay the amount of yuan". That is to say, the target information does not replace the example text, but is directly filled into the blank position in the preset contract template. Specifically, each blank position in the contract template corresponds to a type label. After extracting the target information, the text content in the target information is classified, and the type label is assigned to the corresponding text content according to the type of the type label. When filling the target information into the blank position, based on the label corresponding to the target information, find the blank position with the same label to fill the target information into the corresponding blank position. For example, a blank position corresponds to the type label "name of the purchaser". Assuming that the target information contains "Zhang San", according to the position of "Zhang San" in the contract form information, or according to the description of "Zhang San" in the contract form information, it can be determined that the type label corresponding to "Zhang San" is "name of the purchaser", then fill "Zhang San" into the blank position corresponding to the type label "name of the purchaser".
[0047] In step S130, text content extraction is performed on the contract clause text in the contract to be evaluated, that is, the contract clause text in the contract to be evaluated is extracted to obtain a first contract text composed of only one or more contract clauses. For example, in the contract to be evaluated, in addition to the contract clauses, there may be some other text contents, such as the contract header, signature, signature, liability statement, etc. These non-contract clause contents do not participate in the similarity comparison. Based on this, it is necessary to extract the contract clause text from the contract to be evaluated to obtain a first contract text composed of only one or more contract clauses.
[0048] In step S140, the contract rendering parameters are rendering rules for the contract text, which are used to convert the input contract form information into the corresponding contract text, which is recorded as the second contract text, and the second contract text includes one or more contract clauses. The contract rendering parameters can be configured using known rendering parameters or obtained by training a contract text model, which is not limited here.
[0049] For example, rendering the contract text on the contract form information includes extracting the fields of the contract form information to obtain the fields to be rendered and the type tags corresponding to the fields to be rendered. According to the contract rendering parameters, it can be determined which type tags correspond to the fields to be rendered and can generate the contract clause text, so as to render the contract clause text on the fields to be rendered in combination with the type tags corresponding to the fields to be rendered, and obtain one or more contract clause texts. For example, the fields to be rendered obtained by extracting the fields of the contract form information include "Zhang San", "Li Si" and "100 yuan", and correspond to three different type tags of "buyer's name", "seller's name" and "transaction amount" respectively. According to the contract rendering parameters, it can be determined that the fields to be rendered corresponding to the three type tags of "buyer's name", "seller's name" and "transaction amount" can be rendered as "payment terms", and the "payment terms" describe the transaction amount that the buyer should pay to the seller. Therefore, the three types of tags combined with the contract rendering parameters are used to render the three fields to be rendered, and the contract terms obtained are "Zhang San pays Li Si an amount of 100 yuan".
[0050] In one example, in step S150, calculating the similarity between the contract clauses in the first contract text and the second contract text is to calculate the similarity between each contract clause in the first contract text and the corresponding contract clause in the second contract text one by one, and the target similarity finally obtained includes multiple similarities. Correspondingly, in step S160, the target similarity is greater than the similarity threshold, which means that each similarity included in the target similarity is greater than the similarity threshold.
[0051] In another example, in step S150, the similarity between the contract clause texts in the first contract text and the second contract text is calculated by taking all the contract clauses in the first contract text as a whole and calculating the similarity between it and the whole of all the contract clauses in the second contract text.
[0052] In step S160, when the target similarity is greater than the similarity threshold, it indicates that there is a high degree of consistency between the content of the contract terms in the contract to be evaluated generated according to the preset contract template and the content of the contract terms in the second contract text generated based on the contract rendering parameters, that is, the contract to be evaluated generated according to the preset contract template has good reliability.
[0053] In summary, the contract generation system 1000 executes the above steps S110 to S160, and can generate a second contract text based on the contract rendering parameters as a reference, and perform similarity calculation of the contract clause text with the first contract text in the contract to be evaluated generated based on the preset contract template, so as to proofread the contract clause text in the first contract text. In this way, the time and human resources required for manual proofreading can be saved.
[0054] See also Figure 3 In some implementations, in step S110, obtaining contract form information includes step S111 and step S112.
[0055] S111: Generate a template form corresponding to the contract field type according to the input contract field type, the template form including fixed text content and text content to be filled in.
[0056] In one example, the contract field type can be input by the relevant business personnel responsible for signing the contract. The contract field type may include the information technology field, computer science field, financial law field, etc., which are not listed here one by one.
[0057] When there is more than one contract field type, template forms corresponding to the number of contract field types are generated respectively for different contract field types. For example, when the contract field types include computer science field and financial law field, template forms corresponding to the computer science field and template forms corresponding to the financial law field are generated respectively.
[0058] The text content to be filled in can be a sample text to be replaced, or a blank position waiting for text to be filled in, and there is no limitation here.
[0059] S112: When the text content to be filled in is completed, the filled in text content is obtained, and the contract form information is obtained according to the filled in text content and the fixed text content.
[0060] For example, a template form includes the following content: "Purchaser name: ______". "Purchaser name:" is a fixed text content, and "______" is a text content to be filled in. Assuming that "Zhang San" is filled in, the result is "Purchaser name: Zhang San ” as part of the contract form information.
[0061] See also Figure 4 In some implementations, in step S120, target information is extracted from the contract form information, and the target information is filled into a preset contract template to generate a contract to be evaluated, including steps S121 and S122.
[0062] S121: Determine the contract field type corresponding to the contract form information, and match the corresponding contract template according to the contract field type.
[0063] In one example, the contract field type has been input when acquiring the contract form information, for example, the contract form information is acquired through the above steps S111 and S112, and the contract field type corresponding to the contract form information is obtained according to the input contract field type.
[0064] In another example, the contract form information may be identified by domain type. Specifically, in one solution, high-frequency keywords may be extracted from the contract form information, and the domain type to which the high-frequency keywords belong may be determined to obtain the contract domain type corresponding to the contract form information. In another solution, semantic analysis may be performed on the contract form information to obtain the contract domain type corresponding to the contract form information.
[0065] Each contract field type corresponds to a contract template. In one example, if the contract form information corresponds to multiple contract field types, then contract templates related to all of these field types can be matched. If contract templates related to all of these field types cannot be matched, the contract template corresponding to the most relevant field type can be used as the matching contract template; or, a highly general contract template can be sampled as the matching contract template.
[0066] S122: Based on the contents of the fields to be filled in the contract template, the corresponding target text contents are matched in the text contents of the contract form information, and the matched target texts are filled into the contract template to obtain the contract to be evaluated.
[0067] That is, the contract template includes a template of the contract clause text, and the template of the contract clause text includes fixed text content and field content to be filled in. When applied to different contract form information, the target text content in the different contract form information is filled in the position where the field content to be filled in the contract template is located.
[0068] In one example, matching the corresponding target text content in the text content of the contract form information based on the content of the field to be filled in the contract template means matching the text content corresponding to the same type tag in the text content of the contract form information based on the type tag corresponding to the content of the field to be filled in the contract template, and recording it as the target text content. For example, if the type tag corresponding to the content of a certain field to be filled in is "purchaser's name", then the text content with the type tag of "purchaser's name" is matched in the text content of the contract form information to obtain the target text content, and fill it in the position where the content of the field to be filled in is located.
[0069] See also Figure 5In some implementations, in step S130, text content is extracted from the text of the contract clauses in the contract to be evaluated to obtain a first contract text, including steps S131, S132, S133, and S134.
[0070] S131: Identify and extract the text of each contract clause in the contract to be evaluated.
[0071] In one example, the text of the contract clause in the contract to be evaluated is located at a specific position in the contract to be evaluated, such as a specific page number, a specific paragraph, a specific spatial position, etc. The text of the contract clause can be identified based on whether the position of the text is located at the specific position in the contract to be evaluated.
[0072] In another example, the contract clause text template in the contract template has a specific identifier. For example, a digital serial number in a certain font is placed before each contract clause text template. For the contract to be evaluated generated based on the contract template, the location of the contract clause text can be determined by looking for the specific identifier in the contract to be evaluated.
[0073] S132: Identify the clause type of each contract clause text in the contract to be evaluated.
[0074] The clause type refers to the type of content described in the clause. For example, some contract clauses are clauses describing the means of payment, and their clause types are recorded as "means of payment clauses"; some contract clauses are clauses describing the items of service provided, and their clause types are recorded as "performance of duties clauses".
[0075] S133: Based on whether the clause types are the same, classify the texts of each contract clause in the contract to be evaluated to obtain at least one classified clause set, and the clause types of the contract clause texts in different classified clause sets are different.
[0076] For example, the contract clause text in the contract to be evaluated includes clause 1, clause 2, clause 3 and clause 4. Among them, clause 1, clause 2 and clause 3 are "payment amount clauses", and the clause type of clause 4 is "performance of responsibilities clause". Then clause 1, clause 2 and clause 3 with the same clause type are classified into the same category to obtain the payment amount clause set; clause 4 is classified into another category to obtain the performance of responsibilities clause set.
[0077] S134: Obtain the first contract text based on each set of classified clauses.
[0078] In one example, in a contract to be evaluated, multiple contract clauses of the same clause type may be scattered in different locations in the contract to be evaluated. For example, the contract clause text whose clause type is "payment amount clause" includes clause 1, clause 2, and clause 3. Among them, clause 1 is on page 2 of the contract to be evaluated, clause 2 is on page 5 of the contract to be evaluated, and clause 3 is on page 6 of the contract to be evaluated. Assuming that clause 1, clause 2, and clause 3 are divided into the "payment amount clause set", clause 1, clause 2, and clause 3 are sorted in the "payment amount clause set" according to the order in which clause 1, clause 2, and clause 3 appear in the contract to be evaluated. In this way, the "payment amount clause set" can integrate clauses 1, clause 2, and clause 3 in different locations.
[0079] The first contract text is obtained based on each set of classified clauses, that is, each contract clause text in the contract to be evaluated is classified and integrated according to its clause type to obtain the first contract text. In this way, the contract clauses in the first contract text can be found according to their clause types to calculate the similarity of the contract clauses of the same clause type in the second contract text.
[0080] In some embodiments, the contract rendering parameters are obtained based on training a contract text model, and the contract text model is used to generate a contract text based on the input contract form data, and the contract text contains one or more contract clause texts. Among them, the contract text model can be trained using models such as ELMo, GPT, BERT, ALBERT, X-Transformer, etc., which are not limited here. The input parameter for training the contract text model is the contract form data, and the output parameter is the contract text. The training is performed using the given initial contract rendering parameters, and the contract rendering parameters are optimized using the gradient descent method. When the number of training iterations reaches a preset number, the current contract rendering parameters of the contract text model are output as the contract rendering parameters used in step S140.
[0081] See also Figure 6 In some implementations, in step S140, based on the contract rendering parameters, the contract form information is rendered as a contract text to obtain a second contract text, the second contract text includes one or more contract clause texts, including steps S141 to S144.
[0082] S141: extract keywords from the contract form information to obtain multiple form fields.
[0083] The form field is a field related to the content of the contract clause. For example, the content of the contract clause includes the payment amount, and the fields related to the payment amount include "xx yuan", "xx jiao", "xx fen", etc. Based on this, "yuan", "jiao", "fen" can be configured as keywords to extract the form fields related to the payment amount based on the keywords related to the payment amount.
[0084] In one example, when generating contract form information, the form fields are filled in a specific position in the contract form information. For example, the first line of the first paragraph of page 2 in the contract form information is fixed as the position where the form fields related to the payment amount are located. Based on this, keywords can be extracted at a specific position in the contract form information to obtain the form fields.
[0085] S142: Obtain the clause label corresponding to each form field.
[0086] A clause label is a label that represents the type of a contract clause text. For example, if the content of a contract clause text describes the payment amount, the clause label of the contract clause text is "payment amount clause".
[0087] The same form field can correspond to one or more clause tags. For example, in the contract clause text describing the payment method, the name of the seller is involved, and in the contract clause text describing the performance of responsibilities, the name of the seller is also involved. Assuming the seller's name is "Li Si", the clause tags corresponding to "Li Si" include "Payment Method Clause" and "Performance of Responsibilities Clause".
[0088] S143: Based on the sub-parameters corresponding to the same clause label, text rendering is performed on the form field corresponding to the same clause label to obtain the contract clause text corresponding to the clause label.
[0089] The contract rendering parameters include multiple sub-parameters, each of which corresponds to a contract clause text of a clause type. The sub-parameters represent the rules for converting form fields into the contract clause text of their corresponding clause type.
[0090] Multiple form fields corresponding to the same clause label can be rendered according to the contract rendering parameters corresponding to the clause label to obtain the contract clause text corresponding to the clause label.
[0091] For example, the clause label corresponding to the form field includes "Payment Method Clause", and the sub-parameter corresponding to "Payment Method Clause" is recorded as parameter 1. "Payment Method Clause" is related to the payment type, the name of the buyer, the name of the seller, and the payment time. The corresponding form fields include "Installment", "Zhang San", "Li Si", "Payment on the 1st of each month", and "12 months in total". The contract clause text obtained by text rendering the above form fields based on parameter 1 is "Zhang San needs to pay the purchase price to Li Si in monthly installments, for a total of 12 installments, and the payment date for each installment is the 1st of each month".
[0092] S144: Obtain a second contract text based on the contract clause text corresponding to each clause tag.
[0093] For example, each form field of the contract form information corresponds to three clause tags, and three contract clause texts can be obtained based on the three clause tags respectively, and finally two contract texts can be obtained based on the three contract clause texts.
[0094] After obtaining the second contract text, the second contract text can be used as a reference to compare with the first contract text, and the first contract text can be proofread by calculating the target similarity between the two.
[0095] See also Figure 7 In some embodiments, the target similarity includes the sub-similarity of each contract clause text in the first contract text and the second contract text. Accordingly, in step S150, the similarity of the contract clause text in the first contract text and the second contract text is calculated to obtain the target similarity, including step S151.
[0096] S151: Obtain the similarity between the contract clause text in the first contract text and the corresponding contract clause text in the second contract text one by one, and obtain the sub-similarity corresponding to each contract clause text respectively.
[0097] Among them, the contract clause text in the first contract text and the corresponding contract clause text in the second contract text refer to the contract clause text with the same clause label. For example, the contract clause text in the first contract text includes contract clause texts with two clause label types, "payment method clause" and "payment method clause". Then, when calculating the sub-similarity, the contract clause text corresponding to the "payment method clause" clause label in the first contract text is calculated for similarity with the contract clause text corresponding to the "payment method clause" clause label in the second contract text; and the contract clause text corresponding to the "payment method clause" clause label in the first contract text is calculated for similarity with the contract clause text corresponding to the "payment method clause" clause label in the second contract text.
[0098] Further, in some embodiments, step S151 includes steps S1511 to S1515.
[0099] S1511: Perform word segmentation processing on the contract clause text in the first contract text and the corresponding contract clause text in the second contract text respectively, to obtain a first word segmentation set corresponding to the first contract text and a second word segmentation set corresponding to the second contract text.
[0100] The word segmentation process includes dividing the sentences of the contract clause text into multiple word segments. In one example, the word segmentation process also includes removing stop words and punctuation marks. The multiple word segments divided from the first contract clause text form a first word segmentation set, and the multiple word segments divided from the second contract clause text form a second word segmentation set.
[0101] S1512: Obtain a first word frequency of each word in the first word segmentation set and a second word frequency of each word in the second word segmentation set respectively.
[0102] The first word frequency of the segmentation words in the first segmentation set is the frequency of occurrence of the segmentation words in the first segmentation set in the union of the first segmentation set and the second segmentation set. Similarly, the second word frequency of the segmentation words in the second segmentation set is the frequency of occurrence of the segmentation words in the second segmentation set in the union of the first segmentation set and the second segmentation set.
[0103] S1513: Based on the first word frequency of each word in the first word set, the first word set is vectorized and encoded to obtain a first word frequency vector.
[0104] Specifically, the rule of vectorized encoding is: the vector length of the first word frequency vector is the length of the union of the first word segment set and the second word segment set. Each element of the first word frequency vector represents the first word frequency corresponding to a word in the first word segment set.
[0105] For example, the union of the first word set and the second word set has 5 words in total, so the vector length of the first word frequency vector is 5 elements. Assuming that the first word set contains 4 words, and the corresponding word frequencies are f1, f2, f3 and f4, the first word frequency vector can be in the form of: R1 (f1, f2, f3, f4, 0).
[0106] S1514: Based on the second word frequency of each word in the second word set, the second word set is vectorized and encoded to obtain a second word frequency vector.
[0107] The method of obtaining the second term frequency vector in step S1514 is similar to the method of obtaining the first term frequency vector in step S1513, and will not be repeated here.
[0108] S1515: Calculate the cosine value of the angle between the first term frequency vector and the second term frequency vector to obtain the sub-similarity.
[0109] In an example, assuming that the sub-similarity is s, the sub-similarity s can be calculated by the following formula 1.
[0110] Formula 1: Among them, R1 is the first word frequency vector, is the second norm of R1, R2 is the second term frequency vector, is the second norm of R2, and θ is the angle between the first term frequency vector and the second term frequency vector.
[0111] In some embodiments, when the target similarity includes multiple sub-similarity, correspondingly, step S160, when the target similarity is greater than the similarity threshold, outputs the contract to be evaluated as the target contract, including step S161.
[0112] S161: When the sub-similarity corresponding to each contract clause text in the first contract text is greater than the similarity threshold, the contract to be evaluated is output as the target contract.
[0113] For example, if the first contract text includes three contract clauses, the contract to be evaluated will be output as the target contract only when the sub-similarity corresponding to each of the three contract clauses is greater than the similarity threshold. If the sub-similarity corresponding to one, two or three of the contract clauses is less than or equal to the similarity threshold, the process of outputting the contract to be evaluated as the target contract will not be triggered.
[0114] In some implementations, when a certain sub-similarity is less than or equal to a similarity threshold, a corresponding prompt message is issued to indicate that there may be errors in the contract clause text in the first contract text corresponding to the sub-similarity, so that relevant business personnel can promptly revise the content of the contract clause text in this part.
[0115] In some implementations, when calculating the target similarity, each contract clause text in the first contract text is considered as a whole, and the similarity is calculated once with the second contract text.
[0116] In some implementations, step S150, calculating the similarity between the contract clause texts in the first contract text and the second contract text to obtain a target similarity, includes step S151' and step S152'.
[0117] S151': respectively obtain the number of contract clause texts in the first contract text and the number of contract clause texts in the second contract text.
[0118] S152': When the number of contract clause texts in the first contract text is different from the number of contract clause texts in the second contract text, output a preset minimum similarity as a target similarity.
[0119] The preset minimum similarity can be set to 0. In other embodiments, the preset minimum similarity can also be set to other parameter values, as long as the preset minimum similarity is less than the similarity threshold. In other words, when the number of contract clauses in the first contract text is different from the number of contract clauses in the second contract text, the target similarity obtained must be less than the similarity threshold.
[0120] That is to say, when calculating the similarity, we must first ensure that the number of contract clauses in the first contract text corresponds to the number of contract clauses in the second contract text. Otherwise, it indicates that there may be a problem of redundant or missing contract clauses in the first contract text. At this time, the output target similarity is less than the similarity threshold to avoid outputting the contract to be evaluated as the target contract.
[0121] See also Figure 8 In some embodiments, the contract generation method M100 also includes step S170.
[0122] S170: When the target similarity is less than or equal to the similarity threshold, send a warning message.
[0123] Among them, the early warning information is used to indicate that the evaluation result of the contract to be evaluated is unqualified, which means that there may be errors in the contract to be evaluated, so that relevant business personnel can revise the text content of the contract terms in this part in a timely manner.
[0124] Fig. 9 1 is a schematic block diagram of the structure of a contract generation system 1000 according to an embodiment of the present disclosure. The contract generation system 1000 is an electronic device.
[0125] The contract generation system 1000 comprises: The acquisition module 110 acquires the contract form information; The template module 120 extracts target information from the contract form information and fills the target information into a preset contract template to generate a contract to be evaluated; A text extraction module 130 extracts text content from the contract clause text in the contract to be evaluated to obtain a first contract text; The rendering module 140 renders the contract text of the contract form information based on the contract rendering parameters to obtain a second contract text, where the second contract text includes one or more contract clause texts; A similarity calculation module 150 calculates the similarity between the contract clause texts in the first contract text and the second contract text to obtain a target similarity; The output module 160 outputs the contract to be evaluated as a target contract when the target similarity is greater than a similarity threshold.
[0126] The hardware structure of the contract generation system 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300 and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.
[0127] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.
[0128] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.
[0129] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part.
[0130] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0131] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0132] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0135] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.
[0136] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0137] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.
Claims
1. A contract generation method, characterized in that: include: Get contract form information; Extracting target information from the contract form information, and filling the target information into a preset contract template to generate a contract to be evaluated; Extracting the text content of the contract clauses in the contract to be evaluated to obtain a first contract text; Based on the contract rendering parameters, the contract form information is rendered with a contract text to obtain a second contract text, where the second contract text includes one or more contract clause texts; Calculating the similarity between the first contract text and the contract clause text in the second contract text to obtain a target similarity; as well as When the target similarity is greater than a similarity threshold, the contract to be evaluated is output as a target contract.
2. The contract generation method according to claim 1, characterized in that: Extracting target information from the contract form information and filling the target information into a preset contract template to generate a contract to be evaluated, including: Determining the contract field type corresponding to the contract form information, and matching the corresponding contract template according to the contract field type; and Based on the contents of the fields to be filled in the contract template, the corresponding target text contents are matched in the text contents of the contract form information, and the matched target text is filled into the contract template to obtain the contract to be evaluated.
3. The contract generation method according to claim 1, characterized in that: Extract the text content of the contract clauses in the contract to be evaluated to obtain a first contract text, including: Identify and extract the text of each contract clause in the contract to be evaluated; Identify the clause type of each of the contract clauses in the contract to be evaluated; Based on whether the clause types are the same, classifying the texts of the contract clauses in the contract to be evaluated to obtain at least one classified clause set, wherein the contract clause texts in different classified clause sets have different clause types; and The first contract text is obtained based on each of the classified clause sets.
4. The contract generation method according to claim 1, characterized in that: The contract rendering parameters include a plurality of sub-parameters, and the contract rendering parameters are obtained based on training a contract text model, wherein the contract text model is used to generate a contract text according to input contract form data, and the contract text includes one or more contract clause texts; Based on the contract rendering parameters, the contract form information is rendered with a contract text to obtain a second contract text, where the second contract text includes one or more contract clause texts, including: Extract keywords from the contract form information to obtain multiple form fields; Get the clause labels corresponding to each of the form fields; Based on the sub-parameters corresponding to the same clause label, text rendering is performed on the form field corresponding to the same clause label to obtain the contract clause text corresponding to the clause label; and The second contract text is obtained based on the contract clause text corresponding to each of the clause tags.
5. The contract generation method according to claim 1, characterized in that: The target similarity includes the sub-similarity corresponding to each of the contract clauses in the first contract text and the second contract text; Calculating the similarity between the first contract text and the contract clause text in the second contract text to obtain a target similarity includes: The similarity between the contract clause text in the first contract text and the corresponding contract clause text in the second contract text is obtained one by one, and the sub-similarity corresponding to each contract clause text is obtained respectively.
6. The contract generation method according to claim 5, characterized in that: The step of acquiring the similarity between the contract clause text in the first contract text and the corresponding contract clause text in the second contract text one by one, and obtaining the sub-similarity corresponding to each contract clause text respectively, includes: Performing word segmentation processing on the contract clause text in the first contract text and the corresponding contract clause text in the second contract text respectively, to obtain a first word segmentation set corresponding to the first contract text and a second word segmentation set corresponding to the second contract text; Respectively obtaining a first word frequency of each word in the first word set and a second word frequency of each word in the second word set; Based on the first word frequency of each word in the first word set, vectorize and encode the first word set to obtain a first word frequency vector; Based on the second word frequency of each word in the second word set, vectorize and encode the second word set to obtain a second word frequency vector; and The cosine value of the angle between the first word frequency vector and the second word frequency vector is calculated to obtain the sub-similarity.
7. The contract generation method according to claim 5, characterized in that: When the target similarity is greater than a similarity threshold, outputting the contract to be evaluated as a target contract includes: When the sub-similarity corresponding to each of the contract clause texts in the first contract text is greater than a similarity threshold, the contract to be evaluated is output as a target contract.
8. The contract generation method according to claim 1, characterized in that: Calculating the similarity between the first contract text and the contract clause text in the second contract text to obtain a target similarity includes: Respectively obtaining the number of the contract clause texts in the first contract text and the number of the contract clause texts in the second contract text; and When the number of the contract clause texts in the first contract text is different from the number of the contract clause texts in the second contract text, the preset minimum similarity is output as the target similarity.
9. The contract generation method according to claim 1, characterized in that: Get contract form information, including: According to the input contract field type, a template form corresponding to the contract field type is generated, wherein the template form includes fixed text content and text content to be filled in; and When the text content to be filled in is completed, the filled in text content is obtained, and the contract form information is obtained according to the filled in text content and the fixed text content.
10. The contract generation method according to claim 1, characterized in that: Also includes: When the target similarity is less than or equal to the similarity threshold, a warning message is sent.
11. A contract generation system, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instructions stored in the memory so that the processor executes the contract generation method according to any one of claims 1 to 10.
12. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed by a processor, is used to implement the contract generation method according to any one of claims 1 to 10.
13. A computer program product, characterized in that The computer program product comprises a computer program, which is used at least to implement the contract generation method according to any one of claims 1 to 10 when executed by a processor.
