Contract risk identification method based on large language model, computer equipment and readable storage medium

By using large language models and word vector models in contract risk identification, contract texts are processed in a targeted manner, and feature vectors and risk prompt words are generated, which solves the problems of low efficiency and low accuracy in the existing technology and achieves high efficiency and accuracy. Contract risk identification.

CN118657633AInactive Publication Date: 2024-09-17FUJIAN CHENXI INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411131605.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-09-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technology cannot specifically output the risk categories that auditors are concerned about during contract risk identification, and traditional manual processing is inefficient and does not fully utilize the powerful language understanding and generation capabilities of large language models, resulting in low identification efficiency and accuracy.

Method used

By training contract sample data and law and regulation sample data, a large language model and a word vector model are generated, the names and descriptions of risk categories of contract clauses are set, feature vectors and risk prompt words are generated, different segmentation symbols are used to process the contract text, and use The large language model performs risk identification and merges clause vectors with high similarity to improve identification efficiency and accuracy.

Benefits of technology

It achieves the targeted output of risk categories that auditors are concerned about, improves the processing efficiency and accuracy of contract risk identification, avoids the inefficiency caused by long text analysis, makes full use of the ability of large language models, and enhances the effect of risk identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657633A
    Figure CN118657633A
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to a contract risk identification method based on a large language model, computer equipment and a readable storage medium. The method comprises the following steps: constructing a large language model and a word vector model for contract term risk identification; constructing a contract term risk category vector set and a risk prompt word set according to the name and description of the contract term risk category; segmenting the to-be-identified contract text to obtain a contract term set and a corresponding contract term vector set; and traversing the risk categories of the contract terms, and inputting the contract terms of the same category and the risk cues into the large language model to obtain the contract term risk corresponding to the risk category of the contract terms. According to the technical scheme, the risk list of the category concerned by the auditor can be output in a targeted mode, and the processing efficiency and accuracy of contract risk identification are improved by preprocessing the contract text to be identified and introducing the large language model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and specifically to a contract risk identification method based on a large language model, a computer device, and a readable storage medium. Background Art

[0002] Contract risk assessment refers to a comprehensive and systematic assessment of the various risks that may be involved in a contract to determine the risk level of the contract and the impact these risks may have on the performance of the contract. This process is designed to help all parties to the contract understand the risk status of the contract and formulate corresponding risk response strategies to ensure the smooth performance of the contract.

[0003] In the field of engineering construction, a large engineering project has a large number of contracts that need to be risk assessed every year. The traditional manual processing method to assess contract risks can no longer meet the requirements. Not only is the assessment workload huge, but it is also inefficient and inaccurate. Therefore, it is quite common to use information technology to assist auditors in contract risk assessment. However, the existing contract risk identification technology still has the following shortcomings: First, in actual application scenarios, for the same contract text, auditors from different departments focus on different risk points, and the existing technology cannot output a list of risks that auditors are concerned about in a targeted manner; second, when dealing with the identification of contract texts, long contract texts are usually directly identified, resulting in extremely low processing efficiency in scenarios where a large number of risk points need to be identified; in addition, with the vigorous development of large language models, existing technologies have not fully utilized the powerful language understanding and generation capabilities of large models to further improve the efficiency and accuracy of contract risk identification.

[0004] Therefore, how to efficiently and accurately identify risk points of different risk categories in contract texts based on large language models is an urgent problem to be solved. Summary of the invention

[0005] One of the purposes of the present invention is to overcome the above shortcomings and provide a contract risk identification method based on a large language model, which can output a risk list of categories that auditors are concerned about in a targeted manner, and improve the processing efficiency and accuracy of contract risk identification by preprocessing the contract text to be identified and introducing a large language model.

