Contract review method and device, storage medium and program product
By constructing a user-preset knowledge base and splitting text segments, combined with large language models and vectorization models, the problem of inaccurate contract review caused by large amounts of data in existing technologies has been solved, achieving efficient and accurate contract review.
Patent Information
- Application Number
- CN202510918366.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-11-25
AI Technical Summary
In existing technologies, contract review methods based on RAG technology suffer from large amounts of knowledge base data and inaccurate retrieval due to the numerous clauses in the contracts to be reviewed, which affects the accuracy of the contract review results.
By constructing a knowledge base based on user-preset review requirements, the contract to be reviewed is split into multiple text segments, and large language models and vectorization models are used for retrieval and review, thereby reducing the amount of knowledge base data and improving retrieval accuracy.
It enables a comprehensive review of contract terms, ensuring that a retrieval process is performed on each text segment, reducing omissions and improving the accuracy and efficiency of contract review results.
Smart Images

Figure CN121009979A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, such as a method and apparatus for reviewing contracts, a storage medium, and a program product. Background Technology
[0002] During the contract drafting process, it is necessary to review all the terms of the contract to determine whether they are compliant and meet the requirements.
[0003] In the process of contract review, manual review is prone to errors and is inefficient. Therefore, relevant technologies offer an intelligent contract review solution based on RAG (Retrieval-augmented Generation) technology. Specifically, this technology pre-defines review questions based on review requirements and uses the contract to be reviewed as a knowledge base. Based on the review questions, it retrieves the target contract content corresponding to the review questions from the knowledge base. The review questions and target contract content are then input into an LLM (Large Language Model), which determines whether the target contract content meets the requirements of the review questions and outputs the review results.
[0004] However, in related technologies, when a contract to be reviewed has numerous clauses, using the contract as a knowledge base increases the amount of data in the knowledge base. With a large amount of data in the knowledge base, it becomes difficult to retrieve the target contract content corresponding to the review question, reducing the accuracy of the retrieval and thus affecting the review results. Summary of the Invention
[0005] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.
[0006] This application provides a method, apparatus, storage medium, and program product for reviewing contracts. When reviewing contracts based on RAG technology, by reducing the amount of data in the knowledge base, the accuracy of retrieval based on the knowledge base can be improved, thereby reducing the impact on the contract review results and ensuring the accuracy of the contract review results.
[0007] In a first aspect, embodiments of this application provide a method for reviewing contracts, applied to an electronic device. The electronic device is equipped with a large language model and a knowledge base constructed according to user-preset review requirements. The knowledge base includes multiple review conditions. The method includes:
[0008] Obtain the text content of the contract to be reviewed;
[0009] The text content is split into multiple text segments;
[0010] The review criteria corresponding to each text segment are retrieved from the knowledge base, resulting in multiple search results. The search results include the text segments and the corresponding review criteria.
[0011] For each search result among multiple search results, the search result and the first preset prompt word of the search result are input into the large language model, so that the large language model reviews the search results under the guidance of the first preset prompt word and outputs the first review result; the first review result is used to characterize whether the text segment in the search result meets the review conditions corresponding to the text segment.
[0012] Optionally, after outputting the first review result, the method further includes: for multiple first review results corresponding to multiple search results, merging the first review results corresponding to the same review conditions among the multiple first review results to obtain multiple review result sets; for each review result set in the multiple review result sets, inputting the review result set, the review conditions corresponding to the review result set, and the second preset prompt word of the review result set into the large language model, so that the large language model reviews the review result set under the guidance of the second preset prompt word and outputs the second review result; the second review result is used to characterize whether the review result set meets the review conditions corresponding to the review result set.
[0013] Optionally, the electronic device also deploys a vectorization model. Accordingly, retrieving the review conditions corresponding to each text segment from multiple text segments includes: using the vectorization model to vectorize the multiple review conditions included in the knowledge base, obtaining multiple review condition vectors; using the vectorization model to vectorize the target text segment from the multiple text segments, obtaining a target text segment vector; the target text segment is any one of the multiple text segments; from the multiple review condition vectors, selecting the target review condition vector with the highest similarity to the target text segment vector; and determining the review condition corresponding to the target review condition vector as the review condition corresponding to the target text segment.
[0014] Optionally, after obtaining multiple search results, the method further includes: filtering out search results with empty review criteria from the multiple search results; and providing feedback to the user on the search results with empty review criteria so that the user can update the knowledge base based on the search results with empty review criteria.
[0015] Optionally, after outputting the first review result, the method further includes: converting the format of the first review result to obtain the first review result in a first format.
[0016] Optionally, after outputting the second review result, the method further includes: converting the format of the second review result to obtain a second review result in a second format.
[0017] Optionally, after obtaining the second review result in the second format, the method further includes: parsing the second review result in the second format to determine the content represented by the second review result in the second format; and configuring the display attributes of the second review result in the second format when the second review result in the second format represents that the review result set does not meet the review conditions corresponding to the review result set.
[0018] Secondly, embodiments of this application provide an apparatus for reviewing contracts. The apparatus is equipped with a large language model and a knowledge base constructed according to user-preset review requirements. The knowledge base includes multiple review conditions. The apparatus includes a processor and a memory storing program instructions. The processor is configured to execute the contract review method described in the first aspect when running the program instructions.
[0019] Thirdly, embodiments of this application provide a storage medium storing program instructions, wherein the program instructions, when executed, perform the method for reviewing contracts as described in the first aspect.
[0020] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method for reviewing contracts in the first aspect.
[0021] The method, apparatus, storage medium, and program product for reviewing contracts provided in this application can achieve the following technical effects:
[0022] In this embodiment, the electronic device is equipped with a large language model and a knowledge base, enabling it to implement a contract review scheme based on RAG technology. Specifically, the knowledge base configured on the electronic device is constructed according to user-preset review requirements. The constructed knowledge base includes multiple review conditions, which reflect the user-preset review requirements. When reviewing a contract, the electronic device acquires the text content of the contract to be reviewed and splits the text content into multiple text segments. The electronic device retrieves the review conditions corresponding to each text segment from the knowledge base to clarify the correspondence between the text segments and the review conditions, and combines the corresponding text segments and review conditions as a single search result. Multiple text segments yield multiple search results. For each search result, the electronic device inputs the search result and a first preset prompt word into the large language model. The first preset prompt word guides the large language model to reason about the input search result, enabling the large language model to review the search result and determine whether the contract terms contained in the text segment of the search result meet the review conditions corresponding to that text segment, and outputs a first review result. Since the review criteria reflect the user's preset review requirements, by determining whether the contract terms contained in a text segment meet the review criteria corresponding to that text, it can be determined whether the contract terms contained in the text meet the user's review requirements. In this way, by reviewing the contract terms contained in each of multiple text segments, the review of all contract terms in the entire contract to be reviewed is achieved, thus realizing a solution for electronic devices to review contracts based on RAG technology.
[0023] In this embodiment, when an electronic device reviews a contract using RAG technology, the knowledge base is constructed based on user-preset review requirements. Since the data volume corresponding to these user-preset requirements is significantly smaller than the data volume of the contract under review with numerous clauses, using review requirements as the knowledge base reduces the data volume compared to using the contract under review with numerous clauses. This improves the accuracy of searches based on a smaller knowledge base, thereby reducing the impact of search results on the contract review results and ensuring the accuracy of the contract review outcome.
[0024] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description
[0025] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are considered similar elements. The drawings do not constitute a limitation of scale, and wherein:
[0026] Figure 1 This is a flowchart illustrating a method for reviewing contracts provided in an embodiment of this application;
[0027] Figure 2 This is a flowchart of another method for reviewing contracts provided in an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of a contract review device provided in an embodiment of this application. Detailed Implementation
[0029] The terms "first," "second," etc., used in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.
[0030] Unless otherwise stated, the term "multiple" means two or more.
[0031] In this embodiment, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.
[0032] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.
[0033] The term "correspondence" can refer to an association or binding relationship. The correspondence between A and B means that there is an association or binding relationship between A and B.
[0034] Traditionally, contract review primarily relies on manual methods. However, manual review is prone to errors and is inefficient. To address this, a solution for intelligent contract review based on Relational Aggregator (RAG) technology is proposed. Specifically, the contract to be reviewed is broken down into parts, forming a knowledge base. Review questions are pre-defined based on review requirements. During review, the target contract content corresponding to the review questions is retrieved from the knowledge base. The review questions and target contract content are then input into an LLM (Limited Ledger Model), which determines whether the target contract content meets the requirements of the review questions and outputs the review results, thus achieving intelligent review of the contract.
[0035] However, in related technologies, contracts under review may contain numerous clauses, especially international business or technology contracts, which can be quite lengthy. Using lengthy contracts as a knowledge base increases the data volume. With a large knowledge base, it becomes difficult to retrieve the target contract content corresponding to the review question, reducing retrieval accuracy and thus affecting the review results.
[0036] Furthermore, when conducting searches using related technologies, because the review questions are pre-set based on review requirements and the knowledge base is generated from the actual contract to be reviewed, the pre-set review questions may be incomplete, meaning they may not cover all clauses of the contract under review. For example, the pre-set review questions may include question a and question b, while the contract to be reviewed in the knowledge base has three clauses: clause A, clause B, and clause C. Thus, when searching the knowledge base based on question a and question b respectively, only clause A corresponding to question a and clause B corresponding to question b will be retrieved. Because the pre-set review questions are incomplete, clause C in the knowledge base cannot be retrieved, making it impossible to review clause C and resulting in omissions in contract clause review, thus affecting the accuracy of contract review.
[0037] In view of this, this application provides a scheme for reviewing contracts. When reviewing contracts based on RAG technology, the scheme constructs a knowledge base according to preset review requirements and uses the text segments derived from the contract to be reviewed as the search questions to perform the search. Compared to using the contract to be reviewed, which has numerous clauses, as the knowledge base, the amount of data in the knowledge base is reduced. Therefore, when searching based on a smaller knowledge base, the accuracy of the search can be improved, thereby reducing the impact on the contract review results and ensuring the accuracy of the contract review results. Furthermore, in the scheme provided by this application, since the search process is performed using the text segments derived from the contract to be reviewed as the search questions, it can be ensured that each text segment in the contract to be reviewed is searched, thereby reducing the problem of missed contract clauses and ensuring the accuracy of the contract review.
[0038] To provide a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this application. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.
[0039] Before describing the embodiments of this application, the nouns and terms involved in the embodiments of this application are explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0040] Large Language Model (LLM) is a deep learning model trained on large amounts of text data that can generate natural language text or understand language text.
[0041] RAG (Retrieval Augmented Generation) technology combines large language models and information retrieval. Specifically, based on a given information requirement, it retrieves relevant information from an external knowledge base and uses prompts to guide the large language model in analyzing or reasoning about the information requirement and related information, thereby obtaining the desired output.
[0042] Prompt words for large language models: These are text instructions that users input into the large language model. These text instructions are used to guide the large language model to generate corresponding answers or perform corresponding reasoning tasks.
[0043] Vectorization model: A model that converts various forms of data (such as text, images, etc.) into vector form.
[0044] Cosine similarity measures the degree of similarity between two vectors by calculating the cosine of the angle between them. The value of cosine similarity ranges from -1 to 1. When the two vectors are in the same direction, the cosine similarity is 1; when the angle between the two vectors is 90°, the cosine similarity is 0; and when the two vectors are in completely opposite directions, the cosine similarity is -1.
[0045] The embodiments of this application will now be described.
[0046] This application provides an electronic device to which a method for reviewing contracts is applicable. The electronic device is equipped with a large language model and a knowledge base, thereby ensuring that the electronic device can perform contract review based on RAG technology. The electronic device can be a mobile terminal, a personal computer, or a server; the server can be an edge server or a cloud server.
[0047] The database configured in the electronic device is constructed based on user-preset review requirements. The constructed knowledge base includes multiple review conditions, each reflecting one of the user's preset review requirements. For example, assuming the user's review requirements for a contract include a contract amount not exceeding 300,000 and a contract term within 30 days, the two constructed review conditions would be "contract amount less than or equal to 300,000" and "contract term less than or equal to 30 days." Furthermore, in this embodiment, the review conditions in the knowledge base can be semantically expanded to make them more comprehensive. For example, semantically expanding the review condition "contract term less than or equal to 30 days" in the knowledge base can yield semantically equivalent review conditions such as "contract term upper limit is 30 days" or "contract term not exceeding 30 days."
[0048] The method for reviewing contracts provided in the embodiments of this application will now be described.
[0049] Combination Figure 1 As shown in the figure, this application provides a method for reviewing a contract, which is applied to the aforementioned electronic device. The method specifically includes the following steps:
[0050] S11, Obtain the text content of the contract to be reviewed.
[0051] In step S11, when acquiring the text content of the contract to be reviewed, the electronic device can execute a text acquisition strategy based on the type of contract. Different strategies are employed for different types of contracts. Specifically, for paper-based contracts, the electronic device can use OCR (Optical Character Recognition) technology to recognize characters on the paper, thereby acquiring the text content. For electronic contracts, the electronic device can directly acquire the text content based on the contract's file format. For example, for plain text contracts, the electronic device can use a text editor to read characters and acquire the text content. For PDF contracts, the electronic device can use a PDF file parsing tool to directly parse the contract and acquire its text content.
[0052] S12, the text content of the contract to be reviewed is split into multiple text segments.
[0053] In step S12, since the length of data that can be input at one time into a large language model is limited, the electronic device needs to split the text content of the contract to be reviewed into multiple text segments. The electronic device can split the text content of the contract to be reviewed according to its structure. Since the contract text is usually divided into clauses according to titles and chapters, and the clauses are numbered, the electronic device can split the contract to be reviewed into multiple text segments according to the chapter to which the clause belongs, the corresponding title of the clause, and the specific number of the clause. After splitting into multiple text segments, the electronic device can mark the contract clauses contained in the text segments, marking the title and chapter to which the clauses belong, thus enriching the semantics of the text segments. This helps improve the accuracy of retrieval in the knowledge base based on the text segments.
[0054] S13, retrieve the review conditions corresponding to each text segment from the knowledge base, and obtain multiple search results. The search results include the text segments and their corresponding review conditions.
[0055] In step S13, for any one of the multiple text segments, the similarity between the text segment and each review condition in the knowledge base can be detected, and the review condition with the highest similarity in the knowledge base is selected as the review condition corresponding to the text segment. The text segment and its corresponding review condition constitute the search result. After multiple text segments are searched in the above manner, multiple search results are obtained, and the number of text segments is consistent with the number of search results.
[0056] It should be noted that when retrieving review conditions for each text segment from multiple text segments in the knowledge base, for any one of the text segments, the knowledge base may not contain the corresponding review conditions. In this case, the review conditions for that text segment can be set to empty in the search results to indicate that the text segment does not have the corresponding review conditions.
[0057] S14, for each search result among multiple search results, the search result and the first preset prompt word of the search result are input into the large language model, so that the large language model, guided by the first preset prompt word, reviews the search results and outputs a first review result. The first review result is used to characterize whether the text segment in the search result meets the review conditions corresponding to the text segment.
[0058] In step S14, for any one of the multiple search results, the large language model can be used to determine whether the text segment contained in the search result meets the review criteria, that is, whether the contract terms contained in the search result meet the review requirements reflected in the review criteria. When inputting the search result into the large language model, the first preset prompt word needs to be input at the same time. The role of the first preset prompt word is to guide the large language model to perform the above judgment process to review the search result and output the first review result. The first review result indicates that the text segment in the search result meets the review criteria, or the text segment in the search result does not meet the review criteria.
[0059] Using the contract review method provided in this application, the electronic device can obtain the text content of the contract to be reviewed and split the text content into multiple text segments. The electronic device retrieves the review conditions corresponding to each text segment from the knowledge base to clarify the correspondence between the text segments and the review conditions, and combines the corresponding text and review conditions as a single search result. Multiple text segments yield multiple search results. For each search result, the electronic device inputs the search result and a first preset prompt word into a large language model. The first preset prompt word guides the large language model to reason about the input search result, enabling the model to review the search result and determine whether the contract terms contained in the text segment meet the review conditions corresponding to that text segment, and outputs a first review result. Since the review conditions reflect the user's preset review requirements, by determining whether the contract terms contained in the text segment meet the user's review requirements, it can be determined whether the contract terms contained in the text meet the user's review requirements. In this way, by reviewing the contract terms contained in each of the multiple text segments, the review of all contract terms in the entire contract to be reviewed is realized, thus realizing the solution of electronic devices reviewing contracts based on RAG technology.
[0060] In this embodiment, when the electronic device reviews a contract using RAG technology, the knowledge base is constructed based on user-preset review requirements. Since the data volume corresponding to these user-preset requirements is significantly smaller than the data volume of the contract under review with numerous clauses, using the review requirements as the knowledge base reduces the data volume compared to using the contract under review with numerous clauses. This improves the accuracy of retrieval when using a smaller knowledge base, thus reducing the impact of retrieval results on the contract review outcome and ensuring the accuracy of the review. Furthermore, in this embodiment, since the retrieval process is performed using the text segments derived from the contract under review as the retrieval question, it ensures that each text segment in the contract under review is searched, reducing the possibility of missed contract clauses and guaranteeing the accuracy of the contract review.
[0061] The following describes the optional implementation methods between steps S11 and S14.
[0062] Optionally, in step S13 above, the electronic device retrieves the review conditions corresponding to each text segment from the knowledge base, including: using a vectorization model to vectorize the multiple review conditions included in the knowledge base to obtain multiple review condition vectors; using a vectorization model to vectorize the target text segment from the multiple text segments to obtain a target text segment vector, where the target text segment is any one of the multiple text segments; selecting the target review condition vector with the highest similarity to the target text segment vector from the multiple review condition vectors; and determining the review condition corresponding to the target review condition vector as the review condition corresponding to the target text segment.
[0063] In this implementation, the electronic device is also equipped with a vectorization model. Multiple review conditions from the knowledge base are input into the vectorization model, which then vectorizes each review condition to obtain multiple review condition vectors. For a target text segment (i.e., any one of the multiple text segments), the target text segment can also be input into the vectorization model, which then vectorizes it to obtain a target text segment vector. By calculating the similarity between the target text segment vector and each review condition vector, the degree of similarity between the target text segment and each review condition can be determined, and the review condition most similar to the target text segment can be selected as the review condition corresponding to the target text segment.
[0064] For example, when calculating the similarity between the target text segment vector and each review condition vector, a cosine similarity algorithm can be used to calculate the angle between the target text segment vector and each review condition vector, thereby determining the similarity value between the target text segment vector and each review condition vector. The smaller the angle between the target text segment vector and the review condition vector, the greater the similarity value between them, indicating a higher degree of similarity.
[0065] This implementation method, when retrieving review conditions corresponding to a target text segment, allows for semantic similarity matching between the target text segment and various review conditions in the knowledge base by vectorizing both the text segment and the review conditions. This way, review conditions in the knowledge base that are semantically consistent but not explicitly stated in relation to the target text segment can also be retrieved and matched as review conditions for the target text segment. This avoids missed detections due to inconsistencies in the way the text segment and review conditions are expressed, thus improving the accuracy of the retrieval.
[0066] Optionally, in step S13 above, after obtaining multiple search results, the electronic device can also filter out the search results with empty review conditions from the multiple search results and feed back the search results with empty review conditions to the user, so as to update the knowledge base based on the search results with empty review conditions.
[0067] In this implementation, the absence of review conditions in the search results indicates that the search results lack review conditions. This is because when searching the knowledge base based on text segments in the search results, there are no review conditions corresponding to the text segments in the knowledge base; that is, review conditions are missing in the knowledge base. When review conditions are missing in the knowledge base, review conditions corresponding to the semantic information represented by the text segments in the search results with empty review conditions can be added to the knowledge base, thereby updating the knowledge base.
[0068] By adopting this implementation method, the electronic device can provide users with search results that are empty of review conditions. This allows users to improve the knowledge base in a timely manner based on the search results with empty review conditions, making the review conditions in the knowledge base more comprehensive, thereby improving the comprehensiveness of the search when searching based on the knowledge base.
[0069] Optionally, after step S14 above, that is, after reviewing multiple search results using a large language model to obtain multiple first review results of multiple search results, the electronic device can perform format conversion on the first review results to obtain the first review result in a first format.
[0070] In this implementation, the first review result output by the large language model is typically unstructured data that is not easily viewed by the user. For example, the first review result may be plain text data, requiring the user to filter out valid information from the plain text data. Alternatively, the first review result may be text data containing tags, i.e., HTML tags (such as paragraph tags). 、 <h1>(Newline character \n). Therefore, electronic devices need to convert the format of the first review result into structured data that is easy for users to view. For example, for the first review result in plain text data format, the valid information can be extracted and converted into a list format for display.
[0071] By adopting this implementation method, the first review result can be converted into structured data that is easy for users to view by converting the format, thereby improving the readability of the first review result.
[0072] Combination Figure 2 As shown in the embodiment of this application, another method for reviewing contracts is provided. This method is applied to the aforementioned electronic device and specifically includes the following steps:
[0073] S21, Obtain the text content of the contract to be reviewed.
[0074] S22, the text content of the contract to be reviewed is split into multiple text segments.
[0075] S23. Retrieve the review conditions corresponding to each text segment from the knowledge base, and obtain multiple search results. The search results include the text segments and their corresponding review conditions.
[0076] S24, for each search result among multiple search results, the search result and the first preset prompt word of the search result are input into the large language model, so that the large language model, guided by the first preset prompt word, reviews the search results and outputs a first review result. The first review result is used to characterize whether the text segment in the search result meets the review conditions corresponding to the text segment.
[0077] S25. For multiple first review results corresponding to multiple search results, merge the first review results that correspond to the same review conditions among the multiple first review results to obtain multiple review result sets.
[0078] S26, for each review result set in multiple review result sets, the review result set, the corresponding review conditions, and the second preset prompt word for the review result set are input into the large language model, so that the large language model reviews the review result set under the guidance of the second preset prompt word and outputs a second review result. The second review result is used to characterize whether the review result set meets the review conditions corresponding to the review result set.
[0079] In this application embodiment, the specific implementation methods of steps S21 to S24 have been described in the foregoing embodiments. The specific implementation methods and technical effects can be referred to in the foregoing embodiments, and will not be repeated here.
[0080] In steps S25 and S26 above, for multiple first review results corresponding to multiple search results, the first review results corresponding to the same review conditions can be merged to obtain multiple review result sets. Each review result set contains the same review conditions for all review results. For example, suppose the search result corresponding to first review result M contains the text segment "contract amount greater than 180,000," and the corresponding review condition S is "contract amount less than or equal to 300,000 and greater than 150,000." The search result corresponding to first review result N contains the text segment "contract amount less than 250,000," which also corresponds to review condition S. Then, the electronic device can merge first review result M and first review result S into one review result set.
[0081] For any one of the multiple review result sets, the electronic device can use a second preset prompt word to guide the large language model to review the review result set again, determine whether the review result set meets the corresponding review conditions, and output a second review result. In this implementation, the reason for summarizing the first review result and then performing a second review is to implement a context-based contract review scheme, thereby further improving the accuracy of contract review. A specific example is illustrated below:
[0082] Continuing with the previous example, we can see that review condition S reflects the review requirement of "contract amount less than or equal to 300,000 and greater than 150,000". For the search result corresponding to the first review result M, the text segment contained in the search result is "contract amount greater than 180,000", which clearly does not meet the requirement of "contract amount less than or equal to 300,000" in review condition S. Therefore, the first review result M should be "review requirement not met". For the search result corresponding to the first review result N, the text segment contained in the search result is "contract amount less than 250,000", which clearly does not meet the requirement of "contract amount greater than 150,000" in review condition S. Therefore, the first review result N is also "review requirement not met". However, by merging the first review result M and the second review result N, we can obtain the text segment "contract amount greater than 180,000 and less than 250,000". This text segment clearly meets the requirement of "contract amount less than or equal to 300,000 and greater than 150,000" in review condition S. Therefore, the second review result should be "review requirement met".
[0083] As can be seen, since both the first review result M and the second review result N were generated without considering the contract context, both results would be "not meeting the review requirements" based solely on the first review result M and the second review result N. By merging the first review result M and the second review result N into a review result set using this implementation method, and then reviewing the result set again, the contextual content of the contract corresponding to the same review condition S is considered, and the review result "not meeting the review requirements" is corrected to "meeting the review requirements." Thus, this implementation method allows for a more comprehensive review of the contract based on context, thereby improving the accuracy of the review results.
[0084] Optionally, after step S26 above, that is, after reviewing multiple review result sets using a large language model to obtain multiple second review results for multiple review result sets, the electronic device can perform format conversion on the second review results to obtain a second review result in a second format.
[0085] In this implementation, the second review result output by the large language model is typically unstructured data that is inconvenient for users to view. For example, the second review result may be plain text data, requiring users to filter out valid information from it. Alternatively, the second review result may be text data containing tags, i.e., HTML tags (such as paragraph tags). 、 < / h1> <h1>(Newline character \n). Therefore, electronic devices need to convert the format of the second review results into structured data that is easy for users to view. For example, for the second review results in plain text format, the valid information can be extracted and converted into a list format for display.
[0086] By adopting this implementation method, the second review result can be converted into structured data that is easy for users to view by format conversion, thereby improving the readability of the second review result.
[0087] Furthermore, after receiving the second review result in the second format, the electronic device can parse the second review result in the second format to determine the content represented by the second review result in the second format. When the second review result in the second format does not meet the review conditions corresponding to the review result set, the display attributes of the second review result in the second format are configured.
[0088] In this implementation, by parsing the second review results in the second format, risk items among multiple second review results can be identified. That is, the content represented by the second review results in the second format can be determined. If the represented content indicates that the review result set does not meet the review conditions, it means that the second review result is a risk item, and the display attributes of the second review result can be configured. For example, the second review result can be configured to be displayed in a specific color (such as red), or the content of the second review result can be bolded, or the second review result can be displayed as a pop-up on the electronic device screen. In this way, by configuring the display attributes of risky second review results, users can promptly observe risk items when viewing risky second review results, thereby further improving the readability of the review results and enhancing the user experience of viewing the review results.
[0089] It is worth mentioning that, in this embodiment, when viewing the first and second review results, users can also review the review results to ensure their accuracy. Compared to traditional manual contract review methods, users only need to review the final review result, reducing the amount of work required from the user's review. Therefore, the efficiency of contract review is improved.
[0090] Combination Figure 3 As shown in the illustration, this application provides a contract review apparatus 300. The apparatus 300 is equipped with a large language model and a knowledge base constructed according to user-preset review requirements. The knowledge base includes multiple review conditions. The contract review apparatus 300 may include a processor 301, a memory 302, a communication interface 303, and a bus 304. The processor 301, memory 302, and communication interface 303 can communicate with each other via the bus 304. The communication interface 303 can be used for information transmission. The processor 301 can call logical instructions in the memory 302 to execute the contract review method described in the above embodiment.
[0091] Furthermore, the logic instructions in the aforementioned memory 302 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0092] The memory 302, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this application. The processor 301 executes functional applications and data processing by running the program instructions / modules stored in the memory 302, that is, it implements the contract review method in the above embodiments.
[0093] The memory 302 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 101 may include high-speed random access memory and may also include non-volatile memory.
[0094] This application provides a storage medium storing computer-executable instructions configured to perform the contract review method described in the above embodiments.
[0095] The aforementioned storage medium can be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0096] The technical solutions of this application embodiment can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this application embodiment. The aforementioned storage medium can be a non-transitory storage medium, including: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, and other media capable of storing program code; it can also be a transient storage medium.
[0097] This application provides a computer program product, including a computer program that, when executed by a processor, implements the contract review method described in the above embodiments.
[0098] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms "a," "an," and "the" are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more of the associated listed elements. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a…" does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.
[0099] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0100] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement this embodiment according to actual needs. In addition, the functional units in the embodiments of this application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0101] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description; sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.< / h1>
Claims
1. A method for reviewing contracts, characterized in that, The method is applied to an electronic device, which is equipped with a large language model and a knowledge base built according to user-preset review requirements, the knowledge base including multiple review conditions; the method includes: Obtain the text content of the contract to be reviewed; The text content is split into multiple text segments; From the knowledge base, the review conditions corresponding to each text segment in the plurality of text segments are retrieved to obtain multiple search results; the search results include text segments and the review conditions corresponding to the text segments; For each of the multiple search results, the search result and the first preset prompt word of the search result are input into the large language model, so that the large language model reviews the search result under the guidance of the first preset prompt word and outputs a first review result; the first review result is used to characterize whether the text segment in the search result meets the review conditions corresponding to the text segment.
2. The method according to claim 1, characterized in that, After outputting the first review result, the following is also included: For multiple first review results corresponding to the multiple search results, the first review results corresponding to the same review conditions among the multiple first review results are merged to obtain multiple review result sets; For each review result set in the plurality of review result sets, the review result set, the review conditions corresponding to the review result set, and the second preset prompt word of the review result set are input into the large language model, so that the large language model reviews the review result set under the guidance of the second preset prompt word and outputs a second review result; the second review result is used to characterize whether the review result set meets the review conditions corresponding to the review result set.
3. The method according to claim 1, characterized in that, The electronic device is also equipped with a vectorized model; the retrieval of the review conditions corresponding to each text segment among the plurality of text segments includes: Using the vectorization model, the multiple review conditions included in the knowledge base are vectorized to obtain multiple review condition vectors; Using the vectorization model, the target text segment among the plurality of text segments is vectorized to obtain the target text segment vector; the target text segment is any one of the plurality of text segments. From the plurality of review condition vectors, select the target review condition vector that has the highest similarity to the target text segment vector; The review conditions corresponding to the target review condition vector are determined as the review conditions corresponding to the target text segment.
4. The method according to claim 1, characterized in that, After obtaining multiple search results, the process also includes: From the multiple search results, filter out the search results where the review criteria are empty; The system provides feedback to the user on search results where the review criteria are empty, so that the user can update the knowledge base based on the search results where the review criteria are empty.
5. The method according to claim 1, characterized in that, After outputting the first review result, the following is also included: The first review result is converted to a new format to obtain the first review result in a first format.
6. The method according to claim 2, characterized in that, After outputting the second review result, the following is also included: The second review result is converted to a second review result in a second format.
7. The method according to claim 6, characterized in that, After obtaining the second review result in the second format, the process further includes: Parse the second review result in the second format to determine the content represented by the second review result in the second format; When the second review result in the second format indicates that the review result set does not meet the review conditions corresponding to the review result set, configure the display attributes of the second review result in the second format.
8. An apparatus for reviewing contracts, characterized in that, The device is equipped with a large language model and a knowledge base constructed according to user-preset review requirements, the knowledge base including multiple review conditions; the device includes a processor and a memory storing program instructions, the processor being configured to execute the method for reviewing contracts as described in any one of claims 1 to 7 when running the program instructions.
9. A storage medium storing program instructions, characterized in that, When the program instructions are executed, they perform the method for reviewing contracts as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, implements the method for reviewing contracts as described in any one of claims 1 to 7.