Contract information filling method and device, electronic equipment and storage medium
By splitting and clustering contract texts and forms, and using large language models to match and fill in, the problem that the accuracy of filling in contract information is affected by content changes is solved, and more efficient and accurate filling in of contract information is achieved.
Patent Information
- Application Number
- CN202411504219.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-01-17
AI Technical Summary
In the prior art, changes in the content of the contract text or contract form will cause the content extraction rules to be invalid and reduce the accuracy of filling in contract information.
By splitting the contract text and clustering the form content items in the contract form, the sub-contract text and form content items corresponding to each contract element theme are obtained, and matched and filled in based on the large language model to automatically fill in the contract text of missing information and/or missing information in the contract form form.
Even if the information corresponding to the contract element topic changes, the corresponding information can be found based on the contract element topic, thereby improving the accuracy and efficiency of filling in contract information.
Smart Images

Figure CN119323210A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device, electronic device and storage medium for filling in contract information. Background Art
[0002] In business cooperation, contract text and contract form play a vital role. Together, they ensure the clarification and protection of the rights and interests of both parties to the transaction. The contract text specifies the terms and responsibilities of the cooperation in detail, and is the basis of the cooperative relationship. The contract form summarizes the key information of the transaction in a concise and clear manner, such as the information of both parties, product details, price and payment terms. In order to achieve the efficiency and accuracy of the contract process, the mutual filling mechanism between the contract text and the contract form has become an indispensable link.
[0003] In related technologies, it is usually necessary to construct a regular expression based on pre-established content extraction rules, extract the corresponding content in the contract text or contract form based on regular expression technology, and then fill in the missing information in the contract text and / or contract form based on the extracted content.
[0004] However, in the above-mentioned related technologies, developers are required to formulate content extraction rules one by one. If the content of the contract text or contract form changes, the extraction of the content of the contract text or contract form based on the pre-formulated content extraction rules will result in extraction failure, thereby reducing the accuracy of the contract information filling. Summary of the invention
[0005] The present invention provides a method, device, electronic device and storage medium for filling in contract information, so as to solve the defect of reducing the accuracy of filling in contract information in the prior art.
[0006] The present invention provides a method for filling in contract information, comprising the following steps.
[0007] Obtain contract text and / or contract form; Splitting the contract text to obtain sub-contract texts corresponding to the first contract element themes in the contract text; and / or clustering the form content items in the contract form to obtain the form content items corresponding to each second contract element theme in the contract form; Matching the sub-contract texts corresponding to the first contract element subjects and the form content items corresponding to the second contract element subjects to obtain target sub-contract texts and target form content items corresponding to the same contract element subject; Based on the target sub-contract text and target form content items corresponding to the same contract element subject, fill in the missing information in the contract text and / or the missing information in the contract form.
[0008] According to a method for filling in contract information provided by the present invention, the contract text is split to obtain sub-contract texts corresponding to the first contract element themes in the contract text, including: Input the contract text into a large language model, split the contract text by the large language model, and obtain sub-contract texts corresponding to the first contract element themes output by the large language model; or
[0009] The contract type is determined based on the contract text, each of the first contract element themes is obtained based on the contract type, and the contract text is split based on each of the first contract element themes to obtain sub-contract texts corresponding to each of the first contract element themes.
[0010] According to a method for filling in contract information provided by the present invention, clustering the form content items in the contract form to obtain the form content items corresponding to each second contract element theme in the contract form includes: Input the contract form into a large language model, cluster the form content items in the contract form by using the large language model, and obtain the form content items corresponding to each of the second contract element themes output by the large language model; or
[0011] Determine a form type based on the contract form, obtain each second contract element theme based on the form type, cluster the form content items in the contract form based on each second contract element theme, and obtain form content items corresponding to each second contract element theme.
[0012] According to a method for filling in contract information provided by the present invention, filling in missing information in the contract text and / or missing information in the contract form based on the target sub-contract text and target form content items corresponding to each of the same contract element subjects includes: In the case where there is missing information in the contract text, determining a first target contract element subject corresponding to the missing information in the contract text, constructing a first filling prompt based on a target sub-contract text and a target form content item corresponding to the first target contract element subject, inputting the first filling prompt into at least one large language model, obtaining a filled-in target sub-contract text output by each of the large language models, and determining a target contract text based on each of the filled-in target sub-contract texts; And / or in the event that there is missing information in the contract form, determine the second target contract element subject corresponding to the missing information in the contract form, construct a second filling prompt based on the target sub-contract text and target form content items corresponding to the second target contract element subject, input the second filling prompt into at least one large language model, obtain the filled-in target form content items output by each of the large language models, and determine the target contract form based on each of the filled-in target form content items.
[0013] According to a method for filling in contract information provided by the present invention, determining a target contract text based on each of the filled in target sub-contract texts includes: Voting on each of the filled-in target sub-contract texts to obtain voting results; In a case where the voting result indicates that there is a completed first target sub-contract text with the largest number of votes, determining the target contract text based on the first target sub-contract text, the first target sub-contract text being a correctly completed text; When the voting result indicates that there is no filled-in first target sub-contract text with the largest number of votes, each filled-in target sub-contract text is output, and when a selection instruction input by the user is received, the target contract text is determined based on the filled-in target sub-contract text included in the selection instruction.
[0014] According to a method for filling in contract information provided by the present invention, the method further includes: Determine the target large language model corresponding to the incorrectly filled target sub-contract text; Based on the filled-in target sub-contract text with errors and the filled-in target sub-contract text included in the selection instruction, the model parameters of the target large language model are fine-tuned to obtain a fine-tuned target large language model.
[0015] According to a method for filling in contract information provided by the present invention, the method further includes: In the case where the sub-contract text corresponding to the third target contract element subject in the contract text is modified, a first synchronization prompt is generated based on the sub-contract text before modification and the sub-contract text after modification corresponding to the third target contract element subject, and the form content item corresponding to the third target contract element subject in the contract form, and the first synchronization prompt is input into at least one large language model to obtain a synchronized contract form output by each of the large language models; And / or when the form content item corresponding to the fourth target contract element subject in the contract form is modified, a second synchronization prompt is generated based on the form content item before modification, the form content item after modification, and the sub-contract text corresponding to the fourth target contract element subject in the contract text, and the second synchronization prompt is input into at least one large language model to obtain the synchronized contract text output by each of the large language models.
[0016] The present invention also provides a device for filling in contract information, comprising: An acquisition unit, used for acquiring a contract text and / or a contract form; a splitting unit, configured to split the contract text to obtain sub-contract texts corresponding to the first contract element themes in the contract text, and / or to cluster the form content items in the contract form to obtain the form content items corresponding to the second contract element themes in the contract form; A matching unit, configured to match the sub-contract text corresponding to each of the first contract element subjects with the form content item corresponding to each of the second contract element subjects, to obtain a target sub-contract text and a target form content item corresponding to the same contract element subject; A filling unit is used to fill in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items corresponding to each of the same contract element subjects.
[0017] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the contract information filling method described in any one of the above methods is implemented.
[0018] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the contract information filling method as described in any one of the above is implemented.
[0019] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned contract information filling methods.
[0020] The contract information filling method, device, electronic device and storage medium provided by the present invention split the acquired contract text to obtain the sub-contract text corresponding to each first contract element theme in the contract text, and / or cluster the form content in the acquired contract form to obtain the form content items corresponding to each second contract element theme in the contract form, match the sub-contract text corresponding to each first contract element theme with the form content items corresponding to each second contract element theme to obtain the target sub-contract text and target form content items corresponding to the same contract element theme, and then fill in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items corresponding to each same contract element theme. It can be seen that the present invention splits the contract text and / or the contract form based on the contract element theme, and automatically fills in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items of the same contract element theme. In this way, even if the information corresponding to the contract element theme changes, the corresponding information can be found based on the contract element theme, thereby improving the accuracy of contract information filling. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 This is one of the flow charts of the method for filling in contract information provided by an embodiment of the present invention.
[0023] Figure 2 This is an example diagram of contract text splitting provided by an embodiment of the present invention.
[0024] Figure 3 This is an example diagram of contract form splitting provided by an embodiment of the present invention.
[0025] Figure 4 This is an example diagram of the matching of form content items and sub-contract texts provided by an embodiment of the present invention.
[0026] Figure 5 This is an example diagram of filling in missing information in a contract text provided by an embodiment of the present invention.
[0027] Figure 6 This is an example diagram of filling in missing information in a contract form provided by an embodiment of the present invention.
[0028] Figure 7This is the second flow chart of the method for filling in contract information provided by an embodiment of the present invention.
[0029] Figure 8 This is the third flow chart of the method for filling in contract information provided by an embodiment of the present invention.
[0030] Fig. 9 This is the fourth flow chart of the method for filling in contract information provided by an embodiment of the present invention.
[0031] Fig.10 It is a schematic diagram of the overall process of the method for filling in contract information provided by an embodiment of the present invention.
[0032] Fig.11 It is a structural diagram of a contract information filling system provided by an embodiment of the present invention.
[0033] Fig.12 It is a structural diagram of a contract information filling device provided by an embodiment of the present invention.
[0034] Fig.13 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0036] Combine the following Figure 1-Figure 11 The contract information filling method of the present invention is described. The execution subject of the contract information filling method can be an electronic device such as a terminal, a computer or a server, or a contract information filling device set in the electronic device, and the contract information filling device can be implemented by software, hardware or a combination of the two.
[0037] Figure 1 FIG. 1 is one of the flow charts of the method for filling in contract information provided by an embodiment of the present invention. Figure 1 As shown, the method for filling in the contract information includes the following steps: Step 101: Obtain the contract text and / or contract form.
[0038] For example, the contract text and / or contract form that needs to be processed and is input by the user is obtained.
[0039] Step 102: split the contract text to obtain sub-contract texts corresponding to each first contract element theme in the contract text, and / or cluster the form content items in the contract form to obtain form content items corresponding to each second contract element theme in the contract form.
[0040] The contract text may be an unstructured contract text, and the contract form may be a structured contract form.
[0041] For example, when the contract text C is obtained, the contract text C is split according to the contract element theme, that is, the texts belonging to the same first contract element theme in the contract text C are aggregated together to obtain the sub-contract texts C corresponding to the first contract element themes in the contract text C. i ,but , where n represents the number of subjects of the first contract element, , C i The contract is divided into two parts according to the subject of the contract elements. i Split by contract type and contract element theme. For example, the general type of contract text includes { Sub-contract text of the subject element}, Sub-contract text for the subject of bidding site elements}, Sub-contract text on the subject of financial elements of the price}, Sub-contract text for the subject of the execution element}, Sub-contract text of the subject of the breach of contract element}, Sub-contract text of the subject of dispute resolution elements}, Other contract element themes can be configured according to specific contract types. That is, a contract text can be split into multiple subtasks based on the contract element theme, which not only reduces the difficulty of the overall task of contract element extraction and filling, but also improves the processing efficiency of the task through parallel processing of subtasks.
[0042] Figure 2 is an example diagram of contract text splitting provided by an embodiment of the present invention, such as Figure 2As shown, taking the contract text including the main element theme, the price financial element theme, the performance execution element theme and the other element theme as an example, the sub-contract text of the main element theme includes the specific information of Party A and Party B, the sub-contract text of the price financial element theme includes the contract price information, for example, the contract price information is: the contract tax-inclusive amount is RMB 1 million, and the value-added tax rate is 13%, the sub-contract text of the performance execution element theme includes the contract performance information, for example, the contract performance information is: within 15 working days after the contract is signed, Party B shall provide all the goods to the designated location of Party A, after verification..., the sub-contract text of the other element theme includes the contract payment information, for example, the contract payment information is: pay a 10% advance payment within 5 working days after the contract is signed, etc.
[0043] For example, when the contract form F is obtained, the contract form F is clustered according to the contract element theme, that is, the form content items belonging to the same second contract element theme in the contract form F are clustered together to obtain the form content items corresponding to each second contract element theme in the contract form F. ,but , where n represents the number of subjects of the second contract element, , The contract is divided into two parts according to the subject of the contract elements. Split by contract type and contract element subject. For example, the general type of contract form includes { The form content item of the main element theme}, { The form content items of the landmark element theme}, { Form content items for the price financial element theme}, { The form content item that performs the execution element subject}, Form content items for the subject of the breach of contract liability element}, { Dispute Resolution Element Subject Matter Form Content Items}, { The form content items of the effective terms element subject}, etc. Other contract element subjects can be configured according to the specific contract type.
[0044] Figure 3 is an example diagram of contract form splitting provided by an embodiment of the present invention, such as Figure 3 As shown, taking the contract form including the subject of the main elements, the subject of the price and financial elements, the subject of the performance and execution elements and the subject of other elements as an example, the form content items of the subject of the main elements include the full name of our party and the other party, the form content items of the subject of the price and financial elements include the contract amount, contract currency, value-added tax rate and value-added tax amount, the form content items of the subject of the performance and execution elements include the contract performance period, and the form content items of the subject of other elements include customized structured element information, etc.
[0045] Step 103: Match the sub-contract texts corresponding to each of the first contract element subjects and the form content items corresponding to each of the second contract element subjects to obtain the target sub-contract texts and target form content items corresponding to the same contract element subject.
[0046] For example, when obtaining the sub-contract text corresponding to each first contract element theme and the form content item corresponding to each second contract element theme, for each first contract element theme, the first contract element theme is matched with each second contract element theme respectively, and when the second contract element theme matching the first contract element theme is obtained, it is indicated that the first contract element theme and the matched second contract element theme are the same contract element theme, thereby obtaining the target sub-contract text and target form content item corresponding to the same contract element theme.
[0047] For example, it can be based on and The contract elements and subjects are mapped and matched to obtain and The mutual mapping relationship , yes | and | The one-to-one mapping relationship is recorded. The ability of the large language model can also be used to identify and match the same contract element subject, for example, the form content item of the subject element subject| corresponds to the |sub-contract text of the subject element|, the form content item of the subject of the bid site element| corresponds to the |sub-contract text of the subject of the bid site element|, the form content item of the subject of the price and financial element| corresponds to the |sub-contract text of the subject of the price and financial element|, the form content item of the subject of the performance and execution element| corresponds to the |sub-contract text of the subject of the performance and execution element|, the form content item of the subject of the breach of contract liability element| corresponds to the |sub-contract text of the subject of the breach of contract liability element|, the form content item of the subject of the dispute resolution element| corresponds to the |sub-contract text of the subject of the dispute resolution element|, and the form content item of the subject of the effective clause element| corresponds to the |sub-contract text of the subject of the effective clause element|. Figure 4 is an example diagram of the matching of form content items and sub-contract texts provided by an embodiment of the present invention, such as Figure 4 As shown, |the form content item of the main element subject| and |the sub-contract text of the main element subject| correspond.
[0048] It should be noted that when no sub-contract text matching the form content item of the contract element subject is found, it is also necessary to add an unmatched mark to the form content item of the contract element subject, but the present invention does not limit this.
[0049] Step 104: Fill in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items corresponding to the same contract element subject.
[0050] For example, when the target sub-contract text and target form content item corresponding to the same contract element subject are obtained, if there is missing information in the contract text, the missing information in the target sub-contract text corresponding to the contract element subject to which the missing information belongs is automatically filled in based on the target form content item corresponding to the contract element subject to which the missing information belongs. This process can be called a process of automatically filling in the corresponding form content items in the structured contract form based on the sub-contract text in the unstructured contract text, and can also be called a C2F process; if there is missing information in the contract form, the missing information in the target form content item corresponding to the contract element subject to which the missing information belongs is automatically filled in based on the target sub-contract text corresponding to the contract element subject to which the missing information belongs. This process can be called a process of automatically filling in the corresponding sub-contract text in the unstructured contract text based on the form content items in the structured contract form, and can also be called an F2C process.
[0051] It should be noted that when it is necessary to fill in the missing information in the contract text, the contract text can be split to obtain the sub-contract texts corresponding to each first contract element theme in the contract text, and the form content items corresponding to each second contract element theme obtained by clustering the form content items of the contract form corresponding to the contract text in advance, and then the sub-contract texts corresponding to each first contract element theme and the form content items corresponding to each second contract element theme are matched to obtain the target sub-contract texts and target form content items corresponding to the same contract element theme; finally, based on the target sub-contract texts and target form content items corresponding to the same contract element theme, the missing information in the contract text is filled in.
[0052] When it is necessary to fill in the missing information in the contract form, the form content items in the contract form can be clustered to obtain the form content items corresponding to each second contract element subject in the contract form, and the form content items corresponding to each first contract element subject obtained by pre-splitting the contract text corresponding to the contract form can be obtained, and then the sub-contract text corresponding to each first contract element subject and the form content items corresponding to each second contract element subject can be matched to obtain the target sub-contract text and target form content items corresponding to the same contract element subject; finally, based on the target sub-contract text and target form content items corresponding to the same contract element subject, the missing information in the contract form can be filled in.
[0053] When it is necessary to fill in the missing information in the contract text and the missing information in the contract form at the same time, the contract text is split to obtain the sub-contract texts corresponding to the first contract element themes in the contract text, and the form content items in the contract form are clustered to obtain the form content items corresponding to the second contract element themes in the contract form; the sub-contract texts corresponding to the first contract element themes and the form content items corresponding to the second contract element themes are matched to obtain the target sub-contract texts and target form content items corresponding to the same contract element themes; based on the target sub-contract texts and target form content items corresponding to the same contract element themes, the missing information in the contract text and the missing information in the contract form are filled in each other.
[0054] The contract information filling method provided by the present invention splits the acquired contract text to obtain the sub-contract text corresponding to each first contract element theme in the contract text, and / or clusters the form content in the acquired contract form to obtain the form content items corresponding to each second contract element theme in the contract form, matches the sub-contract text corresponding to each first contract element theme with the form content items corresponding to each second contract element theme, obtains the target sub-contract text and target form content items corresponding to the same contract element theme, and then fills in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items corresponding to each same contract element theme. It can be seen that the present invention splits the contract text and the contract form based on the contract element theme, and automatically fills in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items of the same contract element theme. In this way, even if the information corresponding to the contract element theme changes, the corresponding information can be found based on the contract element theme, thereby improving the accuracy of contract information filling.
[0055] In one embodiment, the above step 102 splits the contract text to obtain sub-contract texts corresponding to the first contract element themes in the contract text, which can be implemented in the following two ways: The first method is to input the contract text into a large language model, split the contract text through the large language model, and obtain sub-contract texts corresponding to the first contract element themes output by the large language model.
[0056] For example, the contract text is input into the large language model, and the contract element themes in the contract text are analyzed by the large language model to obtain the first contract element themes included in the contract text, and then the sub-contract texts related to the first contract element themes are parsed in the contract text, and finally the sub-contract texts corresponding to the first contract element themes are output. For example, the large language model can be used based on the content of the sub-contract text {Party A: Limited Company Party B: Co., Ltd.} obtains the corresponding first contract element subject as the main element subject.
[0057] The second method is to determine the contract type based on the contract text, obtain the first contract element themes based on the contract type, split the contract text based on the first contract element themes, and obtain sub-contract texts corresponding to the first contract element themes.
[0058] For example, the contract element themes included in each type of contract text can be summarized in advance, and the correspondence between the contract type and the contract element themes can be stored. When the contract text input by the user is obtained, the contract text input by the user is analyzed to determine the contract type of the contract text input by the user. Based on the correspondence between the contract type and the contract element themes, the first contract element themes corresponding to the contract type of the contract text input by the user are searched, and then the sub-contract texts corresponding to the first contract element themes are parsed out in the contract text.
[0059] In this embodiment, the sub-contract text corresponding to each first contract element theme can be obtained through the large language model or the contract type, thereby realizing the automatic acquisition of the sub-contract text corresponding to each first contract element theme and improving the efficiency and accuracy of sub-contract text acquisition; in addition, the large language model has universality and generalization capabilities, so it can adapt to the task of splitting contract texts in different fields, different scenarios, and different types.
[0060] In one embodiment, the above step 102 clusters the form content items in the contract form to obtain the form content items corresponding to each second contract element subject in the contract form, which can be implemented in the following two ways: In a first method, the contract form is input into a large language model, and the form content items in the contract form are clustered by the large language model to obtain the form content items corresponding to each of the second contract element themes output by the large language model.
[0061] For example, the contract form is input into the large language model, and the contract element subject in the contract form is analyzed by the large language model to obtain each second contract element subject included in the contract form, and then the form content items related to the second contract element subject are parsed in the contract form, and finally the form content items corresponding to each second contract element subject are output. For example, the large language model can be used to obtain the corresponding first contract element subject as the subject element subject based on the content of the form content item {our subject, the other party subject}.
[0062] The second method is to determine the form type based on the contract form, obtain the subject of each second contract element based on the form type, cluster the form content items in the contract form based on each second contract element subject, and obtain the form content items corresponding to each second contract element subject.
[0063] For example, the contract element themes included in various types of contract forms can be summarized in advance, and the correspondence between form types and contract element themes can be stored. When the contract form entered by the user is obtained, the contract form entered by the user is analyzed to determine the form type of the contract form entered by the user. Based on the correspondence between the form type and the contract element themes, the second contract element themes corresponding to the form type of the contract form entered by the user are searched, and then the form content items corresponding to the second contract element themes are parsed in the contract form.
[0064] In this embodiment, the form content items corresponding to each second contract element subject can be obtained through the large language model or the contract type, thereby realizing the automatic acquisition of the form content items corresponding to each second contract element subject and improving the efficiency and accuracy of obtaining the form content items; in addition, the large language model has universality and generalization capabilities, so it can adapt to the clustering tasks of contract forms in different fields, scenarios, and types.
[0065] In one embodiment, the above step 104 fills in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items corresponding to each of the same contract element subjects, which can be specifically implemented in the following manner: In the case where there is missing information in the contract text, determine the first target contract element subject corresponding to the missing information of the contract text, construct a first filling prompt based on the target sub-contract text and target form content item corresponding to the first target contract element subject, input the first filling prompt into at least one large language model, obtain the filled-in target sub-contract text output by each of the large language models, and determine the target contract text based on each of the filled-in target sub-contract texts.
[0066] For example, for the target subcontract text with missing information Construct the first filling prompt. For example, the target sub-contract text with missing information in the contract text is {Contract price: Contract amount XX yuan (in capital letters XX yuan) RMB excluding tax, VAT rate XX%, VAT amount XX yuan}, where XX is the content to be filled in. Then it can be determined that the first target contract element subject corresponding to the missing information in the contract text is the Price Financial Element Subject, and the form content items of the Price Financial Element Subject are {"Contract amount excluding tax": 1001200.00, "VAT rate": "13%"}. The first filling prompt constructed based on the form content items of the Price Financial Element Subject and the target sub-contract text with missing information is as follows: Background context: You will play the role of a contract expert who is familiar with contract filling.
[0067] Instruction: Based on the given structured element information (the form content items of the price financial element theme), you need to complete the filling of the corresponding XX content in the contract text. You can infer the relevant element information if you can infer it, and fill in the relevant information if you cannot infer it. . Please note that the content of the contract text cannot be modified.
[0068] Enter input data: form content item of price financial element theme {"Contract amount excluding tax":1001200.00, "VAT rate": "13%"}, target sub-contract text with missing information {Contract price: contract amount excluding tax XX yuan (in capital XX yuan) RMB, VAT rate XX%, VAT amount XX yuan}.
[0069] Output indicator: Fill in the XX content in the contract text, keep 2 decimal places for the lowercase amount, and output the filled sub-contract text. At the same time, the inference-generated content is given in JSON format.
[0070] Furthermore, taking the three large language models as an example, the first filling prompt is input into the three large language models to obtain the filled-in target sub-contract text output by each large language model. The filled-in target sub-contract text output by any large language model can be used as the correct answer, and then the final filling of the missing information in the contract text can be completed based on the selected filled-in target sub-contract text.
[0071] Figure 5 is an example diagram of filling in missing information in a contract text provided by an embodiment of the present invention, such as Figure 5As shown, the contract amount excluding tax: 1001200.00, the value-added tax rate: 13% are extracted from the form content item of the price financial element theme {"Contract amount excluding tax": 1001200.00, "Value-added tax rate": "13%"} through the large language model, and the value-added tax amount 130156.00 is inferred. Then, the contract amount excluding tax: 1001200.00, the value-added tax rate: 13%, and the value-added tax amount 130156.00 are filled in the sub-contract text corresponding to the price financial element theme in the contract text.
[0072] And / or in the event that there is missing information in the contract form, determine the second target contract element subject corresponding to the missing information in the contract form, construct a second filling prompt based on the target sub-contract text and target form content items corresponding to the second target contract element subject, input the second filling prompt into at least one large language model, obtain the filled-in target form content items output by each of the large language models, and determine the target contract form based on each of the filled-in target form content items.
[0073] For example, for a target form content item with missing information Construct the second filling prompt. For example, if the target form content item with missing information in the contract form is the form content item about the price financial element topic, then the second target contract element topic can be determined to be the price financial element topic, and the target sub-contract text of the price financial element topic is {Contract price: Contract tax-inclusive amount of RMB 1 million (in capital letters RMB 1 million) RMB, VAT rate 13%}, then the second filling prompt constructed based on the target sub-contract text of the price financial element topic and the target form content item with missing information is as follows: Background context: You will play the role of a contract expert and be familiar with the work of contract element extraction.
[0074] Instructions: You need to complete the extraction of corresponding information in the contract text. If the information in the contract text is incomplete, you can infer the relevant information if you can, and fill in the blanks if you cannot infer.
[0075] Input data: {Contract price: The contract amount including tax is RMB 1,000,000 (in words: One million Yuan), and the value-added tax rate is 13%}.
[0076] Output requirements output indicator: Extract the tax-exclusive amount, contract currency, VAT rate, and VAT amount in the contract text and output them in JSON format. The unit is yuan, and 2 decimal places are retained. Yuan is not output together with the data.
[0077] Furthermore, taking the three large language models as an example, the second filling prompt is input into the three large language models to obtain the filled-in target form content items output by the large language models. The filled-in target form content items output by any large language model can be used as the correct answer, and then the final filling of the missing information in the contract form can be completed based on the selected filled-in target form content items.
[0078] Figure 6 is an example diagram of filling in missing information in a contract form provided by an embodiment of the present invention, such as Figure 6 As shown, the large language model is used to extract the contract amount excluding tax: 1001200.00, contract currency: RMB, VAT rate: 13%, VAT amount: 130156.00 from the sub-contract text of the price financial element theme {Contract price: contract amount including tax is RMB 1 million (in capital letters RMB 1 million), VAT rate 13%}, and then fill in the contract amount excluding tax: 1001200.00, contract currency: RMB, VAT rate: 13%, VAT amount: 130156.00 into the form content item corresponding to the price financial element theme in the contract form.
[0079] It should be noted that when the corresponding information in the contract text is incomplete, the corresponding information can also be inferred based on the reasoning ability of the large language model to improve the completeness of the contract text information extraction, and the present invention is not limited to this.
[0080] In this embodiment, the missing information in the contract text or the missing information in the contract form can be filled in based on the large language model, thereby improving the accuracy and efficiency of filling in the missing information.
[0081] In one embodiment, the above-mentioned determination of the target contract text based on the filled-in target sub-contract texts can be specifically implemented in the following manner: Voting is performed on each of the filled-in target sub-contract texts to obtain a voting result; when the voting result indicates that there is a filled-in first target sub-contract text with the largest number of votes, the target contract text is determined based on the first target sub-contract text, and the first target sub-contract text is the correctly filled-in text; when the voting result indicates that there is no filled-in first target sub-contract text with the largest number of votes, each of the filled-in target sub-contract texts is output, and when a selection instruction input by the user is received, the target contract text is determined based on the filled-in target sub-contract text included in the selection instruction.
[0082] For example, when the target sub-contract texts after filling in the output of the three large language models are obtained, the target sub-contract texts after filling in the output of the three large language models are voted on, and the missing information of the contract text is finally filled in. The purpose of using these three large language models for voting is to improve the accuracy of information filling. There are three voting results: 3:0, 2:1 or 1:1:1, where 3:0 means that the voters all choose the output result of the same large language model as the correct answer; 2:1 means that two voters choose the output result of the same large language model as the correct answer, and the other voter chooses the output result of another large language model as the correct answer; 1:1:1 means that the three voters each choose the output result of a large language model as the correct answer.
[0083] When the voting result is 3:0 or 2:1, the first completed target sub-contract text with the largest number of votes can be used as the correctly completed target sub-contract text, and then the final filling of the missing information in the contract text is completed based on the correctly completed target sub-contract text. When the voting result is 1:1:1, in this case, it is impossible to directly determine which completed target sub-contract text is the correct answer through the voting result. At this time, all the completed target sub-contract texts obtained are output for the user to select the correctly completed target sub-contract text. When receiving the selection instruction input by the user, the completed target sub-contract text included in the selection instruction is used as the correctly completed target sub-contract text, and then the final filling of the missing information in the contract text is completed based on the correctly completed target sub-contract text.
[0084] It should be noted that the present invention can also vote on the sub-information included in the filled-in target sub-contract text output by the major language models. For example, the voting result for the contract amount excluding tax is 3:0, the voting result for the contract currency is 2:1, the voting result for the value-added tax rate is 3:0, and the voting result for the value-added tax amount is 3:0. Based on the voting results of each sub-information, the correctly filled-in target sub-contract text is finally obtained. The present invention is not limited to this.
[0085] In this embodiment, the filled-in target sub-contract texts output by the major language models are voted on to obtain voting results, and the correct filled-in target sub-contract text is determined based on the voting results, thereby improving the accuracy of contract text filling. In addition, when the voting results indicate that there is no filled-in first target sub-contract text with the largest number of votes, the correctly filled-in target sub-contract text is also obtained based on manual review to ensure that the final filling of the missing information in the contract text is completed based on the correctly filled-in target sub-contract text, which can also improve the accuracy of contract text filling and reduce the errors and risks that may be caused by a single large language model.
[0086] In one embodiment, the above-mentioned determination of the target contract form based on the filled-in target form content items can be specifically implemented in the following manner: Voting is performed on each of the filled-in target form content items to obtain a voting result; when the voting result indicates that there is a filled-in first target form content item with the largest number of votes, the target contract form is determined based on the first target form content item, and the first target form content item is a correctly filled-in content item; when the voting result indicates that there is no filled-in first target form content item with the largest number of votes, each of the filled-in target form content items is output, and when a selection instruction input by a user is received, the target contract form is determined based on the filled-in target form content items included in the selection instruction.
[0087] For example, when the filled target form content items output by the three large language models are obtained, the filled target form content items output by the three large language models are voted, and the missing information of the contract form is finally filled. The purpose of using the three large language models for voting is to improve the accuracy of information filling. There are three voting results: 3:0, 2:1 or 1:1:1. When the voting result is 3:0 or 2:1, the first filled target form content item with the largest number of votes can be used as the correctly filled target form content item, and then the final filling of the missing information in the contract form is completed based on the correctly filled target form content item. When the voting result is 1:1:1, in this case, it is impossible to directly determine which filled target form content item is the correct answer through the voting result. At this time, all the obtained filled target form content items are output for the user to select the correct filled target form content item. When the selection instruction input by the user is received, the filled target form content item included in the selection instruction is used as the correctly filled target form content item, and then the final filling of the missing information in the contract form is completed based on the correctly filled target form content item.
[0088] It should be noted that the present invention can also vote on each sub-information included in the filled-in target form content item output by each language model, and finally obtain the correctly filled-in target form content item based on the voting results of each sub-information, and the present invention is not limited to this.
[0089] In this embodiment, the filled-in target form content items output by the major language models are voted on to obtain voting results, and the correct filled-in target form content items are determined based on the voting results, thereby improving the accuracy of contract form filling. In addition, when the voting results indicate that there is no filled-in first target form content item with the largest number of votes, the correctly filled-in target form content items are also obtained based on manual review to ensure that the final filling of the missing information in the contract form is completed based on the correctly filled-in target form content items, which can also improve the accuracy of contract form filling.
[0090] In one embodiment, Figure 7 FIG. 2 is a flow chart of the method for filling in contract information provided by an embodiment of the present invention. Figure 7 As shown, the contract information filling method also includes the following steps: Step 701: Determine the target large language model corresponding to the incorrectly filled target sub-contract text.
[0091] For example, when the voting result is 3:0, the large language model corresponding to the first target sub-contract text after completion with the largest number of votes is used as the correct large language model, and the other large language models are used as the target large language models, that is, the large language models corresponding to the target sub-contract text after completion with errors.
[0092] Step 702: based on the filled-in target sub-contract text with errors and the filled-in target sub-contract text included in the selection instruction, fine-tune the model parameters of the target large language model to obtain a fine-tuned target large language model.
[0093] For example, based on the incorrectly filled-in target sub-contract text output by the target large language model and the correctly filled-in target sub-contract text included in the selection instruction input by the user, loss information is constructed, and the model parameters of the target large language model are iteratively optimized based on the loss information to finally obtain a fine-tuned target large language model.
[0094] It should be noted that the model parameters of the target large language model can also be fine-tuned based on the incorrectly filled-in target form content items and the filled-in target form content items included in the selection instructions, so as to further improve the accuracy of the fine-tuned target large language model. The present invention is not limited to this.
[0095] In this embodiment, the target large language model corresponding to the target sub-contract text filled in with errors is determined, and based on the target sub-contract text filled in with errors output by the target large language model and the target sub-contract text filled in included in the selection instruction, the model parameters of the target large language model are fine-tuned to obtain the fine-tuned target large language model, so that the output result of the fine-tuned target large language model is more accurate, further improving the accuracy of contract information filling and synchronization.
[0096] In one embodiment, Figure 8 FIG. 3 is a flow chart of the method for filling in contract information provided by an embodiment of the present invention. Figure 8 As shown, the contract information filling method also includes the following steps: Step 801: When the sub-contract text corresponding to the third target contract element subject in the contract text is modified, a first synchronization prompt is generated based on the sub-contract text before modification, the sub-contract text after modification, and the form content item corresponding to the third target contract element subject in the contract form.
[0097] For example, the sub-contract texts corresponding to each contract element theme in the contract text are monitored in real time, the modified sub-contract texts are identified, and the contract element theme to which the modified sub-contract text belongs is determined as the third target contract element theme, and then based on the sub-contract text before modification and the modified sub-contract text corresponding to the third target contract element theme, and the form content item corresponding to the third target contract element theme in the contract form, the first synchronization prompt is generated. Taking the third target contract element theme as the price financial element theme as an example, the generated first synchronization prompt is as follows: Instruction: Modification of the sub-contract text in the contract text requires synchronous modification of the information in the contract form.
[0098] Input data: The sub-contract text of the Price financial element theme {"Contract amount excluding tax": 1001200.00, "VAT rate": "13%"} adjusted the "VAT rate" to "6%". The modified sub-contract text is {"Contract amount excluding tax": 1001200.00, "VAT rate": "6%"}. The form content items corresponding to the Price financial element theme in the contract form are {"Contract amount excluding tax": 1001200.00, "Contract currency": "RMB", "VAT rate": "13%", "VAT amount": 130156.00}. The affected content needs to be updated.
[0099] Output indicator: The updated content must be in the same JSON format as the original content. Unmodified elements must remain unchanged, and the updated results must be output in JSON format.
[0100] It should be noted that the specific method for identifying the modified sub-contract text can refer to the identification method in the relevant technology, and the present invention will not be repeated here.
[0101] Step 802: Input the first synchronization prompt into at least one large language model to obtain a synchronized contract form output by each of the large language models.
[0102] For example, taking three large language models as an example, the first synchronization prompt is input into the three large language models to obtain the synchronized contract forms output by the large language models, and finally the synchronized contract form output by any large language model is taken as the correct answer.
[0103] It should be noted that the synchronized contract forms output by the various language models may also be voted on, and the correct synchronized contract form may be determined based on the voting results, which will not be elaborated in detail in the present invention.
[0104] It should be noted that the information synchronization cycle T may also be pre-set, and when a modified sub-contract text is identified and the information synchronization cycle T is reached, the information synchronization of the contract text and the contract form is completed.
[0105] In this embodiment, when the sub-contract text corresponding to the third target contract element theme in the contract text is modified, the corresponding information in the contract form can be automatically modified synchronously through the large language model, thereby improving the consistency of the contract text and the contract form. This solves the problems of manual synchronization required for modifying information, synchronization delay, and high error rate in traditional methods.
[0106] In one embodiment, Fig. 9 FIG. 4 is a flow chart of a method for filling in contract information provided by an embodiment of the present invention. Fig. 9 As shown, the contract information filling method also includes the following steps: Step 901: When the form content item corresponding to the fourth target contract element subject in the contract form is modified, a second synchronization prompt is generated based on the form content item before modification corresponding to the fourth target contract element subject, the form content item after modification, and the sub-contract text corresponding to the fourth target contract element subject in the contract text.
[0107] For example, the form content items corresponding to each contract element theme in the contract form are monitored in real time, the modified form content items are identified, and the contract element theme to which the modified form content items belong is determined as the fourth target contract element theme, and then based on the form content items before modification and the modified form content items corresponding to the fourth target contract element theme, and the sub-contract text corresponding to the fourth target contract element theme in the contract text, a second synchronization prompt is generated. Taking the fourth target contract element theme as the price financial element theme as an example, the generated second synchronization prompt is as follows: Instruction: Modification of the form content items in the contract form requires synchronous modification of the information in the contract text.
[0108] Enter input data: The form content item of the Price financial element theme {"Contract amount excluding tax":1001200.00, "Contract currency": "RMB", "VAT rate": "13%", "VAT amount": 130156.00} has adjusted "VAT rate" to "6%". The modified form content item is {"Contract amount excluding tax":1001200.00, "Contract currency": "RMB", "VAT rate": "6%, "VAT amount": 130156.00}. The sub-contract text corresponding to the Price financial element theme in the contract text is {"Contract amount excluding tax": 1001200.00,"Contract currency": "RMB", "VAT rate": "13%", "VAT amount": 130156.00}. The affected content needs to be updated.
[0109] Output indicator: The updated content must be in the same JSON format as the original content. Unmodified elements must remain unchanged, and the updated results must be output in JSON format.
[0110] It should be noted that the specific method for identifying the modified form content items can refer to the identification method in the related art, and the present invention will not be repeated here.
[0111] Step 902: Input the second synchronization prompt into at least one large language model to obtain a synchronized contract text output by each of the large language models.
[0112] For example, taking three large language models as an example, the second synchronization prompt is input into the three large language models to obtain the synchronized contract text output by each large language model, and finally the synchronized contract text output by any large language model is taken as the correct answer.
[0113] It should be noted that the synchronized contract texts output by the various language models may also be voted on, and the correct synchronized contract text may be determined based on the voting results, which will not be elaborated in detail in the present invention.
[0114] It should be noted that the information synchronization period T may also be preset, and when a modified form content item is identified and the information synchronization period T is reached, the information synchronization of the contract text and the contract form is completed.
[0115] In this embodiment, when the form content item corresponding to the fourth target contract element subject in the contract form is modified, the corresponding information in the contract text can be automatically and synchronously modified through the large language model, thereby improving the consistency between the contract text and the contract form.
[0116] In one embodiment, the contract information filling method further includes the following steps: In the case that both the sub-contract text corresponding to the third target contract element theme in the contract text and the form content item corresponding to the fourth target contract element theme in the contract form are modified, a first synchronization prompt is generated based on the sub-contract text before modification and the sub-contract text after modification corresponding to the third target contract element theme, and the form content item corresponding to the third target contract element theme in the contract form, and the first synchronization prompt is input into at least one large language model to obtain the synchronized contract form output by each of the large language models; and a second synchronization prompt is generated based on the form content item before modification and the form content item after modification corresponding to the fourth target contract element theme, and the sub-contract text corresponding to the fourth target contract element theme in the contract text, and the second synchronization prompt is input into at least one large language model to obtain the synchronized contract text output by each of the large language models.
[0117] Fig.10 FIG. 1 is a schematic diagram of the overall flow of the method for filling in contract information provided by an embodiment of the present invention. Fig.10 As shown, the contract information filling method includes element content preprocessing, contract element subject matching, contract information extraction and generation filling, filled information verification, model capability tuning and contract information change monitoring synchronization.
[0118] Among them, the element content preprocessing includes splitting the contract text to obtain the sub-contract text corresponding to each first contract element theme in the contract text; clustering the form content items in the contract form to obtain the form content items corresponding to each second contract element theme in the contract form. The element content to be extracted and filled in is split into small module units.
[0119] The contract element subject matching includes matching the sub-contract text corresponding to each first contract element subject and the form content item corresponding to each second contract element subject to obtain the target sub-contract text and target form content item corresponding to the same contract element subject.
[0120] Contract information extraction, generation and filling include information extraction, generation and filling of target sub-contract texts and target form content items corresponding to the same contract element theme. First, a large language model prompt project is constructed for two types of tasks. The first type is to automatically fill in the first filling prompt of the corresponding form content item in the structured contract form based on the sub-contract text in the unstructured contract text. The second type is to automatically fill in the second filling prompt based on the corresponding sub-contract text in the unstructured contract text based on the form content item in the structured contract form. According to different task types, the corresponding tasks can be completed through the corresponding filling prompt. In order to ensure the accuracy of filling, three large models are used to vote on the extracted and generated content. There are three voting results: 3:0 / 2:1 / 1:1:1. The former two cases take the former as the final result, and the last case prompts that the voting failed and is handled manually.
[0121] Information verification includes manual review and verification of information with different votes from multiple large language models to ensure the accuracy of information generation.
[0122] Model capability tuning is based on the different contents of the verification information, and human-supervised reinforcement learning is performed on the current large language model to fine-tune the large language model and improve the accuracy of contract element extraction and generation.
[0123] Contract information change monitoring and synchronization includes real-time monitoring of sub-contract texts and form content items, synchronizing changed information, and ensuring the consistency of contract texts and contract forms.
[0124] Fig.11 Schematic diagram of the structure of the contract information filling system provided by the embodiment of the present invention. Fig.11 As shown in the figure, the contract information filling system adopts a layered architecture design. The application layer mainly includes the element information extraction module and the element information synchronization module. The service layer mainly includes the contract element theme splitting and clustering module, the prompt management module, the voting function module, the verification and tuning module and the large model pool module. The storage layer mainly stores information such as contract texts and contract forms.
[0125] (1) Element information extraction modules, C2F and F2C, whose main function is to realize information extraction from contract text to contract form, and from contract form to contract text.
[0126] (2) Element information synchronization module: Its main function is to monitor the sub-contract text and form content items in real time, synchronize the changed information, and ensure the consistency of the contract text and contract form.
[0127] (3) Contract element subject splitting and clustering module, whose main function is to split the contract text to obtain the sub-contract text corresponding to each first contract element subject in the contract text; to cluster the form content items in the contract form to obtain the form content items corresponding to each second contract element subject in the contract form.
[0128] (4) Prompt management module: Its main function is to manage prompts for information extraction and synchronization. By writing prompts, relevant information can be extracted, generated or filled in.
[0129] (5) Voting function module: Its main function is to vote on the information extracted, generated and inferred by the three large language models, and determine the final correct information based on the voting results. Through the voting mode, the accuracy of information extraction, generation and filling is improved.
[0130] (6) Verification and tuning module: Its main function is to manually intervene in cases of inconsistent voting to ensure the accuracy of extraction, generation, and filling of content. At the same time, when the existing large language model does not work well, manual supervision reinforcement learning is performed to tune the existing large language model.
[0131] (7) The large model pool module manages multiple different large language models in a precise manner. By building a unified standard interface, a set of prompts can be adapted to different large language models.
[0132] (8) Data storage, mainly to achieve persistent storage of contract text, contract form, contract element subject, prompt project, voting and verification information.
[0133] The contract information filling system provided by the embodiment of the present invention reduces the demand for a large amount of annotated data and training resources through the large language model technology, and reduces the cost of contract element extraction. At the same time, the large language model supports sharing, avoiding the problem that the traditional small model needs to build and train multiple different models, and greatly reduces the development cost through the reuse of prompts. In addition, the same technical principle realizes the three tasks of C2F, F2C and information synchronization, and the corresponding work can be completed only by developing the prompt project. Compared with the traditional three different technical solutions to complete the three tasks of C2F, F2C and information synchronization, the implementation cost is reduced. The large language model is used to split the contract text, and multiple subtasks are carried out in parallel, which improves the efficiency of element extraction. At the same time, the prompt project determined by the contract element theme, multi-model fusion, voting decision-making strategy and differentiated manual verification and tuning solutions ensure the accuracy of element information extraction.
[0134] The contract information filling device provided by the present invention is described below. The contract information filling device described below and the contract information filling method described above can be referenced to each other.
[0135] Fig.12 is a schematic diagram of the structure of the contract information filling device provided by an embodiment of the present invention. Fig.12 As shown, the contract information filling device 1200 includes an acquisition unit 1201, a splitting unit 1202, a matching unit 1203 and a filling unit 1204; wherein: An acquisition unit 1201 is used to acquire a contract text and / or a contract form; The splitting unit 1202 is used to split the contract text to obtain sub-contract texts corresponding to the first contract element themes in the contract text, and / or to cluster the form content items in the contract form to obtain the form content items corresponding to the second contract element themes in the contract form; A matching unit 1203 is used to match the sub-contract text corresponding to each of the first contract element subjects with the form content item corresponding to each of the second contract element subjects to obtain a target sub-contract text and a target form content item corresponding to the same contract element subject; The filling unit 1204 is used to fill in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items corresponding to each of the same contract element subjects.
[0136] The contract information filling device provided by the present invention splits the acquired contract text to obtain the sub-contract text corresponding to each first contract element theme in the contract text, and / or clusters the form content in the acquired contract form to obtain the form content items corresponding to each second contract element theme in the contract form, matches the sub-contract text corresponding to each first contract element theme with the form content items corresponding to each second contract element theme to obtain the target sub-contract text and target form content items corresponding to the same contract element theme, and then fills in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items corresponding to each same contract element theme. It can be seen that the present invention splits the contract text and / or the contract form based on the contract element theme, and automatically fills in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items of the same contract element theme. In this way, even if the information corresponding to the contract element theme changes, the corresponding information can be found based on the contract element theme, thereby improving the accuracy of contract information filling.
[0137] Based on any of the above embodiments, the splitting unit 1202 is specifically used for: Input the contract text into a large language model, split the contract text by the large language model, and obtain sub-contract texts corresponding to the first contract element themes output by the large language model; or
[0138] The contract type is determined based on the contract text, each of the first contract element themes is obtained based on the contract type, and the contract text is split based on each of the first contract element themes to obtain sub-contract texts corresponding to each of the first contract element themes.
[0139] Based on any of the above embodiments, the splitting unit 1202 is further specifically configured to: Input the contract form into a large language model, cluster the form content items in the contract form by using the large language model, and obtain the form content items corresponding to each of the second contract element themes output by the large language model; or
[0140] Determine a form type based on the contract form, obtain each second contract element theme based on the form type, cluster the form content items in the contract form based on each second contract element theme, and obtain form content items corresponding to each second contract element theme.
[0141] Based on any of the above embodiments, the filling unit 1204 is specifically used for: In the case where there is missing information in the contract text, determining a first target contract element subject corresponding to the missing information in the contract text, constructing a first filling prompt based on a target sub-contract text and a target form content item corresponding to the first target contract element subject, inputting the first filling prompt into at least one large language model, obtaining a filled-in target sub-contract text output by each of the large language models, and determining a target contract text based on each of the filled-in target sub-contract texts; And / or in the event that there is missing information in the contract form, determine the second target contract element subject corresponding to the missing information in the contract form, construct a second filling prompt based on the target sub-contract text and target form content items corresponding to the second target contract element subject, input the second filling prompt into at least one large language model, obtain the filled-in target form content items output by each of the large language models, and determine the target contract form based on each of the filled-in target form content items.
[0142] Based on any of the above embodiments, the filling unit 1204 is further specifically used for: Voting on each of the filled-in target sub-contract texts to obtain voting results; In a case where the voting result indicates that there is a completed first target sub-contract text with the largest number of votes, determining the target contract text based on the first target sub-contract text, the first target sub-contract text being a correctly completed text; When the voting result indicates that there is no filled-in first target sub-contract text with the largest number of votes, each filled-in target sub-contract text is output, and when a selection instruction input by the user is received, the target contract text is determined based on the filled-in target sub-contract text included in the selection instruction.
[0143] Based on any of the above embodiments, the contract information filling device 1200 further includes: A determination unit, used for determining a target large language model corresponding to the target sub-contract text filled in with errors; A fine-tuning unit is used to fine-tune the model parameters of the target large language model based on the target sub-contract text filled in with errors and the target sub-contract text filled in included in the selection instruction to obtain a fine-tuned target large language model.
[0144] Based on any of the above embodiments, the contract information filling device 1200 further includes a first generating unit and / or a second generating unit: a first generating unit, configured to generate a first synchronization prompt based on the sub-contract text before modification, the sub-contract text after modification, and the form content item corresponding to the third target contract element subject in the contract form, when the sub-contract text corresponding to the third target contract element subject in the contract text is modified, and input the first synchronization prompt into at least one large language model to obtain a synchronized contract form output by each of the large language models; The second generation unit is used to generate a second synchronization prompt based on the form content item before modification, the form content item after modification, and the sub-contract text corresponding to the fourth target contract element subject in the contract text, when the form content item corresponding to the fourth target contract element subject in the contract form is modified, and input the second synchronization prompt into at least one large language model to obtain the synchronized contract text output by each of the large language models.
[0145] Fig.13 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Fig.13 As shown, the electronic device may include: a processor 1310, a communication interface 1320, a memory 1330 and a communication bus 1340, wherein the processor 1310, the communication interface 1320 and the memory 1330 communicate with each other through the communication bus 1340. The processor 1310 may call the logic instructions in the memory 1330 to execute the contract information filling method, which includes: obtaining a contract text and / or a contract form; splitting the contract text to obtain sub-contract texts corresponding to each first contract element subject in the contract text; and / or clustering the form content items in the contract form to obtain form content items corresponding to each second contract element subject in the contract form; matching the sub-contract texts corresponding to each first contract element subject with the form content items corresponding to each second contract element subject to obtain the target sub-contract text and target form content item corresponding to the same contract element subject; filling in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract texts and target form content items corresponding to each of the same contract element subjects.
[0146] In addition, the logic instructions in the above-mentioned memory 1330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, 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, and the computer software product is stored in a storage medium, including a number of 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 invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0147] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the contract information filling method provided by the above methods, which method includes: obtaining a contract text and / or a contract form; splitting the contract text to obtain sub-contract texts corresponding to each first contract element subject in the contract text; and / or clustering the form content items in the contract form to obtain form content items corresponding to each second contract element subject in the contract form; matching the sub-contract texts corresponding to each first contract element subject with the form content items corresponding to each second contract element subject to obtain the target sub-contract text and target form content item corresponding to the same contract element subject; filling in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract texts and target form content items corresponding to each of the same contract element subjects.
[0148] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the contract information filling method provided by the above-mentioned methods, the method comprising: obtaining a contract text and / or a contract form; splitting the contract text to obtain sub-contract texts corresponding to each first contract element subject in the contract text; and / or clustering the form content items in the contract form to obtain form content items corresponding to each second contract element subject in the contract form; matching the sub-contract texts corresponding to each first contract element subject with the form content items corresponding to each second contract element subject to obtain a target sub-contract text and a target form content item corresponding to the same contract element subject; filling in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract texts and the target form content items corresponding to each of the same contract element subjects.
[0149] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0150] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for filling in contract information, characterized in that: include: Obtain contract text and / or contract form; Splitting the contract text to obtain sub-contract texts corresponding to the first contract element themes in the contract text; and / or clustering the form content items in the contract form to obtain the form content items corresponding to each second contract element theme in the contract form; Matching the sub-contract texts corresponding to the first contract element subjects and the form content items corresponding to the second contract element subjects to obtain target sub-contract texts and target form content items corresponding to the same contract element subject; Based on the target sub-contract text and target form content items corresponding to the same contract element subject, fill in the missing information in the contract text and / or the missing information in the contract form.
2. The method for filling in contract information according to claim 1, characterized in that: The contract text is split to obtain sub-contract texts corresponding to the first contract element themes in the contract text, including: Input the contract text into a large language model, split the contract text by the large language model, and obtain sub-contract texts corresponding to the first contract element themes output by the large language model; or The contract type is determined based on the contract text, each of the first contract element themes is obtained based on the contract type, and the contract text is split based on each of the first contract element themes to obtain sub-contract texts corresponding to each of the first contract element themes.
3. The method for filling in contract information according to claim 1, characterized in that: The clustering of the form content items in the contract form to obtain the form content items corresponding to each second contract element theme in the contract form includes: Input the contract form into a large language model, cluster the form content items in the contract form by using the large language model, and obtain the form content items corresponding to each of the second contract element themes output by the large language model; or Determine a form type based on the contract form, obtain each second contract element theme based on the form type, cluster the form content items in the contract form based on each second contract element theme, and obtain form content items corresponding to each second contract element theme.
4. The method for filling in contract information according to claim 1, characterized in that: Filling in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items corresponding to each of the same contract element subjects includes: In the case where there is missing information in the contract text, determining a first target contract element subject corresponding to the missing information in the contract text, constructing a first filling prompt based on a target sub-contract text and a target form content item corresponding to the first target contract element subject, inputting the first filling prompt into at least one large language model, obtaining a filled-in target sub-contract text output by each of the large language models, and determining a target contract text based on each of the filled-in target sub-contract texts; And / or in the event that there is missing information in the contract form, determine the second target contract element subject corresponding to the missing information in the contract form, construct a second filling prompt based on the target sub-contract text and target form content items corresponding to the second target contract element subject, input the second filling prompt into at least one large language model, obtain the filled-in target form content items output by each of the large language models, and determine the target contract form based on each of the filled-in target form content items.
5. The method for filling in contract information according to claim 4, characterized in that: Determining the target contract text based on each of the filled-in target sub-contract texts includes: Voting on each of the filled-in target sub-contract texts to obtain voting results; In a case where the voting result indicates that there is a completed first target sub-contract text with the largest number of votes, determining the target contract text based on the first target sub-contract text, the first target sub-contract text being a correctly completed text; When the voting result indicates that there is no filled-in first target sub-contract text with the largest number of votes, each filled-in target sub-contract text is output, and when a selection instruction input by the user is received, the target contract text is determined based on the filled-in target sub-contract text included in the selection instruction.
6. The method for filling in contract information according to claim 5, characterized in that: The method further comprises: Determine the target large language model corresponding to the incorrectly filled target sub-contract text; Based on the filled-in target sub-contract text with errors and the filled-in target sub-contract text included in the selection instruction, the model parameters of the target large language model are fine-tuned to obtain a fine-tuned target large language model.
7. The method for filling in contract information according to any one of claims 1 to 6, characterized in that: The method further comprises: In the case where the sub-contract text corresponding to the third target contract element subject in the contract text is modified, a first synchronization prompt is generated based on the sub-contract text before modification and the sub-contract text after modification corresponding to the third target contract element subject, and the form content item corresponding to the third target contract element subject in the contract form, and the first synchronization prompt is input into at least one large language model to obtain a synchronized contract form output by each of the large language models; And / or when the form content item corresponding to the fourth target contract element subject in the contract form is modified, a second synchronization prompt is generated based on the form content item before modification, the form content item after modification, and the sub-contract text corresponding to the fourth target contract element subject in the contract text, and the second synchronization prompt is input into at least one large language model to obtain the synchronized contract text output by each of the large language models.
8. A device for filling in contract information, characterized in that: include: An acquisition unit, used for acquiring a contract text and / or a contract form; a splitting unit, configured to split the contract text to obtain sub-contract texts corresponding to the first contract element themes in the contract text, and / or to cluster the form content items in the contract form to obtain the form content items corresponding to the second contract element themes in the contract form; A matching unit, configured to match the sub-contract text corresponding to each of the first contract element subjects with the form content item corresponding to each of the second contract element subjects, to obtain a target sub-contract text and a target form content item corresponding to the same contract element subject; A filling unit is used to fill in the missing information in the contract text and / or the missing information in the contract form based on the target sub-contract text and target form content items corresponding to each of the same contract element subjects.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the contract information filling method as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the contract information filling method as described in any one of claims 1 to 7.
Citation Information
Cited By
Webpage form control intelligent filling method and system based on page change monitoring
CN120995997A