[0006] In order to solve the above technical problems, the present invention provides a contract risk identification method based on a large language model, comprising the following steps: S1. Use contract sample data to train the basic model and obtain the large language model CXLLM for contract clause risk identification; S2. Use sample data of laws and regulations related to contracts to train the basic word vector model to obtain the word vector model CXWE; S3. Set the name set of the contract clause risk category and its description set B ,in, n represents the number of risk categories of contract terms, a n Indicates n The name of the contract clause risk category, b n Indicates n Description of the risk category of each contract clause; S4, the name collection A Each element in is input into the word vector model CXWE and then vectorized to obtain a vector set ; The description set B Each element in is input into the word vector model CXWE and then vectorized to obtain the vector set VB ; According to the vector set VA and vector collection VB Calculate the contract terms risk category vector set VC = , the calculation formula is: = ,in, i The value range is 1 arrive n ; S5. According to the name set A Each element in generates its corresponding risk warning word set ,in, i The value range is 1 to n , n represents the number of risk categories of contract terms, Indicates i The risk warning word set corresponding to the elements, m Indicates i The number of risk warning words corresponding to each element; S6, judging whether the contract text to be identified contains a clause number, if so, executing step S7, otherwise executing step S8; S7. Use the clause sequence number as a segmentation mark to segment the contract text to be identified to obtain a set of contract clauses. ,in, k Represents the number of contract clauses, and then each contract clause is input into the word vector model CXWE to obtain the contract clause vector set VS ; Jump to step S10 to continue execution; S8. Use a period as a segmentation mark to segment the contract text to be identified to obtain a temporary set of contract terms. ,in,t Represents the number of contract clauses after being segmented by periods, and then each contract clause is input into the word vector model CXWE for vectorization to obtain a temporary vector set of contract clauses ; S9, the temporary vector set of the contract terms The vectors in are merged according to similarity to obtain the contract clause vector set and its corresponding set of contract terms ,in, k Indicates the number of contract clauses; S10, set loop variables i The value of is 1; S11. From the contract clause risk category vector set VC Winning VC i As the current processing category vector; S12. Traverse the contract clause vector set VS , calculate each contract clause vector vs j and vc i The contract clause vectors whose similarity values ​​are greater than the preset similarity threshold are vs j A vector set of contract clauses that make up the current processing category SC i , and The similarity calculation formula is: Sim( )= ,in, j The value range is 1 to k , vs j Represents a set of vectors with the same terms VS Middle j contract terms vector, a The value range is 1 to b , b Represents the contract terms vector VS j The number of elements , Representation vector vs j No. a elements, Representation vector vc i No. a elements; S13. Set the contract clause vector of the current processing category SC iThe contract clauses corresponding to all vectors in are combined into the contract text content to be checked. P i .

[0007] S14. Obtain the risk warning word set corresponding to the current processing category vector T i ,Will T i Merge the risk warning words in the S15. The content of the contract P i The combined risk warning words are input into the large language model CXLLM to obtain the contract clause risk of the current processing category; S16, determine the loop variable i Is the value less than n If yes, go to step S17, otherwise go to step S18; S17, loop variable i The value of is increased by 1, and the process jumps to step S11 to continue the execution; S18. Output the contract clause risks corresponding to all contract clause risk categories.

[0008] The technical solution of the present application, firstly, sets names and descriptions for different categories of contract risks respectively, generates corresponding feature vectors and corresponding risk warning words, and users can only set the contract risk categories they are concerned about, so that the processing is more targeted; secondly, for the contract text to be evaluated, the present solution can use different segmentation symbols to segment it according to the actual situation, so as to avoid the inefficiency caused by the use of long text analysis; thirdly, the solution of the present application introduces a large language model for risk identification, and makes full use of the powerful language understanding ability of the large model to further improve the efficiency and accuracy of contract risk identification.

[0009] Further, the name set A Each element in generates its corresponding risk warning word set , the specific steps are: According to the name set A For each element in the contract, a risk warning word for the risk category of the contract clause is generated based on the preset template.

[0010] Further, the name set A Each element in generates its corresponding risk warning word set , the specific steps are: According to the name set A For each element in, a risk warning word of the risk category of the contract clause is generated based on the large language model CXLLM.

[0011] Furthermore, the contract risk identification method based on the large language model further includes the following steps: Add or modify risk warning words corresponding to the risk categories of contract terms according to actual needs.

[0012] For the risk warning words that need to be identified for each contract risk category, this technical solution can be generated through templates preset by auditors based on historical experience, or it can be generated with the help of existing large language models, and then manually adjusted on this basis to ensure that the risk points that need to be identified for each contract risk category are more complete and the identification results are more comprehensive.

