Text processing method, task platform
By integrating examples of processing rules and clause types into a large language model, the problem of insufficient understanding of professional knowledge in large models is solved, thereby achieving accuracy in text processing results and professionalism in modification suggestions, and improving the accuracy and guidance of text processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2024-12-10
- Publication Date
- 2026-06-12
AI Technical Summary
In existing technologies, large language models have the problem of insufficient understanding of professional knowledge in text processing tasks, resulting in deviations between the processing results and the requirements. Furthermore, the modification suggestions lack professionalism and cannot meet the needs of specific review scenarios.
By combining examples of processing rules and processing clause types, text processing prompts are generated. Text processing is performed using a large language model, and rule-level and clause-level examples are integrated to improve the model's professionalism and accuracy.
It achieves accuracy in text processing results and professionalism in modification suggestions, thereby improving the guiding role of the large model in specific review scenarios.
Smart Images

Figure CN122196178A_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of computer technology, and in particular to a text processing method and a task platform. Background Technology
[0002] Text processing is a crucial task in natural language processing. Text processing tasks include text review and editing. Text review ensures the safety of the text's users' interests and mitigates risks. For example, contract review is a key step in ensuring the safety of both parties' interests and preventing risks, aiming to verify the legality, fairness, and clarity of the contract's terms. This establishes a solid foundation for the partnership. However, in traditional work models, contract review is highly specialized and difficult to master quickly. Furthermore, the cumbersome review process and clause-by-clause evaluation consume significant time and effort.
[0003] Current text processing tasks often incorporate large-scale language modeling techniques. This involves specifying a detailed text processing checklist and using a large language model to execute the task based on that checklist. For example, in contract review, a detailed checklist is used to review the contract. However, because the checklist contains a lot of specialized knowledge, the large model's understanding of it may be insufficient, leading to discrepancies between the model's processing results and the requirements of the checklist, resulting in text processing errors. Furthermore, in text review tasks (such as contract review), specific modification suggestions are often provided for certain content. However, the large model lacks the expertise for this specific review scenario, resulting in overly broad or poorly worded suggestions. Consequently, the generated annotations lack effective guidance in text review tasks. Summary of the Invention
[0004] In view of this, embodiments of this specification provide a text processing method. One or more embodiments of this specification also relate to a text processing apparatus, a task platform, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.
[0005] According to a first aspect of the embodiments of this specification, a text processing method is provided, comprising: Receive the text to be processed, and at least one processing rule for the text to be processed; At least one processing clause type is determined based on the text type of the text to be processed and the target processing rule, wherein the target processing rule is any one of at least one processing rule; A text processing prompt text is generated based on the target processing rule and at least one processing clause type, wherein the text processing prompt text includes a text processing reasoning path and at least one text processing example; The text processing prompt text is input into the text processing model to obtain the text processing result output by the text processing model for the target processing rule. The text processing model processes the text to be processed and each text processing example based on the text processing inference path to generate the text processing result.
[0006] According to a second aspect of the embodiments of this specification, a text processing method is provided, comprising: Receive the contract text to be processed, and at least one audit rule for the contract text to be processed; At least one type of audit clause is determined based on the contract type and target audit rule of the contract text to be processed, wherein the target audit rule is any one of at least one audit rule; A contract review prompt text is generated based on the target review rules and at least one review clause type, wherein the contract review prompt text includes a contract review reasoning path and at least one text review example; The contract review prompt text is input into the contract review model to obtain the contract review result output by the contract review model for the target review rule. The contract review model processes the contract text to be processed and each text review example based on the contract review reasoning path to generate the contract review result.
[0007] According to a third aspect of the embodiments of this specification, a text processing method is provided, applied to a cloud-side device, comprising: The receiving end device sends the contract text to be processed, and at least one auditing rule for the contract text to be processed; At least one type of audit clause is determined based on the contract type and target audit rule of the contract text to be processed, wherein the target audit rule is any one of at least one audit rule; A contract review prompt text is generated based on the target review rules and at least one review clause type, wherein the contract review prompt text includes a contract review reasoning path and at least one text review example; The contract review prompt text is input into the contract review model to obtain the contract review result output by the contract review model for the target review rule. The contract review model processes the contract text to be processed and each text review example based on the contract review reasoning path to generate the contract review result. The contract review results corresponding to each review rule are sent to the terminal device.
[0008] According to a fourth aspect of the embodiments of this specification, a task platform is provided, including a request interface and a response unit; The request interface is used to receive the contract text to be processed sent by the end device, and at least one audit rule for the contract text to be processed. The response unit is configured to: determine at least one audit clause type based on the contract type of the contract text to be processed and the target audit rule, wherein the target audit rule is any one of at least one audit rule; determine at least one text audit example in a preset audit example library based on the target audit rule and each audit clause type; generate a contract audit prompt text based on the target audit rule and at least one audit clause type, wherein the contract audit prompt text includes a contract audit reasoning path and at least one text audit example; input the contract audit prompt text into a contract audit model to obtain a contract audit result output by the contract audit model for the target audit rule, wherein the contract audit model processes the contract text to be processed and each text audit example based on the contract audit reasoning path to generate the contract audit result.
[0009] According to a fifth aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the above method.
[0010] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0011] According to a seventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0012] The method provided in this specification integrates processing examples from two dimensions: processing rules and processing clause types. This ensures that the reference information input into the text processing model possesses both completeness and professionalism. Examples corresponding to processing rules cover the rule content comprehensively but lack specialized knowledge, while examples corresponding to clause types have strong professional knowledge but cannot fully cover all the key points of the rules. Rule-level examples can avoid processing errors caused by incomplete or biased understanding of the rules by the model, while clause-level examples, with higher professionalism, can guide the model to provide more specific and accurate modification suggestions. The two types of examples complement each other, forming high-quality examples, and assist the text processing model in providing more accurate text processing results under the guidance of the text processing inference path. Attached Figure Description
[0013] Figure 1 This is a flowchart illustrating a text processing method provided in one embodiment of this specification; Figure 2 This is a flowchart illustrating the processing procedure of a text processing method applied in a contract review scenario, as provided in one embodiment of this specification. Figure 3 This is a flowchart illustrating a text processing method applied to a cloud-side device, provided in one embodiment of this specification. Figure 4 This is a schematic diagram of a task platform provided in one embodiment of this specification; Figure 5 This is a schematic diagram of the structure of a text processing device provided in one embodiment of this specification; Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0014] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0015] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0016] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0017] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0018] In one or more embodiments of this specification, a large model refers to a deep learning model with a large number of model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of model parameters. A large model can also be called a foundation model. It is pre-trained using large-scale unlabeled corpora to produce a pre-trained model with hundreds of millions of parameters. Such models can adapt to a wide range of downstream tasks and have good generalization ability. Examples include Large Language Models (LLMs) and multi-modal pre-training models.
[0019] In practical applications, large models only require a small number of samples to fine-tune the pre-trained model before they can be applied to different tasks. Large models can be widely used in fields such as Natural Language Processing (NLP) and Computer Vision. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and Image Generation, as well as NLP tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios for large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.
[0020] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0021] LLM stands for Large Language Model. Large models typically refer to deep learning models with a large number of parameters, especially in the field of natural language processing. These models learn from massive amounts of text data, enabling them to understand and generate natural language, demonstrating strong contextual understanding, generation, and reasoning abilities. Due to their scale and complexity, large models are often better able to capture subtle differences and complex structures in language.
[0022] RAG: Retrieval-Augmented Generation, is a generative model that combines retrieval mechanisms. When generating text, it not only relies on internal parameters and learned knowledge but also retrieves relevant information from external knowledge bases based on context, then integrates this information into the production process. This improves the relevance and accuracy of the generated content, especially when handling tasks requiring specific facts or details, such as question answering, document summarization, or contract review.
[0023] Prompt: In the field of natural language processing, especially in the application of large models, a prompt refers to a text used to guide the model to generate a specific type of text. Simply put, it provides the model with an initial input or problem scenario to stimulate it to produce the desired output.
[0024] In-context learning is a learning method specific to large models. The model can infer and learn from provided contextual examples without additional training. In other words, the user only needs to include some example inputs and expected outputs in the prompt, and the large model can understand the task requirements and attempt to mimic these examples to generate answers. This is particularly useful for one-off tasks or small-scale applications because it avoids the expensive microprocessing.
[0025] Contract review is the process of thoroughly examining contract documents to ensure their legal validity and commercial soundness. This includes verifying the clarity, compliance, and logical consistency of the clauses, as well as conducting a risk assessment to ensure the contract complies with relevant regulations and protects the rights and interests of both parties.
[0026] Few-Shot Learning is a learning method that aims to enable algorithms to learn and generalize to new tasks with only a very small number of labeled samples. In traditional machine learning and deep learning tasks, models usually require a large amount of labeled data for effective training. The goal of few-shot learning is to reduce this dependence on large amounts of data, enabling models to learn quickly from a few examples and make accurate predictions or decisions.
[0027] Contract review is a crucial step in ensuring the safety of both parties' interests and preventing risks. It aims to verify the legality, fairness, and clarity of the contract's terms, thus establishing a solid foundation for the partnership. However, in traditional work models, contract review is difficult to master quickly due to its highly specialized nature, and the cumbersome review process, with each clause evaluated, consumes a significant amount of time and energy.
[0028] Existing contract review solutions integrate large-scale language modeling technology. They specify detailed contract review checklists and use the large language model to perform review tasks based on these checklists. This method systematically completes contract evaluation and yields review results. While this approach fully leverages the efficiency of large language models in handling large-scale contracts and parsing complex clauses, it still has the following problems in practical use: 1. Incorrect review direction: Due to the large amount of professional knowledge in the review checklist, the large language model does not fully understand the review checklist, which will cause a deviation between the content reviewed by the large language model and the actual needs in the review checklist, ultimately resulting in an incorrect review direction that does not meet the needs of the real scenario.
[0029] 2. Limited Practicality of Modification Suggestions: Although modification suggestions for contract review are closely related to the business itself and require continuous consultation to form specific and precise suggestions, in the contract review process, lawyers typically provide specific modification suggestions for definite content and clear prompts for content requiring consultation in the form of templates. However, due to the lack of professional knowledge in specific review scenarios, the large language model often provides overly broad modifications based on the original text, or contains non-standard expressions. Consequently, the generated annotations do not provide effective guidance in real contract review scenarios.
[0030] Based on this, a text processing method is provided in this specification. This specification also relates to a text processing device, a task platform, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0031] See Figure 1 , Figure 1 A flowchart of a text processing method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0032] Step 102: Receive the text to be processed, and at least one processing rule for the text to be processed.
[0033] The text to be processed is the text type that needs to be processed in the method provided in the embodiments of this specification, and the processing rules can be understood as the rules for operating and processing the text to be processed.
[0034] For example, when the text to be processed is a contract text, the processing rules can be the contract text review rules; or when the text to be processed is a promotional text, the processing rules can be the promotional text review rules, and so on.
[0035] In the methods provided in the embodiments of this specification, the text to be processed needs to be processed based on at least one processing rule. Therefore, it is necessary to obtain the text to be processed and at least one processing rule for the text to be processed.
[0036] In one specific embodiment provided in this specification, a text to be processed is received, along with at least one processing rule for the text to be processed, including: Receive a text processing instruction, wherein the text processing instruction carries the text to be processed, the text type of the text to be processed, and the processing rule text; Parse the processing rule text to obtain at least one processing rule carried in the processing rule text.
[0037] In this embodiment, the terminal running the text processing method of the embodiments of this specification can receive a text processing instruction, which carries the text to be processed, the text type of the text to be processed, and the processing rule text.
[0038] The text type can be understood as determining the type of text to be processed. For example, if the text to be processed is a contract, the text type could be a sales contract, a confidentiality agreement, or a confidentiality agreement. The processing rule text can be understood as the text that stores the processing rules for the text to be processed.
[0039] After obtaining the processing rule text, the processing rule text can be parsed to obtain at least one processing rule from the processing rule text. In practical applications, the processing rule text can be a text document or a table document, etc. In the method provided in the embodiments of this specification, the form of the processing rule text is not limited.
[0040] Step 104: Determine at least one processing clause type based on the text type of the text to be processed and the target processing rule, wherein the target processing rule is any one of at least one processing rule.
[0041] Here, the processing clause type can be understood as the clause type upon which the processing clause corresponding to the text type and the target processing rule is based; that is, what processing clause is used to process the text to be processed when the target processing rule is executed. The target processing rule can be understood as any one of at least one processing rule. In this embodiment, there can be multiple processing rules for the text to be processed, and these multiple processing rules are independent of each other. To better explain the method provided in the embodiments of this specification, this embodiment uses one target processing rule as an example for explanation and illustration.
[0042] The text type of the text to be processed can determine the type of text to be processed, which makes it easier to determine the processing terms and subsequent processing methods of the text to be processed in subsequent text processing based on the text type.
[0043] In one specific implementation provided in this specification, taking the text to be processed as a contract text as an example, the corresponding text type can be a sales contract, a confidentiality contract, a confidentiality agreement, etc. For a certain processing rule, the corresponding processing clause type can be a clause type in the Contract Law or other relevant regulations.
[0044] In the embodiments provided in this specification, several processing clause types associated with the target processing rule can be pre-set. However, in practical applications, processing rules are not fixed, there is no fixed format between processing rules, and there may not be a fixed correspondence between processing rules and processing clause types. Based on this, in a specific embodiment provided in this specification, at least one processing clause type is determined according to the text type of the text to be processed and the target processing rule, including: Obtain the text type of the text to be processed, and select the target processing rule from among the processing rules; Generate processing rule prompt text based on the text type and the target processing rule; The processing rule prompt text is input into the rule analysis model to obtain at least one processing clause type determined by the rule analysis model based on the text type and the target processing rule.
[0045] In this implementation, to better determine the type of processing clause, it is necessary to use the text type of the text to be processed and select the target processing rule from the processing rules. The text type and the target processing rule are concatenated to generate the processing rule prompt text. The processing rule prompt text can be understood as a prompt input to the large language model (also known as the AI large model). In the AI large model, the prompt's role is to provide the AI model with contextual information about the input and the parameter information of the input model. The prompt helps the large model better understand the intent of the input and respond accordingly, improving the interpretability and accessibility of the large model.
[0046] In this embodiment, the processing clause types are pre-set, while the target processing rules vary. The rule analysis model is utilized to match the processing clause type corresponding to the target processing rule based on the text type and the target processing rule. In practical applications, the rule analysis model can be understood as a large language model. This embodiment uses the understanding capabilities of the large language model to match at least one processing clause type corresponding to the target processing rule.
[0047] Step 106: Generate text processing prompt text based on the target processing rule and at least one processing clause type, wherein the text processing prompt text includes a text processing reasoning path and at least one text processing example.
[0048] In text processing, prompt text can be understood as a prompt input to a large language model (also known as a large AI model). In a large AI model, the prompt's role is to provide the AI model with contextual information about the input and the model's parameters. Prompts help large models better understand the intent of the input and respond accordingly, thus improving the interpretability and accessibility of the large model.
[0049] In the method provided in the embodiments of this specification, after obtaining the target processing rule and at least one processing clause type, text processing prompts for input into a large language model can be generated based on the target processing rule and at least one processing clause type. The text processing prompts include a text processing inference path and at least one text processing example.
[0050] Text processing reasoning paths, also known as text processing thought chains, are a model reasoning process in the field of artificial intelligence. They simulate the thought processes humans use to solve complex problems, emphasizing the model's ability to progressively break down tasks and reach the final answer through a series of intermediate steps. Thought chain methods are commonly used to enhance the understanding and reasoning abilities of language models, enabling them to handle problems requiring multi-step logical reasoning. Text processing reasoning paths can be understood as thought chains specifically for text processing, treating text processing as a problem to be solved and progressively breaking down the task during the text processing process.
[0051] A text processing example is sample information for processing the text to be processed. For example, for a certain processing rule or a certain processing clause type, the corresponding correct example is a text processing example. In the method provided in the embodiments of this specification, the text processing example is determined according to the target processing rule and at least one processing clause type, and the text processing example clarifies the correct example for performing the corresponding processing on the text to be processed.
[0052] In one specific embodiment provided in this specification, text processing prompt text is generated according to the target processing rule and at least one processing clause type, including S1062-S1064: S1062. Determine at least one text processing example in the preset processing example library according to the target processing rules and each processing clause type.
[0053] The preset processing example library contains a collection of text processing examples. A text processing example is sample information for processing the text to be processed. For example, for a certain processing rule or processing clause type, the corresponding correct example is a text processing example. In the methods provided in the embodiments of this specification, the text processing examples clearly define the correct examples for performing corresponding processing on the text to be processed.
[0054] In the above steps, after determining the target processing rule and at least one processing clause type, at least one text processing example can be determined from the preset processing example library based on the target processing rule and each processing clause type.
[0055] In one specific embodiment provided in this specification, text processing examples are determined in the preset processing example library based on the target processing rules and processing clause types. The target processing rules and processing clause types are two different dimensions of acquisition conditions. In order to better acquire text processing examples, the preset processing example library includes a rule example sub-library and a clause example sub-library. Based on the target processing rules and each processing clause type, at least one text processing example is determined from the preset processing example library, including S10622-S10626: S10622. Determine the target rule example in the rule example sub-library according to the target processing rule.
[0056] In this embodiment, the preset processing example library is provided with a rule example sub-library and a clause example sub-library. The rule example sub-library stores text processing examples determined by the processing rules, and the clause example sub-library stores text processing examples determined by the clause example tags.
[0057] After obtaining the target processing rule, the target rule example can be determined from the rule example sub-library based on the target processing rule. In practical applications, the processing rule and rule example can be stored in the rule example sub-library. After obtaining the target processing rule, with the help of the large language model, the processing rule that is closest in meaning to the target processing rule can be found in the rule example sub-library, and the rule example corresponding to that processing rule can be obtained. This rule example is then used as the target rule example corresponding to the target processing rule.
[0058] In one specific embodiment provided in this specification, the rule example sub-library includes a processing rule identifier and a rule example corresponding to the processing rule identifier; Based on the target processing rules, target rule examples are determined in the rule example sub-library, including: According to the target processing rule, the target processing rule identifier is searched in the rule example sub-library; If the target processing rule identifier is found, the rule example corresponding to the target processing rule identifier is determined as the target rule example; If the target processing rule identifier is not found, a target rule example is generated by the example generation model according to the target processing rule, and the target rule example and the processing rule identifier of the target processing rule are saved to the rule example sub-library.
[0059] In practical applications, if processing rules are saved in the rule example sub-library, the sub-library may become large due to the large number of processing rules. Therefore, in this embodiment, a corresponding processing rule identifier can be set for the target processing rule, and the processing rule identifier and rule example can be saved in the rule example sub-library. It should be noted that the processing rule identifier exists in the rule example sub-library as a primary key, and each processing rule corresponds to a unique processing rule identifier.
[0060] Based on this, the system first searches the rule example sub-library according to the target processing rule to determine whether the target processing rule identifier corresponding to the target processing rule has been pre-saved in the rule example sub-library. Target processing rules and target processing rule identifiers are stored in a one-to-one correspondence in the rule example sub-library.
[0061] If the target processing rule identifier is found in the rule example sub-library, then the rule example corresponding to the target processing rule identifier can be determined as the target rule example.
[0062] If the target processing rule identifier is not found in the rule example sub-library, it means that the corresponding rule example has not yet been set in the current rule example sub-library. In this case, the target processing rule can be input into the example generation model, and the model's capabilities can be used to generate a target rule example for the target processing rule. The target rule example and its corresponding processing rule identifier are then saved to the rule example sub-library.
[0063] S10624. Determine at least one target clause example in the clause example sub-library according to each processing clause type and the text type.
[0064] In the method provided in the embodiments of this specification, at least one target clause example is determined in the clause example sub-library based on each processing clause type and text type. In this embodiment, the text type needs to be further referenced in the process of determining the target clause example. Since the processing clause type is the processing content of the clause type of the text to be processed, there will be different clause examples for the same processing clause type and different text types. Therefore, referring to the text type in the process of determining the target clause example can make the final generated target clause example more accurate.
[0065] In one specific embodiment provided in this specification, the clause example sub-library includes clause tags and clause examples corresponding to the clause tags; Based on each processing clause type and the text type, at least one target clause example is determined in the clause example sub-library, including: At least one target clause tag is determined in the clause example sub-library based on each processing clause type and the text type; The target clause examples are determined based on the clause examples corresponding to each target clause label.
[0066] In this embodiment, the clause example sub-library also pre-stores corresponding processing clause types and clause examples. At least one target clause tag is determined in the clause example sub-library based on each processing clause type and text type. The target clause tag can be understood as a clause tag stored in the clause example sub-library that corresponds to the processing clause type.
[0067] Furthermore, a large language model can be used to query the sub-library of sample clauses to find the target clause types corresponding to each processing clause type. The processing clause types and text types are input into the large language model and matched against pre-saved clause tags in the sub-library of sample clauses to find at least one target clause tag that matches the processing clause type. In practical applications, one processing clause type can correspond to one or more clause tags.
[0068] Once at least one target clause tag has been identified in the clause example sub-library, the target clause example can be determined in the clause example sub-library based on each target clause tag.
[0069] Specifically, the target clause examples are determined based on the clause examples corresponding to each target clause tag, including: Input the clause examples corresponding to each target clause label and the target processing rules into the processing rule relevance model; Obtain the rule relevance between the example clauses output by the processing rule relevance model and the target processing rule; At least one example of a target clause is determined based on the number of pre-set regulations and the relevance of each rule.
[0070] In the method provided in the embodiments of this specification, at least one target clause example determined in the above steps is determined according to the processing clause type and text type, and the processing clause type is determined according to the processing rules. In this process, in order to avoid the deviation problem caused by semantic understanding, the relevance between subsequent clause examples and target processing rules can be further strengthened by the similarity between the target processing rules and each target clause tag.
[0071] Specifically, the clause examples and target processing rules corresponding to each target clause tag can be concatenated and input into the processing rule relevance model. This model can also be understood as a large language model, capable of analyzing the rule relevance between each clause example and the target processing rule. The processing rule relevance model can analyze the rule relevance between each clause example and the target processing rule, sort the clause examples based on their relevance, and select a preset number of target clause examples from them according to a preset number of regulations.
[0072] For example, after the above processing, 20 clause examples can be recalled through each target clause tag. These 20 clause examples and the target processing rules are then input into the processing rule relevance model to obtain the 20 rule relevance scores output by the model. These 20 clause examples are then sorted according to their rule relevance scores, and based on a preset number of rules (5), the top 5 clause examples are selected as the target clause examples.
[0073] S10626. Generate at least one text processing example based on the target rule example and each target clause example.
[0074] In practical applications, a target processing rule can recall one target rule example, and at least one processing clause type can recall multiple target clause examples. The target rule example and each target clause example can serve as at least one text processing example corresponding to the target processing rule.
[0075] In one specific embodiment provided in this specification, the preset processing example library is created through the following steps: Obtain the sample processing rules and sample text; The sample processing rule is input into the rule example generation model to obtain the sample rule example corresponding to the sample processing rule generated by the rule example generation model. Receive annotation instructions for sample text, and determine the sample text type, sample clause label, and sample clause example corresponding to the sample clause label based on the annotation instructions; The sample processing rules and sample rule examples are saved to the rule example sub-library of the preset processing example library, and the sample text type, sample clause tag, and sample clause example are saved to the clause example sub-library of the preset processing example library.
[0076] In this embodiment, a method for generating a preset processing example library is also provided. Specifically, sample processing rules and sample text are first obtained.
[0077] Here, sample processing rules can be understood as rules that require text processing. Sample text can be understood as standard text that needs to be used to assist in creating a pre-defined processing example library.
[0078] The sample processing rules are input into the rule example generation model, which is then trained to generate corresponding rule examples based on the sample processing rules. After inputting the sample processing rules into the rule example generation model, the sample rule examples generated by the rule example generation model can be obtained.
[0079] In addition, annotation instructions from professionals can be received for the sample text. Based on the annotation instructions, the sample text type, sample clause tags, and sample clause examples corresponding to the sample clause tags are determined.
[0080] Subsequently, the sample processing rules and sample rule examples can be saved to the rule example sub-library of the preset processing example library; the sample text type, sample clause tag, and sample clause example can be saved to the clause example sub-library of the preset processing example library.
[0081] Specifically, the sample processing rule is input into the rule example generation model to obtain a sample rule example corresponding to the sample processing rule generated by the rule example generation model, including: The sample processing rules are input into the rule example generation model to obtain at least one reference rule example generated by the rule example generation model. In each reference rule example, the sample rule example corresponding to the sample processing rule is determined.
[0082] In practical applications, although the rule example generation model is trained to generate corresponding rule examples based on the sample processing rules, it may suffer from model illusion or may not be able to directly generate suitable rule examples. Therefore, the rule example generation model can generate multiple reference rule examples based on the sample processing rules, and select the sample rule example corresponding to the sample processing rules from the multiple reference rule examples.
[0083] The specific selection rules can be that professionals select sample rule examples from multiple reference rule examples, or the rule example generation model can score each reference rule example during the process of generating reference rule examples and select the reference rule example with the highest score as the sample rule example corresponding to the sample processing rule.
[0084] Pre-creating a library of preset processing examples makes it easier and faster to recall at least one text processing example from the library during subsequent processing, thus accelerating data processing efficiency.
[0085] S1064. Generate text processing prompt text based on the text to be processed, each text processing example, the target processing rule, and the preset text processing template.
[0086] Each text processing example corresponds to a text processing example of the target processing rule. After obtaining each text processing example, the text to be processed, each text processing example, the target processing rule, and the preset text processing template can be combined to generate text processing prompts.
[0087] The preset text processing template is used to generate text processing prompts. It includes a text processing reasoning path, or text processing thought chain. In the field of artificial intelligence, a thought chain is a model reasoning process that simulates the thinking path humans take when solving complex problems. It emphasizes the model's ability to progressively decompose tasks and reach the final answer through a series of intermediate steps. The thought chain method is commonly used to enhance the understanding and reasoning abilities of language models, enabling them to handle problems requiring multi-step logical reasoning. The text processing thought chain can be understood as a thought chain specifically for text processing, treating text processing as a problem to be solved and progressively decomposing the task within the text processing process.
[0088] In one specific embodiment provided in this specification, text processing prompt text is generated based on the text to be processed, various text processing examples, the target processing rule, and a preset text processing template, including: Obtain the preset text processing template, wherein the preset text processing template includes a text processing reasoning path, empty spaces for text to be processed, empty spaces for text processing examples, and empty spaces for processing rules; The text to be processed is filled into the empty spaces of the text to be processed, each text processing example is filled into the empty spaces of the text processing example, and the target processing rule is filled into the empty spaces of the processing rule to generate the text processing prompt text.
[0089] In this embodiment, the preset text processing template is a pre-set text template containing formatted text content, such as text processing reasoning paths. It also includes spaces for filling the text to be processed, text processing examples, and target processing rules.
[0090] The text to be processed is filled into the empty spaces of the text to be processed in the preset text processing template, each text processing example is filled into the empty spaces of the text processing example in the preset text processing template, and the target processing rule is filled into the empty spaces of the processing rule in the preset text processing template, thereby generating text processing prompt text.
[0091] Step 108: Input the text processing prompt text into the text processing model to obtain the text processing result output by the text processing model for the target processing rule, wherein the text processing model processes the text to be processed and each text processing example based on the text processing inference path to generate the text processing result.
[0092] The text processing prompts are input into the text processing model, which is then trained to perform corresponding text processing on the text to be processed based on the prompts, thereby obtaining the text processing result corresponding to the target processing rule. Specifically, the text processing model processes the text to be processed based on the text processing inference path and various text processing examples, thereby generating the text processing result corresponding to the target processing rule.
[0093] In one or more embodiments provided in this specification, the text processing result may include the processing result performed on the text to be processed based on the target processing rule. This may include determining whether the text to be processed satisfies the target processing rule, and if it does not satisfy the target processing rule, generating corresponding modified reference content based on the text processing example.
[0094] The above describes the processing method for at least one processing rule. Since the text to be processed includes at least one processing rule, in a specific embodiment provided in this specification, the method further includes: Obtain the text processing results corresponding to each processing rule; A text processing display page is generated based on the text to be processed and the text processing results corresponding to each processing rule.
[0095] The same processing method described above can be applied to each processing rule to obtain the text processing result corresponding to each rule. The text to be processed and the text processing results corresponding to each processing rule are then combined and concatenated to generate a text processing display page. This display page shows the processing results corresponding to each processing rule in the text to be processed, allowing users to review them.
[0096] The method provided in this specification integrates processing examples from two dimensions: processing rules and processing clause types. This ensures that the reference information input into the text processing model possesses both completeness and professionalism. Examples corresponding to processing rules cover the rule content comprehensively but lack specialized knowledge, while examples corresponding to clause types have strong professional knowledge but cannot fully cover all the key points of the rules. Rule-level examples can avoid processing errors caused by incomplete or biased understanding of the rules by the model, while clause-level examples, with higher professionalism, can guide the model to provide more specific and accurate modification suggestions. The two types of examples complement each other, forming high-quality examples, and assist the text processing model in providing more accurate text processing results under the guidance of the text processing inference path.
[0097] In addition, during the construction of the pre-defined processing example library, rule example sub-libraries and clause example sub-libraries are generated separately. Reference examples conforming to the rule requirements are generated multiple times through a large model, and high-quality reference examples are selected as rule examples to generate the rule example sub-library. The clause example sub-library is constructed by expert-level technical personnel who have compiled clause-level example libraries for different text types. The content in the rule example sub-library effectively addresses the problem of missing review content and guides the model to a comprehensive understanding of the rules. The clause example sub-library addresses the problem of ambiguous modification suggestions, showing the model the degree of detail that the text to be processed can be refined, enabling the model to produce more detailed and structurally complete processing results.
[0098] The following is in conjunction with the appendix Figure 2 Taking the text processing method provided in this specification in the application of contract review as an example, the text processing method will be further explained. Figure 2 This specification illustrates a flowchart of a text processing method for contract review scenarios, provided by an embodiment of this specification, which specifically includes the following steps.
[0099] Step 202: Receive the contract text to be processed, and at least one audit rule for the contract text to be processed.
[0100] Step 204: Determine at least one audit clause type based on the contract type of the contract text to be processed and the target audit rule, wherein the target audit rule is any one of at least one audit rule.
[0101] Step 206: Generate contract review prompt text based on the target review rules and at least one review clause type, wherein the contract review prompt text includes a contract review reasoning path and at least one text review example.
[0102] Step 208: Input the contract review prompt text into the contract review model to obtain the contract review result output by the contract review model for the target review rule, wherein the contract review model processes the contract text to be processed and each text review example based on the contract review reasoning path to generate the contract review result.
[0103] In one specific embodiment provided in this specification, at least one type of audit clause is determined based on the contract type of the contract text to be processed and the target audit rules, including: Obtain the contract type of the contract text to be processed, and select the target review rule from among the review rules; Generate audit rule prompt text based on the contract type and the target audit rules; Input the audit rule prompt text into the rule analysis model to obtain at least one audit clause type determined by the rule analysis model based on the contract type and the target audit rule.
[0104] In one specific embodiment provided in this specification, contract review prompt text is generated based on the target review rules and at least one review clause type, including: Based on the target audit rules and each audit clause type, at least one text audit example is determined from the preset audit example library.
[0105] Generate contract review prompt text based on the contract text to be processed, the text review examples, the target review rules, and the preset contract review template.
[0106] In one specific embodiment provided in the embodiments of this specification, the preset audit example library includes a rule example sub-library and a clause example sub-library; Based on the target audit rules and each audit clause type, at least one text audit example is determined from the preset audit example library, including: Based on the target audit rules, a target rule example is determined in the rule example sub-library; Based on each audit clause type and the contract type, at least one target clause example is determined in the clause example sub-library; At least one text review example is formed based on the target rule example and the target clause examples.
[0107] In one specific embodiment provided in this specification, the rule example sub-library includes an audit rule identifier and rule examples corresponding to the audit rule identifier; Based on the target auditing rules, target rule examples are determined in the rule example sub-library, including: According to the target review rule, the target review rule identifier is searched in the rule example sub-library; If the target review rule identifier is found, the rule example corresponding to the target review rule identifier is determined as the target rule example; If the target review rule identifier is not found, a target rule example is generated based on the target review rule using the example generation model, and the target rule example and the review rule identifier of the target review rule are saved to the rule example sub-library.
[0108] In one specific embodiment provided in this specification, the clause example sub-library includes clause tags and clause examples corresponding to the clause tags; Based on each audit clause type and the contract type, at least one target clause example is determined in the clause example sub-library, including: Based on each audit clause type and the contract type, at least one target clause tag is determined in the clause example sub-library; The target clause examples are determined based on the clause examples corresponding to each target clause label.
[0109] In one specific embodiment provided in this specification, the target clause example is determined based on the clause example corresponding to each target clause label, including: Input the clause examples corresponding to each target clause label and the target review rules into the review rule relevance model; Obtain the rule relevance of each clause example output by the review rule relevance model to the target review rule; At least one example of a target clause is determined based on the number of pre-set regulations and the relevance of each rule.
[0110] In one specific embodiment provided in this specification, a contract review prompt text is generated based on the contract text to be processed, various text review examples, the target review rules, and a preset contract review template, including: Obtain a preset contract review template, wherein the preset contract review template includes a contract review reasoning path, empty spaces for contract text to be processed, empty spaces for text review examples, and empty spaces for review rules; The unprocessed contract text is filled into the unprocessed contract text space of the preset contract review template, each text review example is filled into the text review example space of the preset contract review template, and the target review rule is filled into the review rule space of the preset contract review template to generate contract review prompt text.
[0111] The method provided in the embodiments of this specification integrates examples from both the dimensions of audit rules and audit clauses. While the audit rule examples offer comprehensive coverage and a well-structured format, they lack specialized knowledge. The audit clause examples, on the other hand, possess stronger specialized knowledge, providing examples of rules related to both the current contract type and other contract types, thus offering more references for the model. However, a single example typically only covers a portion of the rules and cannot encompass the entire set. This method simplifies the creation of a template library of common clauses and rules, satisfying different audit rules for the same contract type without requiring the annotation of each rule individually.
[0112] Example audit rules can effectively prevent the model from making errors in audit direction due to incomplete or biased understanding of the rules. Example audit clauses are more professional and can guide the model to provide specific modification suggestions. The two types of examples can complement each other to form high-quality examples, providing accurate audit conclusions guided by the contract audit reasoning path.
[0113] This paper systematically elucidates the logical framework of the reference examples using a contract review reasoning approach. This framework covers multiple stages of contract review and provides a detailed analysis of the specific logic of the reference examples in each stage. Through this process, the model identifies and filters instance fields closely related to contract defects and review criteria. These selected fields constitute the core reference material, ensuring that the model effectively retains all key and useful content when filtering information, avoiding the loss of valuable information.
[0114] See Figure 3 , Figure 3 This specification illustrates a text processing method for cloud-side devices according to an embodiment of the present invention, which specifically includes the following steps.
[0115] Step 302: Receive the contract text to be processed sent by the receiving end-side device, and at least one auditing rule for the contract text to be processed.
[0116] Step 304: Determine at least one audit clause type based on the contract type of the contract text to be processed and the target audit rule, wherein the target audit rule is any one of at least one audit rule.
[0117] Step 306: Generate contract review prompt text based on the target review rules and at least one review clause type, wherein the contract review prompt text includes a contract review reasoning path and at least one text review example.
[0118] Step 308: Input the contract review prompt text into the contract review model to obtain the contract review result output by the contract review model for the target review rule, wherein the contract review model processes the contract text to be processed and each text review example based on the contract review reasoning path to generate the contract review result.
[0119] Step 310: Send the contract review results corresponding to each review rule to the terminal device.
[0120] In practical applications, reviewing the contract text may require significant computing resources. Therefore, it is necessary to ensure that the terminal running this method has sufficient computing resources. However, some edge devices may lack the necessary processing capabilities. Therefore, the method provided in this specification can also be implemented on a cloud-side device. The cloud-side device receives the contract text to be processed from the edge device, along with at least one review rule for the contract text. After performing the above steps, it obtains the contract review results corresponding to each review rule and feeds these results back to the edge device.
[0121] Figure 4 A schematic diagram of a task platform provided in an embodiment of this specification is shown. The task platform includes a request interface 402 and a response unit 404, wherein: The request interface 402 is used to receive the contract text to be processed sent by the end device, and at least one audit rule for the contract text to be processed. The response unit 404 is configured to determine at least one audit clause type based on the contract type of the contract text to be processed and the target audit rule, wherein the target audit rule is any one of at least one audit rule; generate a contract audit prompt text based on the target audit rule and at least one audit clause type, wherein the contract audit prompt text includes a contract audit reasoning path and at least one text audit example; input the contract audit prompt text into a contract audit model to obtain a contract audit result output by the contract audit model for the target audit rule, wherein the contract audit model processes the contract text to be processed and each text audit example based on the contract audit reasoning path to generate the contract audit result.
[0122] Corresponding to the above method embodiments, this specification also provides embodiments of a text processing device. Figure 5 A schematic diagram of the structure of a text processing apparatus according to one embodiment of this specification is shown. Figure 5 As shown, the device includes: The receiving module 502 is configured to receive text to be processed and at least one processing rule for the text to be processed. The determining module 504 is configured to determine at least one processing clause type based on the text type of the text to be processed and the target processing rule, wherein the target processing rule is any one of at least one processing rule; The generation module 506 is configured to generate text processing prompt text based on the target processing rule and at least one processing clause type, wherein the text processing prompt text includes a text processing reasoning path and at least one text processing example; The processing module 508 is configured to input the text processing prompt text into the text processing model and obtain the text processing result output by the text processing model for the target processing rule, wherein the text processing model processes the text to be processed and each text processing example based on the text processing inference path to generate the text processing result.
[0123] Optionally, the determining module 504 is further configured to: Obtain the text type of the text to be processed, and select the target processing rule from among the processing rules; Generate processing rule prompt text based on the text type and the target processing rule; The processing rule prompt text is input into the rule analysis model to obtain at least one processing clause type determined by the rule analysis model based on the text type and the target processing rule.
[0124] Optionally, the generation module 506 is further configured to: Based on the target processing rules and the types of processing clauses, at least one text processing example is determined from the preset processing example library; Generate text processing prompts based on the text to be processed, text processing examples, target processing rules, and preset text processing templates.
[0125] Optionally, the default processing example library includes a rule example sub-library and a clause example sub-library; The generation module 506 is further configured as follows: Based on the target processing rules, a target rule example is determined in the rule example sub-library; At least one target clause example is determined in the clause example sub-library based on each processing clause type and the text type; Generate at least one text processing example based on the target rule example and each target clause example.
[0126] Optionally, the rule example sub-library includes a processing rule identifier and a rule example corresponding to the processing rule identifier; The generation module 506 is further configured as follows: According to the target processing rule, the target processing rule identifier is searched in the rule example sub-library; If the target processing rule identifier is found, the rule example corresponding to the target processing rule identifier is determined as the target rule example; If the target processing rule identifier is not found, a target rule example is generated by the example generation model according to the target processing rule, and the target rule example and the processing rule identifier of the target processing rule are saved to the rule example sub-library.
[0127] Optionally, the clause example sub-library includes clause tags and clause examples corresponding to the clause tags; The generation module 506 is further configured as follows: At least one target clause tag is determined in the clause example sub-library based on each processing clause type and the text type; The target clause examples are determined based on the clause examples corresponding to each target clause label.
[0128] Optionally, the generation module 506 is further configured to: Input the clause examples corresponding to each target clause label and the target processing rules into the processing rule relevance model; Obtain the rule relevance between the example clauses output by the processing rule relevance model and the target processing rule; At least one example of a target clause is determined based on the number of pre-set regulations and the relevance of each rule.
[0129] Optionally, the generation module 506 is further configured to: Obtain the preset text processing template, wherein the preset text processing template includes a text processing reasoning path, empty spaces for text to be processed, empty spaces for text processing examples, and empty spaces for processing rules; The text to be processed is filled into the empty spaces of the text to be processed, each text processing example is filled into the empty spaces of the text processing example, and the target processing rule is filled into the empty spaces of the processing rule to generate the text processing prompt text.
[0130] Optionally, the receiving module 502 is further configured to: Receive a text processing instruction, wherein the text processing instruction carries the text to be processed, the text type of the text to be processed, and the processing rule text; Parse the processing rule text to obtain at least one processing rule carried in the processing rule text.
[0131] Optionally, the apparatus further includes an example library creation module, configured to: Obtain the sample processing rules and sample text; The sample processing rule is input into the rule example generation model to obtain the sample rule example corresponding to the sample processing rule generated by the rule example generation model. Receive annotation instructions for sample text, and determine the sample text type, sample clause label, and sample clause example corresponding to the sample clause label based on the annotation instructions; The sample processing rules and sample rule examples are saved to the rule example sub-library of the preset processing example library, and the sample text type, sample clause tag, and sample clause example are saved to the clause example sub-library of the preset processing example library.
[0132] Optionally, the example library creation module is further configured as follows: The sample processing rules are input into the rule example generation model to obtain at least one reference rule example generated by the rule example generation model. In each reference rule example, the sample rule example corresponding to the sample processing rule is determined.
[0133] Optionally, the device further includes a page generation module configured to: Obtain the text processing results corresponding to each processing rule; A text processing display page is generated based on the text to be processed and the text processing results corresponding to each processing rule.
[0134] The apparatus provided in this specification integrates processing examples from two dimensions: processing rules and processing clause types. This ensures that the reference information input into the text processing model possesses both completeness and professionalism. Examples corresponding to processing rules cover the rule content comprehensively but lack specialized knowledge, while examples corresponding to clause types have strong professional knowledge but cannot fully cover all the key points of the rules. Rule-level examples can avoid processing errors caused by incomplete or biased understanding of the rules by the model, while clause-level examples, with higher professionalism, can guide the model to provide more specific and accurate modification suggestions. The two types of examples complement each other, forming high-quality examples, and assist the text processing model in providing more accurate text processing results under the guidance of the text processing inference path.
[0135] In addition, during the construction of the pre-defined processing example library, rule example sub-libraries and clause example sub-libraries are generated separately. Reference examples conforming to the rule requirements are generated multiple times through a large model, and high-quality reference examples are selected as rule examples to generate the rule example sub-library. The clause example sub-library is constructed by expert-level technical personnel who have compiled clause-level example libraries for different text types. The content in the rule example sub-library effectively addresses the problem of missing review content and guides the model to a comprehensive understanding of the rules. The clause example sub-library addresses the problem of ambiguous modification suggestions, showing the model the degree of detail that the text to be processed can be refined, enabling the model to produce more detailed and structurally complete processing results.
[0136] The above is an illustrative scheme of a text processing device according to this embodiment. It should be noted that the technical solution of this text processing device and the technical solution of the above-described text processing method belong to the same concept. For details not described in detail in the technical solution of the text processing device, please refer to the description of the technical solution of the above-described text processing method.
[0137] Figure 6 A structural block diagram of a computing device 600 provided according to one embodiment of this specification is shown.
[0138] The computing device 600 includes: Memory 610 and processor 620; The memory 610 is used to store computer programs / instructions, and the processor 620 is used to execute the computer programs / instructions, which, when executed by the processor 620, implement the steps of the text processing method.
[0139] In one or more embodiments of this specification, the computing device can be understood as an integrated smart terminal, including but not limited to a server, desktop computer, PC (Personal Computer), all-in-one model machine, mobile phone, tablet computer or other portable smart terminal, etc., and the computing device may have the model described in the above embodiments of this application pre-installed.
[0140] Specifically, this computing device can pre-install various types of models, including but not limited to models in natural language processing, visual processing, speech processing, code processing, and multimodal task processing, thus providing diverse model selection. In different product forms, this computing device can support one or more model usage methods, including but not limited to model training, model invocation, model fine-tuning, model deployment, model inference, and application. In some product forms, this computing device also supports model management, including but not limited to multi-type model management (supporting the management of discriminative, generative, and other model types), model version control (supporting the control of different model versions), and model evaluation (evaluating model performance and effectiveness based on model evaluation tools). In other product forms, this computing device can also create applications based on models, providing API (Application Programming Interface) calling capabilities. Users can call models into created applications through the API interface, and application management tools are also provided to manage and monitor the applications.
[0141] Furthermore, the computing device can also include data management (supporting the creation and management of model tuning datasets), a training center (providing abundant training resources to help users learn and master AI (Artificial Intelligence) technology), and basic control capabilities (providing enterprise-level basic control capabilities to ensure the security and efficient operation of the system). Through the above functions, it provides a comprehensive and integrated device for AI development, training, deployment, and application.
[0142] Furthermore, the components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 and the memory 610 can be connected via a bus.
[0143] The computing device 600 may also include an access device that enables the computing device 600 to communicate with a database storing data via one or more networks. Examples of such networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.
[0144] In one embodiment of this specification, the above-described components of the computing device 600 and Figure 6 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 6 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0145] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 600 can also be a mobile or stationary server.
[0146] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 600 can also be a mobile or stationary server.
[0147] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above-described text processing method belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above-described text processing method.
[0148] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described text processing method.
[0149] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the computer-readable storage medium embodiments are basically similar to the text processing method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the text processing method embodiments.
[0150] An embodiment of this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described text processing method.
[0151] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above-described text processing method belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the above-described text processing method.
[0152] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0153] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0154] It should be noted that the above description describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous. Secondly, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of this specification.
[0155] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0156] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A text processing method, comprising: Receive the text to be processed, and at least one processing rule for the text to be processed; At least one processing clause type is determined based on the text type of the text to be processed and the target processing rule, wherein the target processing rule is any one of at least one processing rule; A text processing prompt text is generated based on the target processing rule and at least one processing clause type, wherein the text processing prompt text includes a text processing reasoning path and at least one text processing example; The text processing prompt text is input into the text processing model to obtain the text processing result output by the text processing model for the target processing rule. The text processing model processes the text to be processed and each text processing example based on the text processing inference path to generate the text processing result.
2. The method of claim 1, wherein determining at least one processing clause type based on the text type of the text to be processed and the target processing rule includes: Obtain the text type of the text to be processed, and select the target processing rule from among the processing rules; Generate processing rule prompt text based on the text type and the target processing rule; The processing rule prompt text is input into the rule analysis model to obtain at least one processing clause type determined by the rule analysis model based on the text type and the target processing rule.
3. The method as described in claim 1, comprising generating text processing prompt text based on the target processing rule and at least one processing clause type, including: Based on the target processing rules and the types of processing clauses, at least one text processing example is determined from the preset processing example library; Generate text processing prompts based on the text to be processed, text processing examples, target processing rules, and preset text processing templates.
4. The method as described in claim 3, wherein the preset processing example library includes a rule example sub-library and a clause example sub-library; Based on the target processing rules and each processing clause type, at least one text processing example is determined from the preset processing example library, including: Based on the target processing rules, a target rule example is determined in the rule example sub-library; At least one target clause example is determined in the clause example sub-library based on each processing clause type and the text type; Generate at least one text processing example based on the target rule example and each target clause example.
5. The method as described in claim 4, wherein the rule example sub-library includes a processing rule identifier and rule examples corresponding to the processing rule identifier; Based on the target processing rules, target rule examples are determined in the rule example sub-library, including: According to the target processing rule, the target processing rule identifier is searched in the rule example sub-library; If the target processing rule identifier is found, the rule example corresponding to the target processing rule identifier is determined as the target rule example; If the target processing rule identifier is not found, a target rule example is generated by the example generation model according to the target processing rule, and the target rule example and the processing rule identifier of the target processing rule are saved to the rule example sub-library.
6. The method as described in claim 4, wherein the clause example sub-library includes clause tags and clause examples corresponding to the clause tags; Based on each processing clause type and the text type, at least one target clause example is determined in the clause example sub-library, including: At least one target clause tag is determined in the clause example sub-library based on each processing clause type and the text type; The target clause examples are determined based on the clause examples corresponding to each target clause label.
7. The method of claim 6, wherein determining the target clause example based on the clause example corresponding to each target clause tag, includes: Input the clause examples corresponding to each target clause label and the target processing rules into the processing rule relevance model; Obtain the rule relevance between the example clauses output by the processing rule relevance model and the target processing rule; At least one example of a target clause is determined based on the number of pre-set regulations and the relevance of each rule.
8. The method as described in claim 3, comprising generating text processing prompt text based on the text to be processed, various text processing examples, the target processing rule, and a preset text processing template, including: Obtain the preset text processing template, wherein the preset text processing template includes a text processing reasoning path, empty spaces for text to be processed, empty spaces for text processing examples, and empty spaces for processing rules; The text to be processed is filled into the empty spaces of the text to be processed, each text processing example is filled into the empty spaces of the text processing example, and the target processing rule is filled into the empty spaces of the processing rule to generate the text processing prompt text.
9. The method according to any one of claims 1-8, wherein the method receives a text to be processed and at least one processing rule for the text to be processed, comprising: Receive a text processing instruction, wherein the text processing instruction carries the text to be processed, the text type of the text to be processed, and the processing rule text; Parse the processing rule text to obtain at least one processing rule carried in the processing rule text.
10. The method as described in any one of claims 1-8, wherein the preset processing example library is created through the following steps: Obtain the sample processing rules and sample text; The sample processing rule is input into the rule example generation model to obtain the sample rule example corresponding to the sample processing rule generated by the rule example generation model. Receive annotation instructions for sample text, and determine the sample text type, sample clause label, and sample clause example corresponding to the sample clause label based on the annotation instructions; The sample processing rules and sample rule examples are saved to the rule example sub-library of the preset processing example library, and the sample text type, sample clause tag, and sample clause example are saved to the clause example sub-library of the preset processing example library.
11. The method of claim 10, wherein the sample processing rule is input into a rule example generation model to obtain a sample rule example corresponding to the sample processing rule generated by the rule example generation model, comprising: The sample processing rules are input into the rule example generation model to obtain at least one reference rule example generated by the rule example generation model. In each reference rule example, the sample rule example corresponding to the sample processing rule is determined.
12. The method according to any one of claims 1-8, further comprising: Obtain the text processing results corresponding to each processing rule; A text processing display page is generated based on the text to be processed and the text processing results corresponding to each processing rule.
13. A text processing method, comprising: Receive the contract text to be processed, and at least one audit rule for the contract text to be processed; At least one type of audit clause is determined based on the contract type and target audit rule of the contract text to be processed, wherein the target audit rule is any one of at least one audit rule; A contract review prompt text is generated based on the target review rules and at least one review clause type, wherein the contract review prompt text includes a contract review reasoning path and at least one text review example; The contract review prompt text is input into the contract review model to obtain the contract review result output by the contract review model for the target review rule. The contract review model processes the contract text to be processed and each text review example based on the contract review reasoning path to generate the contract review result.
14. A text processing method applied to a cloud-side device, comprising: The receiving end device sends the contract text to be processed, and at least one auditing rule for the contract text to be processed; At least one type of audit clause is determined based on the contract type and target audit rule of the contract text to be processed, wherein the target audit rule is any one of at least one audit rule; A contract review prompt text is generated based on the target review rules and at least one review clause type, wherein the contract review prompt text includes a contract review reasoning path and at least one text review example; The contract review prompt text is input into the contract review model to obtain the contract review result output by the contract review model for the target review rule. The contract review model processes the contract text to be processed and each text review example based on the contract review reasoning path to generate the contract review result. The contract review results corresponding to each review rule are sent to the terminal device.
15. A task platform, comprising a request interface and a response unit; The request interface is used to receive the contract text to be processed sent by the end device, and at least one audit rule for the contract text to be processed. The response unit is configured to determine at least one audit clause type based on the contract type of the contract text to be processed and the target audit rule, wherein the target audit rule is any one of the at least one audit rule; generate a contract audit prompt text based on the target audit rule and the at least one audit clause type, wherein the contract audit prompt text includes a contract audit reasoning path and at least one text audit example; input the contract audit prompt text into a contract audit model to obtain a contract audit result output by the contract audit model for the target audit rule, wherein the contract audit model processes the contract text to be processed and each text audit example based on the contract audit reasoning path to generate the contract audit result.
16. A computing device, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 14.
17. A computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 14.
18. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 14.