[0013] Furthermore, the temporary vector set of the contract terms The vectors in the combination are combined according to the similarity to obtain the contract clause vector set and its corresponding set of contract terms , including the following steps: S101, Initialize loop variables j The value of is 1; S102: temporary vector set Vector in vs j Set to the first vector; S103: Determine temporary vector set Is there an unprocessed vector in vs j+1 , if it exists, execute step S104, otherwise execute step S110; S104, vector vs j+1 Set as the second vector, calculate the similarity between the first vector and the second vector, the calculation formula is: Sim( )= ,in, j The value range is 1 to t , the value range of a is 1 to b , b Indicates the number of elements in the first vector , The first vector a elements, The second vector a elements; S105, determining whether the similarity between the first vector and the second vector is greater than a preset similarity threshold, if so, executing step S106, otherwise executing step S108; S106, merging the contract terms corresponding to the first vector and the contract terms corresponding to the second vector, and inputting the result into the word vector model CXWE for vectorization to obtain a third vector; S107, setting the third vector as a new first vector; jumping to step S109 to continue execution; S108. Add the contract clause corresponding to the first vector to the contract clause set S , add the first vector to the contract terms vector set VS ; Set the second vector to be the new first vector; S109, loop variable j The value of is increased by 1; jump to step S103 to continue execution; S110. Add the contract clause corresponding to the first vector to the contract clause set S , add the first vector to the contract terms vector set VS .

[0014] The technical solution of the present application adopts a similarity comparison method for contract clauses separated by periods, which can try to merge adjacent clauses involving the same category of contract risks together for processing, reduce the number of processing, and further improve the processing efficiency of subsequent risk identification.

[0015] Furthermore, the preset similarity threshold is 0.6.

[0016] Accordingly, the present application also provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above-mentioned contract risk identification methods based on a large language model when executing the computer program.

[0017] Accordingly, the present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any of the above-mentioned contract risk identification methods based on a large language model are implemented.

[0018] Compared with the prior art, the advantages of the technical solution of the present application include: 1. Set names and descriptions for different types of contract risks, generate corresponding feature vectors and corresponding risk warning words. Users can only set the contract risk categories they are concerned about, so that the processing is more targeted.

[0019] 2. For the risk warning words that need to be identified for each contract risk category, this technical solution can be generated through templates preset by auditors based on historical experience, or with the help of existing large language models, and then manually adjusted on this basis to ensure that the risk points that need to be identified for each contract risk category are more complete and the identification results are more comprehensive.

[0020] 3. For the contract text to be evaluated, this solution can use different segmentation symbols to segment it according to the actual situation, which can avoid the inefficiency caused by long text analysis; at the same time, the similarity comparison method is used for the contract clauses separated by periods, and the adjacent clauses involving the same category of contract risks can be merged together as much as possible to reduce the number of processing and further improve the efficiency of subsequent risk identification.

[0021] 4. The solution of this application introduces a large language model for risk identification, making full use of the powerful language understanding ability of the large model to further improve the efficiency and accuracy of contract risk identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a flow chart of the steps of a contract risk identification method based on a large language model of the present invention.

[0023] Figure 2 It is a flow chart of the steps of merging vectors in a temporary vector set of contract terms according to similarity in the present invention. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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. Embodiment 1

[0025] like Figure 1 FIG. 1 is a flowchart of a method for identifying contract risks based on a large language model according to the present invention, comprising the following steps: S1. Use contract sample data to train the basic model to obtain a large language model CXLLM for contract clause risk identification. In the field of construction engineering, the contract sample data commonly used for training can be different types of contract sample data such as construction engineering cost contracts, construction engineering quantity contracts, construction engineering consulting contracts, or construction engineering software customization contracts. These contract sample data are trained based on existing basic models such as ERNIE and Tongyi Qianwen to form a large language model CXLLM (CX Large Language Model) that meets the requirements of construction engineering contract review. After the large language model CXLLM is trained with contract sample data, the accuracy of subsequent contract risk identification in the field of construction engineering will be further improved.

[0026] S2. Use sample data of laws and regulations related to contracts to train the basic word vector model to obtain the word vector model CXWE (CX Word Embedding). The basic word vector model can be a general model such as ERNIE and Tongyi Qianwen. Inputting a word into the word vector model CXWE will obtain the vector corresponding to the word. The vector has multiple elements, each of which can be understood as an attribute of the word, or represents the position information of the element in the semantic space. Similar words are closer in the vector space. For example, the vectors corresponding to "cat" and "dog" are closer in the vector space than the vectors corresponding to "cat" and "run", reflecting their semantic similarity. In addition, if a sentence is input into the word vector model CXWE for vectorization, the resulting sentence vector will be a vector containing more elements.

[0027] S3. Set the name set of the contract clause risk category and its description set B ,in, n represents the number of risk categories of contract terms, a n Indicates n The name of the contract clause risk category, b n Indicates n A description of the risk category of each contract clause.

[0028] For example, the names of the contract clause risk categories can be "intellectual property", "dispute resolution", and "delivery and acceptance". The corresponding descriptions of the above three contract clause risk categories are "the intellectual property clauses in the contract are intended to clarify ownership, usage rights, confidentiality obligations, infringement liability, post-termination rights and dispute resolution mechanisms", "the dispute resolution clauses in the contract are intended to clarify the dispute handling method, jurisdiction, applicable law, evidence procedures, cost allocation and enforcement effectiveness", and "the delivery and acceptance clauses in the contract are intended to clarify delivery time, standards, procedures, non-conformity handling, delay liability and acceptance confirmation".

[0029] S4, the name collection A Each element in is input into the word vector model CXWE and then vectorized to obtain a vector set ; The description set B Each element in is input into the word vector model CXWE and then vectorized to obtain the vector set VB ; According to the vector set VA and vector collection VB Calculate the contract terms risk category vector set VC = , the calculation formula is: = ,in, i The value range is 1 arrive n。 Among them, A and B The purpose of adding and averaging the vectors is to allow key features to be superimposed.

[0030] The technical solution of the present application sets names and descriptions for different categories of contract risks, generates corresponding feature vectors and corresponding risk warning words, and users can only set the contract risk categories they are concerned about, making the processing more targeted.

[0031] S5. According to the name set A Each element in generates its corresponding risk warning word set ,in, i The value range is 1 to n , n represents the number of risk categories of contract terms, Indicates i The risk warning word set corresponding to the elements, m Indicates i The number of risk warning words corresponding to each element.

[0032] The technical solution of this application needs to generate corresponding risk warning words for each risk category of contract clauses. The risk warning words can be understood as risk points that need to be judged in subsequent risk identification. The more and more complete the risk warning words are, the more risk points need to be judged in the future. For example, for the contract risks of the intellectual property category, the corresponding risk warning words can be: "Is there a description of the intellectual property clause?", "Is the description of the intellectual property clause beneficial to Party B?", "Is there a risk of unclear ownership of the intellectual property?" and "Is there a risk of unclear usage rights?", etc.

[0033] In a preferred embodiment, according to the name set A Each element in generates its corresponding risk warning word set The specific steps are: according to the name set A For each element in the contract, a risk warning word for the risk category of the contract clause is generated based on a preset template. That is, for the name of each risk category of the contract clause, the auditor can set a template of a fixed and common set of risk warning words based on historical experience. These risk warning words serve as the risk points that must be checked for the risk category of the contract clause.

[0034] In another preferred embodiment, according to the name set A Each element in generates its corresponding risk warning word set The specific steps are: according to the name set A For each element in , a risk warning word of the risk category of the contract clause is generated based on the large language model CXLLM. In addition to generating the risk warning word of the risk category of the contract clause through a preset template, the name of the risk category of the contract clause can also be input into the large language model CXLLM, and the large language model CXLLM is used to generate the risk points that need to be checked for the risk category of the contract clause.

[0035] In another preferred embodiment, the auditor may also add or modify the risk warning words corresponding to the risk categories of the contract terms based on the above and according to actual needs.

[0036] For the risk warning words that need to be identified for each contract risk category, this technical solution can be generated through templates preset by auditors based on historical experience, or it can be generated with the help of existing large language models, and then manually adjusted on this basis to ensure that the risk points that need to be identified for each contract risk category are more complete and the identification results are more comprehensive.

[0037] S6. Determine whether the contract text to be identified contains a clause number. If so, execute step S7; otherwise, execute step S8.

[0038] S7. Use the clause sequence number as a segmentation mark to segment the contract text to be identified to obtain a set of contract clauses. ,in, k Represents the number of contract clauses, and then each contract clause is input into the word vector model CXWE to obtain the contract clause vector set VS ; Jump to step S10 to continue execution.

[0039] S8. Use a period as a segmentation mark to segment the contract text to be identified to obtain a temporary set of contract terms. ,in, t Represents the number of contract clauses after being segmented by periods, and then each contract clause is input into the word vector model CXWE for vectorization to obtain a temporary vector set of contract clauses .

[0040] S9, the temporary vector set of the contract terms The vectors in are merged according to similarity to obtain the contract clause vector set and its corresponding set of contract terms ,in, k Indicates the number of contract clauses. Since the number of contract clauses after segmentation using a period as a segmentation mark is large, and there may be several adjacent contract clauses belonging to the same contract risk category, this application also needs to determine the similarity of adjacent contract clauses and merge the clauses belonging to the same contract risk category to improve the efficiency of subsequent processing. Figure 2 As shown, it is a flowchart of the steps of merging the vectors in the temporary vector set of contract terms according to similarity in this application, including the following steps: S101, Initialize loop variables j The value of is 1.

[0041] S102: temporary vector set Vector in vs j Set to the first vector.

[0042] S103: Determine temporary vector set Is there an unprocessed vector in vs j+1 , if it exists, execute step S104, otherwise execute step S110.

[0043] S104, vector vs j+1 Set as the second vector, calculate the similarity between the first vector and the second vector, the calculation formula is: Sim( )= ,in, jThe value range is 1 to t , the value range of a is 1 to b , b It represents the number of elements of the first vector, and can also represent the number of elements of the second vector. The first vector a elements, The second vector a The similarity calculation formulas used in the technical solutions of this application are all cosine similarity calculation formulas.

[0044] S105 , determining whether the similarity between the first vector and the second vector is greater than a preset similarity threshold, if so, executing step S106 , otherwise executing step S108 .

[0045] S106. Merge the contract terms corresponding to the first vector and the contract terms corresponding to the second vector, and input them into the word vector model CXWE for vectorization to obtain a third vector.

[0046] S107, setting the third vector as a new first vector; jumping to step S109 to continue execution.

[0047] S108. Add the contract clause corresponding to the first vector to the contract clause set S , add the first vector to the contract terms vector set VS ; Set the second vector as the new first vector.

[0048] S109, loop variable j The value of is increased by 1; jump to step S103 to continue execution.

[0049] S110. Add the contract clause corresponding to the first vector to the contract clause set S , add the first vector to the contract terms vector set VS .

[0050] After the above loop traversal is completed, the merged contract terms set is obtained S And the corresponding contract terms vector set VS.

[0051] The technical solution of the present application can use different segmentation symbols to segment the contract text to be evaluated according to actual conditions, thereby avoiding the inefficiency caused by long text analysis; at the same time, a similarity comparison method is used for contract clauses segmented by periods, so that adjacent clauses involving the same category of contract risks can be merged together as much as possible to reduce the number of processes and further improve the efficiency of subsequent risk identification.

[0052] S10, set loop variables i The value of is 1.

[0053] S11. From the contract clause risk category vector set VC Winning VC i As the current processing category vector.

[0054] S12. Traverse the contract clause vector set VS , calculate each contract clause vector vs j and vc i The contract clause vectors whose similarity values ​​are greater than the preset similarity threshold are vs j A vector set of contract clauses that make up the current processing category SC i , and The similarity calculation formula is: Sim( )= ,in, j The value range is 1 to k , vs j Represents a set of vectors with the same terms VS Middle j contract terms vector, a The value range is 1 to b , b Represents the contract terms vector VS j The number of elements in the vector vc i The number of elements of Representation vector vs j No. a elements, Representation vector vc i No. a The similarity calculation formulas used in the technical solutions of this application are all cosine similarity calculation formulas.

[0055] S13. Set the contract clause vector of the current processing category SC i The contract clauses corresponding to all vectors in are combined into the contract text content to be checked. P i .

[0056] S14. Obtain the risk warning word set corresponding to the current processing category vector T i ,Will T iThe risk warning words in the .

[0057] S15. The content of the contract P i The large language model CXLLM is input with the merged risk warning words to obtain the contract clause risk of the current processing category.

[0058] S16, determine the loop variable i Is the value less than n If yes, execute step S17; otherwise, execute step S18.

[0059] S17, loop variable i The value of is increased by 1, and the process jumps to step S11 to continue the execution; By looping through each contract clause risk category vector, all contract clauses similar to the contract clause risk category vector are found, and the risk warning words corresponding to these contract clauses and the contract clause risk category are input into the large language model for analysis to obtain the contract clause risk of the contract clause risk category.

[0060] S18. Output the contract clause risks corresponding to all contract clause risk categories.

[0061] In a preferred embodiment, the preset similarity threshold in this solution is 0.6, and when the calculated similarity value is greater than 0.6, the two vectors are considered similar.

[0062] In summary, the technical solution of this application can output the contract clause risks of specific contract risk categories in a targeted manner. By preprocessing the contract text to be evaluated, it can avoid the inefficiency caused by long text analysis and try to merge adjacent clauses involving the same category of contract risks together for processing, thereby reducing the number of processing and improving the processing efficiency of risk identification. In addition, by introducing a large language model for risk identification, the powerful language understanding and generation capabilities of the large model are fully utilized to further improve the efficiency and accuracy of contract risk identification. Embodiment 2

[0063] This embodiment also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including independent servers, or server clusters composed of multiple servers) that can execute programs. The computer device of this embodiment includes at least but is not limited to: a memory and a processor that can communicate with each other through a system bus. In some embodiments, the memory can be an internal storage unit of the computer device, such as a hard disk or memory of the computer device, or an external storage device of the computer device, such as a plug-in hard disk, a smart memory card, etc. equipped on the computer device. The processor can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip, which is used to control the overall operation of the computer device. Specifically, in this embodiment, the processor is used to run a computer program stored in the memory, and when the processor executes the computer program, any of the steps of the above-mentioned contract risk identification method based on a large language model is implemented. Embodiment 3

[0064] This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored. When the program is executed by a processor, the steps of the contract risk identification method based on a large language model as described in any of the above items are implemented.

[0065] The above specific implementation modes are only detailed explanations of the technical solutions of the present invention. The present invention is not limited to the above embodiments. Any improvement or replacement based on the principles of the present invention should be within the protection scope of the present invention.

Claims

1. A contract risk identification method based on a large language model, characterized in that: The following steps are involved: S1. Use contract sample data to train the basic model and obtain the large language model CXLLM for contract clause risk identification; S2. Use sample data of laws and regulations related to contracts to train the basic word vector model to obtain the word vector model CXWE; S3. Set the name set of the contract clause risk category and its description set B ,in, n represents the number of risk categories of contract terms, a n Indicates n The name of the contract clause risk category, b n Indicates n Description of the risk category of each contract clause; S4, the name collection A Each element in is input into the word vector model CXWE and then vectorized to obtain a vector set ; Set the description B Each element in is input into the word vector model CXWE and then vectorized to obtain the vector set VB ; According to the vector set VA and vector collection VB Calculate the contract terms risk category vector set VC = , the calculation formula is: = ,in, i The value range is 1 arrive n ; S5. According to the name set A Each element in generates its corresponding risk warning word set ,in, i The value range is 1 to n , n represents the number of risk categories of contract terms, Indicates i The risk warning word set corresponding to the elements, m Indicates i The number of risk warning words corresponding to each element; S6, judging whether the contract text to be identified contains a clause number, if so, executing step S7, otherwise executing step S8; S7. Use the clause sequence number as a segmentation mark to segment the contract text to be identified to obtain a set of contract clauses. ,in, k Represents the number of contract clauses, and then each contract clause is input into the word vector model CXWE to obtain the contract clause vector set VS ; Jump to step S10 to continue execution; S8. Use a period as a segmentation mark to segment the contract text to be identified to obtain a temporary set of contract terms. ,in, t Represents the number of contract clauses after being segmented by periods, and then each contract clause is input into the word vector model CXWE for vectorization to obtain a temporary vector set of contract clauses ; S9, the temporary vector set of the contract terms The vectors in are merged according to similarity to obtain the contract clause vector set and its corresponding set of contract terms ,in, k Indicates the number of contract clauses; S10, set loop variables i The value of is 1; S11. From the contract clause risk category vector set VC Winning vc i As the current processing category vector; S12. Traverse the contract clause vector set VS , calculate each contract clause vector vs j and vc i The contract clause vectors whose similarity values ​​are greater than the preset similarity threshold are vs j A vector set of contract clauses that make up the current processing category SC i , and The similarity calculation formula is: Sim( )= ,in, j The value range is 1 to k , vs j Represents a set of vectors with the same terms VS Middle j contract terms vector, a The value range is 1 to b , b Represents the contract terms vector VS j The number of elements , Representation vector vs j No. a elements, Representation vector vc i No. a elements; S13. Set the contract clause vector of the current processing category SC i The contract clauses corresponding to all vectors in are combined into the contract text content to be checked. P i ; S14. Obtain the risk warning word set corresponding to the current processing category vector T i ,Will T i Merge the risk warning words in the S15. The content of the contract P i The combined risk warning words are input into the large language model CXLLM to obtain the contract clause risk of the current processing category; S16, determine the loop variable i Is the value less than n If yes, go to step S17, otherwise go to step S18; S17, loop variable i The value of is increased by 1, and the process jumps to step S11 to continue the execution; S18. Output the contract clause risks corresponding to all contract clause risk categories.

2. The contract risk identification method based on a large language model according to claim 1, characterized in that: The name set A Each element in generates its corresponding risk warning word set , the specific steps are: According to the name set A For each element in the contract, a risk warning word for the risk category of the contract clause is generated based on the preset template.

3. The contract risk identification method based on a large language model according to claim 1, characterized in that: The name set A Each element in generates its corresponding risk warning word set , the specific steps are: According to the name set A For each element in, a risk warning word of the risk category of the contract clause is generated based on the large language model CXLLM.

4. The contract risk identification method based on a large language model according to claim 1, characterized in that: The following steps are also included: Add or modify risk warning words corresponding to the risk categories of contract terms according to actual needs.

5. The contract risk identification method based on a large language model according to claim 1, characterized in that: The temporary vector set of the contract terms The vectors in are merged according to similarity to obtain the contract clause vector set and its corresponding set of contract terms , including the following steps: S101, Initialize loop variables j The value of is 1; S102: temporary vector set Vector in vs j Set to the first vector; S103: Determine temporary vector set Is there an unprocessed vector in vs j+1 , if it exists, execute step S104, otherwise execute step S110; S104, vector vs j+1 Set as the second vector, calculate the similarity between the first vector and the second vector, the calculation formula is: Sim( )= ,in, j The value range is 1 to t , the value range of a is 1 to b , b Indicates the number of elements in the first vector , The first vector a elements, The second vector a elements; S105, determining whether the similarity between the first vector and the second vector is greater than a preset similarity threshold, if so, executing step S106, otherwise executing step S108; S106, merging the contract terms corresponding to the first vector and the contract terms corresponding to the second vector, and inputting the result into the word vector model CXWE for vectorization to obtain a third vector; S107, setting the third vector as a new first vector; jumping to step S109 to continue execution; S108. Add the contract clause corresponding to the first vector to the contract clause set S , add the first vector to the contract terms vector set VS ; Set the second vector to be the new first vector; S109, loop variable j The value of is increased by 1; jump to step S103 to continue execution; S110. Add the contract clause corresponding to the first vector to the contract clause set S , add the first vector to the contract terms vector set VS .

6. The contract risk identification method based on a large language model as claimed in claim 5, characterized in that: The preset similarity threshold is 0.

6.

7. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the contract risk identification method based on a large language model as described in any one of claims 1 to 6 when executing the computer program.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the contract risk identification method based on a large language model as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Contract term similarity calculation method and device, equipment and readable storage medium

    CN110083809A

  • Intelligent self-service contract review method based on large language model

    CN118379165A

  • Automatic risk assessment

    US20210406788A1

Cited By

  • Engineering contract flow chart extraction method and system, computer equipment and storage medium

    CN118939741A

  • Contract review report generation method based on large model integrated optimization

    CN118940732A

  • Large language model security risk assessment method, system and equipment oriented to long text scene

    CN119647621A

  • Security risk assessment methods, systems, and devices for large language models in long text scenarios

    CN119647621B

  • Contract risk clause identification method based on natural language processing

    CN120372460A